.mm-wrapper { font-family: -apple-system, sans-serif; max-width: 1000px; margin: 0 auto; color: #333; }
.mm-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.mm-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid #eee; }

/* Botones */
.mm-btn { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; color: #fff; font-size: 14px; }
.mm-btn.primary { background-color: #007bff; }
.mm-btn.secondary { background-color: #6c757d; }
.mm-btn.warning { background-color: #ffc107; color: #333; }
.mm-btn.danger { background-color: #dc3545; }
.mm-btn.small { padding: 5px 10px; font-size: 12px; }
.mm-btn.full-width { width: 100%; margin-top: 10px; }

/* Inputs */
.mm-input, .mm-input-small { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.mm-input-small { width: auto; display: inline-block; }
.mm-row { display: flex; gap: 15px; margin-bottom: 10px; }
.mm-col { flex: 1; }
.mm-col label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 4px; }

/* Bancos */
.mm-banks-summary { display: flex; gap: 10px; margin-bottom: 15px; background: #f8f9fa; padding: 10px; border-radius: 4px; flex-wrap: wrap; }
.mm-tag { font-size: 13px; color: #555; margin-right: 10px; }
.bank-row { display: flex; gap: 5px; margin-bottom: 5px; align-items: center; }
.bank-row input { flex: 1; }

/* Stats */
.mm-charts-row { display: flex; gap: 20px; margin: 20px 0; }
.mm-chart-box { flex: 1; background: #fff; }
.mm-stats-summary { display: flex; gap: 10px; text-align: center; }
.stat-box { flex: 1; padding: 10px; border-radius: 4px; color: #fff; }
.stat-box h4 { margin: 0; font-size: 12px; opacity: 0.9; }
.stat-box p { margin: 5px 0 0; font-weight: bold; font-size: 18px; }
.stat-box.in { background: #28a745; }
.stat-box.out { background: #dc3545; }
.stat-box.net { background: #17a2b8; }

/* Tabla Base */
.mm-table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.mm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mm-table th { background: #f1f1f1; padding: 10px; text-align: left; }
.mm-table td { border-bottom: 1px solid #eee; padding: 8px; }
.mm-table tr.gasto { color: #d63638; }
.mm-table tr.entrada { color: #28a745; }
.mm-table tfoot th { background: #f9f9f9; border-top: 2px solid #ddd; }
.mm-icon-btn { background: none; border: none; cursor: pointer; color: #999; font-size: 16px; margin-right: 8px; }
.mm-icon-btn:hover { color: #333; }

/* Popup */
.mm-popup { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: flex-start; padding-top: 50px; overflow-y: auto; }
.mm-popup-content { background: #fff; width: 90%; max-width: 500px; padding: 25px; border-radius: 8px; position: relative; margin-bottom: 50px; }
.close-popup { position: absolute; right: 15px; top: 10px; font-size: 24px; cursor: pointer; }

/* --- RESPONSIVE / MÓVIL --- */
@media(max-width: 768px) {
    /* Layout General */
    .mm-charts-row { flex-direction: column; }
    .mm-header-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mm-header-actions button { width: 100%; }
    
    /* Sección Bancos: Apilar Inputs */
    .bank-row { 
        flex-direction: column; 
        background: #fdfdfd; 
        padding: 10px; 
        border: 1px solid #eee; 
        border-radius: 5px; 
        margin-bottom: 10px; 
    }
    .bank-row input { width: 100%; margin-bottom: 5px; }
    .remove-bank-row { width: 100%; margin-top: 5px; }

    /* TABLA: Modo Tarjetas (Apilado) */
    .mm-table thead, .desktop-only { display: none; } /* Ocultar cabecera y celdas vacias */
    
    .mm-table, .mm-table tbody, .mm-table tr, .mm-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .mm-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        padding: 10px;
    }
    
    .mm-table td {
        text-align: right; /* Datos a la derecha */
        padding-left: 45%; /* Espacio para la etiqueta */
        position: relative;
        border-bottom: 1px solid #eee;
        min-height: 25px;
        font-size: 14px;
    }
    
    .mm-table td:last-child { border-bottom: none; }
    
    /* La Etiqueta (data-label) a la izquierda */
    .mm-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 40%;
        font-weight: bold;
        text-align: left;
        color: #555;
    }
    
    /* Ajustes específicos para filas de saldo inicial */
    .mm-table tr.saldo-inicial td { color: #333; font-weight: normal; }
    
    /* --- FOOTER (NETO MES) GRANDE --- */
    .mm-table tfoot, .mm-table tfoot tr {
        display: flex;
        flex-direction: row;
        width: 100%;
        box-sizing: border-box;
    }
    
    .mm-table tfoot tr {
        justify-content: space-between;
        align-items: center;
        background-color: #e3f2fd; /* Fondo azul claro para destacar */
        border: 2px solid #007bff; /* Borde azul marcado */
        padding: 20px 15px; /* Más espacio interno */
        border-radius: 8px;
        margin-top: 10px;
        margin-bottom: 30px;
    }
    
    .mm-table tfoot th {
        background: none;
        border: none;
        padding: 0;
        font-size: 20px; /* AUMENTADO: Texto grande */
        font-weight: 800; /* Texto muy grueso */
        color: #333;
    }
    
    /* El segundo TH es el monto, lo ponemos en color tema */
    .mm-table tfoot th:nth-child(2) {
        color: #007bff;
    }
}