﻿/* ==========================================
   🏦 BANK ACCOUNTS MODULE
   ========================================== */

/* ── Summary cards ── */
.bank-summary-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bank-summary-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bank-summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    border-left: 4px solid #5FBCBC;
}

.bank-summary-card.debt {
    border-left-color: #e74c3c;
}

.bank-summary-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    margin-bottom: 4px;
}

.bank-summary-amount {
    font-size: 28px;
    font-weight: 700;
    color: #5FBCBC;
}

.bank-summary-card.debt .bank-summary-amount {
    color: #e74c3c;
}

.bank-summary-updated {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* ── Chart card ── */
.bank-chart-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    position: relative;
}

.bank-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bank-chart-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.bank-chart-tabs {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.bank-chart-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.bank-chart-tab:not(:last-child) {
    border-right: 1px solid #ddd;
}

.bank-chart-tab.active {
    background: #f0f0f0;
    color: #111;
}

.bank-chart-tab:hover {
    background: #f8f8f8;
}

#bankChart {
    max-height: 220px;
}

.bank-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot.ingreso { background: #5FBCBC; }
.legend-dot.egreso  { background: #e74c3c; }

/* ── Table section ── */
.bank-table-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    overflow: hidden;
}

.bank-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 12px;
}

.bank-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}

.bank-status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.bank-status-dot.active::before { background: #27ae60; }
.bank-status-dot.inactive::before { background: #e74c3c; }

.bank-balance-cell {
    font-weight: 700;
    color: #5FBCBC;
}

/* ── Modal crear banco ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bank-modal {
    background: #fff;
    border-radius: 14px;
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.bank-modal-header {
    margin-bottom: 4px;
}

.bank-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px 0;
}

.bank-modal-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
}

.bank-modal .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}

.bank-modal .form-group {
    display: flex;
    flex-direction: column;
}

.bank-modal .label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.bank-modal .form-control {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.bank-modal .form-control:focus {
    border-color: #5FBCBC;
    box-shadow: 0 0 0 2px rgba(95, 188, 188, 0.15);
}

.currency-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.currency-input-wrapper input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.currency-input-wrapper .currency-tag {
    padding: 8px 12px;
    background: #f5f5f5;
    border-left: 1px solid #ccc;
    font-size: 12px;
    font-weight: 700;
    color: #666;
}

.bank-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ── Detail page ── */
.bank-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.bank-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.bank-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    text-align: center;
}

.bank-stat-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    margin-bottom: 4px;
}

.bank-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.bank-stat-value.ingreso { color: #5FBCBC; }
.bank-stat-value.egreso  { color: #e74c3c; }

/* ── Transaction type badges ── */
.tx-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.tx-badge.ingreso {
    background: #e8f7f1;
    color: #1b6b4b;
}

.tx-badge.egreso {
    background: #fde8e8;
    color: #c0392b;
}

.tx-amount.ingreso { color: #27ae60; font-weight: 600; }
.tx-amount.egreso  { color: #c0392b; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .bank-summary-row {
        grid-template-columns: 1fr;
    }
    .bank-detail-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .bank-detail-stats {
        grid-template-columns: 1fr;
    }
}