/* Financiero: Activos, Banco, Financiación */

#banco,
#activos,
#financiacion {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#banco .content-header,
#activos .content-header,
#financiacion .content-header {
    flex-shrink: 0;
}

#banco .content-header-sub,
#activos .content-header-sub,
#financiacion .content-header-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
}

#banco .fin-body,
#activos .fin-body,
#financiacion .fin-body {
    padding: 20px 32px 32px;
    flex: 1;
}

/* Tabs estilo Gastos */
#banco .fin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 0 0 14px;
    border-bottom: 1px solid #e5e7eb;
}

#banco .fin-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

#banco .fin-tab:hover {
    color: #111827;
    border-color: #d1d5db;
}

#banco .fin-tab.active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #93c5fd;
    font-weight: 600;
}

/* KPIs / resumen */
.fin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.fin-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
}

.fin-kpi-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.fin-kpi-value {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

/* Toolbar de sección */
.fin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fin-toolbar-left,
.fin-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fin-hint {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
}

/* Cards de cuentas */
.fin-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.fin-account-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fin-account-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.fin-account-name {
    font-weight: 600;
    font-size: 16px;
    color: #111827;
}

.fin-account-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.45;
}

.fin-account-saldo {
    text-align: right;
    flex-shrink: 0;
}

.fin-account-saldo-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.fin-account-saldo-label {
    font-size: 11px;
    color: #9ca3af;
}

.fin-account-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid #f3f4f6;
}

/* Empty state */
.fin-empty {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    background: #fafafa;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
}

.fin-empty p {
    margin: 0;
    font-size: 14px;
}

/* Alertas liquidez */
.fin-alertas {
    margin-bottom: 16px;
}

.fin-alerta {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    font-size: 13px;
    color: #374151;
}

.fin-alerta strong {
    color: #991b1b;
}

/* Tablas dentro de financiero */
#banco .table-wrapper,
#activos .table-wrapper,
#financiacion .table-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: auto;
}

#banco .table-wrapper table,
#activos .table-wrapper table,
#financiacion .table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

#banco .table-wrapper th,
#activos .table-wrapper th,
#financiacion .table-wrapper th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 12px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

#banco .table-wrapper td,
#activos .table-wrapper td,
#financiacion .table-wrapper td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
}

#banco .table-wrapper tr:last-child td,
#activos .table-wrapper tr:last-child td,
#financiacion .table-wrapper tr:last-child td {
    border-bottom: none;
}

.fin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    color: #4b5563;
}

.fin-amount-in { color: #16a34a; font-weight: 600; }
.fin-amount-out { color: #dc2626; font-weight: 600; }

/* Charts previsión tesorería */
.fin-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.fin-chart-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px 8px;
    min-height: 0;
}

.fin-chart-card.fin-chart-wide {
    grid-column: 1 / -1;
}

.fin-chart-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.fin-chart-el {
    min-height: 260px;
    width: 100%;
}

@media (max-width: 900px) {
    .fin-charts-grid {
        grid-template-columns: 1fr;
    }

    .fin-chart-card.fin-chart-wide {
        grid-column: auto;
    }
}

/* Formulario dentro de modal */
.fin-modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fin-modal-form .form-group {
    margin-bottom: 12px;
}

.fin-modal-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.fin-modal-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 28px;
    font-size: 13px;
}

@media (max-width: 640px) {
    #banco .fin-body,
    #activos .fin-body,
    #financiacion .fin-body {
        padding: 16px;
    }

    .fin-modal-form .form-row {
        grid-template-columns: 1fr;
    }

    .fin-modal-form .form-check {
        padding-top: 0;
    }
}
