/* Bank entry module styles */
.bank-list-sticky-card {
    position: sticky;
    top: 95px;
    z-index: 10;
}

.bank-list-container {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 0.8rem;
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}

.bank-group-section {
    margin-bottom: 0.45rem;
    border: 1px solid #e9edf6;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.bank-group-row {
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    cursor: pointer;
    transition: background-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.bank-group-row:hover {
    background-color: #f4f8ff;
}

.bank-group-section.is-expanded > .bank-group-row {
    background: linear-gradient(180deg, rgba(108, 95, 252, 0.16) 0%, rgba(237, 233, 254, 0.88) 100%);
}

.bank-group-toggle-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    text-align: center;
    color: #4f5d75;
    border-radius: 999px;
    background: #eef4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bank-group-toggle-icon i {
    transition: transform 0.28s ease;
}

.bank-group-section.is-expanded > .bank-group-row .bank-group-toggle-icon i {
    transform: rotate(90deg);
}

.bank-group-title {
    font-weight: 600;
    color: #0f172a;
}

.bank-group-count {
    display: block;
    margin-top: 0;
    font-weight: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: #64748b;
}

.bank-group-balance {
    color: #198754;
    white-space: nowrap;
}

.bank-group-balance.negative {
    color: #dc3545 !important;
}

.bank-group-children {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border-top: 1px solid #edf2f8;
}

.bank-tab {
    cursor: pointer;
    transition: all 0.24s ease;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.bank-tab:hover {
    background-color: #f6f9ff;
}



/* ── Glowing left accent bar ── */
.bank-tab::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 3.5px;
    height: 100%;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 50%, #6d28d9 100%);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.45);
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    z-index: 2;
}

.bank-tab > * {
    position: relative;
    z-index: 1;
}

/* ── Active state with moving gradient background ── */
.bank-tab.active {
    background: linear-gradient(
        -45deg,
        #f5f3ff,
        #ede9fe,
        #e8e0ff,
        #ddd6fe,
        #ede9fe,
        #f5f3ff
    );
    background-size: 300% 300%;
    border-color: rgba(167, 139, 250, 0.3) !important;
    box-shadow:
        0 4px 16px rgba(124, 58, 237, 0.10),
        0 8px 32px rgba(124, 58, 237, 0.06);
    animation:
        bank-bg-flow 6s ease-in-out infinite,
        bank-breathe-shadow 3s ease-in-out infinite;
}

.bank-tab.active::after {
    opacity: 1;
    transform: scaleY(1);
}

.bank-tab.active .bank-name {
    color: var(--primary-bg-color);
    font-weight: 700;
}

.bank-tab.active .small.text-muted {
    color: #7c3aed !important;
}

.bank-tab.active .bank-tab-balance {
    color: #0f766e;
    font-weight: 800;
}

.bank-tab.active .bank-tab-icon-wrapper {
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow:
        0 0 0 3px rgba(167, 139, 250, 0.10),
        0 4px 12px rgba(124, 58, 237, 0.12);
}

.bank-tab-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex: 0 0 40px !important;
    flex-shrink: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #eee;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bank-tab-icon-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.bank-tab-icon-wrapper i {
    font-size: 1rem;
    line-height: 1;
}

.bank-tab-balance {
    color: #198754;
}

.bank-tab-balance.negative {
    color: #dc3545 !important;
}

.bank-tab-child {
    margin: 0 !important;
    padding-left: 1rem !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
}

.bank-list-container > .bank-tab {
    margin-bottom: 0.45rem;
    background-color: #ffffff;
    border: 1px solid #e9edf6;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.bank-list-container > .bank-tab:last-child {
    margin-bottom: 0;
}

/* ── Breathing purple glow on active card ── */
@keyframes bank-breathe-shadow {
    0%, 100% {
        box-shadow:
            0 4px 16px rgba(124, 58, 237, 0.10),
            0 8px 32px rgba(124, 58, 237, 0.06);
    }
    50% {
        box-shadow:
            0 6px 24px rgba(124, 58, 237, 0.16),
            0 12px 40px rgba(124, 58, 237, 0.10);
    }
}

/* ── Smooth flowing gradient background ── */
@keyframes bank-bg-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.entry-type-credit,
.amount-credit {
    color: #198754 !important;
    font-family: "Roboto Mono", monospace;
}

.entry-type-debit,
.amount-debit {
    color: #dc3545 !important;
    font-family: "Roboto Mono", monospace;
}

/* Redesigned Bank Header */
.bank-header-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.bank-header-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
}

.bank-logo-container {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bank-logo-container img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

#headerAccountName {
    font-size: 1rem;
}

#headerBankBusinesses {
    font-size: 0.75rem;
    line-height: 1.35;
    opacity: 0.8;
}

.balance-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
}

.balance-amount {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    text-align: right;
}

.summary-pill {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.summary-pill span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.summary-pill .label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

.summary-pill .value {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
}

.summary-pill .value.text-success {
    color: #4ade80 !important;
    /* Vibrant Green */
}

.summary-pill .value.text-danger {
    color: #f87171 !important;
    /* Vibrant Red */
}

@media (max-width: 767.98px) {
    #quickAddCard .card-header {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
    }

    #quickAddCard .card-title {
        width: 100%;
        margin-bottom: 0;
    }

    #quickAddCard .card-options {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-left: 0;
    }

    #quickAddCard .card-options > .btn,
    #quickAddCard .card-options > a.btn {
        flex: 1 1 100%;
        width: 100%;
        margin: 0 !important;
        justify-content: center;
    }
}
