/* Ruta: /home/fabimoda/cuadre.fabimodas.com/css/styles.css */
:root {
    --primary: #5a67d8; 
    --yape: #a855f7;    
    --plin: #ef4444;    
    --tarjeta: #3b82f6; 
    --transf: #6b7280;  
    --success: #10b981; 
    --danger: #ef4444;  
    --dark: #1f2937;    
    --bg: #f3f4f6;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: var(--bg); 
    margin: 0; 
    color: #333;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 { margin: 0; color: var(--primary); font-size: 24px; }
.btn-admin { padding: 8px 15px; border-radius: 6px; border: 1px solid #ccc; background: white; cursor: pointer; }

/* Contenedor principal */
.container {
    display: grid;
    grid-template-columns: 1fr 450px; 
    gap: 20px;
    padding: 20px 30px;
    transition: all 0.3s ease;
}

/* Tarjetas Blancas (Paneles) */
.card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}

.card h3 { 
    margin-top: 0; 
    font-size: 16px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    display: flex;
    align-items: center;
    gap: 8px;
}

.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }

.label-pequeno { font-size: 12px; color: #6b7280; display: block; margin-bottom: 5px; }
.label-bold { font-size: 13px; font-weight: bold; color: #111827; display: block; margin-bottom: 8px; }

input[type="text"], input[type="number"], .select-metodo {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}
input:focus, .select-metodo:focus { border-color: var(--primary); }

.w-100 { width: 100%; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }

.input-group { display: grid; grid-template-columns: 1fr 100px 45px; gap: 8px; }
.input-group-select { display: flex; gap: 8px; align-items: center; }
.input-monto-small { width: 80px; }
.select-metodo { flex-grow: 1; }

button { cursor: pointer; font-weight: bold; transition: 0.2s; border: none; }
button:hover { opacity: 0.9; }

.btn-plus { background: var(--success); color: white; border-radius: 6px; font-size: 16px; display: flex; align-items: center; justify-content: center; height: 100%; }
.btn-minus { background: var(--danger); color: white; border-radius: 6px; font-size: 16px; display: flex; align-items: center; justify-content: center; height: 100%; }
.btn-sm { padding: 10px 15px; height: auto; }

.box-descuento { background-color: #fff5f5; border: 1px solid #fecaca; border-radius: 8px; padding: 15px; }
.box-extra { background-color: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 15px; }

.grid-bancos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }
.banco-box { border: 2px solid #eee; padding: 15px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; background-color: white; }
.banco-box label { font-weight: bold; text-align: center; margin-bottom: 5px; }

.yape { border-color: var(--yape); } .yape label { color: var(--yape); } .yape button { background: var(--yape); color: white; padding: 10px; border-radius: 6px; width: 100%; }
.plin { border-color: var(--plin); } .plin label { color: var(--plin); } .plin button { background: var(--plin); color: white; padding: 10px; border-radius: 6px; width: 100%; }
.tarjeta { border-color: var(--tarjeta); } .tarjeta label { color: var(--tarjeta); } .tarjeta button { background: var(--tarjeta); color: white; padding: 10px; border-radius: 6px; width: 100%; }
.transf { border-color: var(--transf); } .transf label { color: var(--transf); } .transf button { background: var(--transf); color: white; padding: 10px; border-radius: 6px; width: 100%; }

/* =========================================
   ZONA 2: VISOR NORMAL Y BOTONES FLOTANTES
========================================= */
.resumen-total { background: var(--success); color: white; text-align: center; padding: 25px; border-radius: 12px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); }
.resumen-total p { margin: 0; font-size: 14px; font-weight: bold; opacity: 0.9; }
.resumen-total h2 { margin: 10px 0 0 0; font-size: 40px; }

.grid-totales-bancos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.caja-banco { padding: 10px; border-radius: 8px; text-align: center; color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.caja-banco p { margin: 0; font-size: 12px; font-weight: bold; opacity: 0.9; }
.caja-banco h4 { margin: 5px 0 0 0; font-size: 16px; }
.bg-yape { background-color: var(--yape); }
.bg-plin { background-color: var(--plin); }
.bg-tarjeta { background-color: var(--tarjeta); }
.bg-transf { background-color: var(--transf); }

.caja-ayuda {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.caja-ayuda:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.tooltip-ayuda {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.1);
    padding: 4px 0;
    border-radius: 4px;
}

.totales-secundarios { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.caja-oscura { background: var(--dark); color: white; padding: 15px; border-radius: 10px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.caja-oscura p { margin: 0; font-size: 12px; color: #9ca3af; }
.caja-oscura h3 { margin: 5px 0 0 0; font-size: 20px; }
.border-verde { border: 2px solid var(--success); background: white; }
.text-verde { color: var(--success) !important; }

.historial { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid #eaeaea; }
.historial h3 { margin-top: 0; font-size: 14px; color: #666; text-align: center; font-weight: bold; margin-bottom: 15px; }

.acordeon-contenedor { display: flex; flex-direction: column; gap: 8px; }
.grupo-historial { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; }
.grupo-historial summary { padding: 10px 15px; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; font-size: 14px; user-select: none; }
.grupo-historial summary::-webkit-details-marker { display: none; }
.badge { background: #e5e7eb; color: #374151; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; float: right; }

.lista-categoria { padding: 10px; border-top: 1px solid #e5e7eb; background: white; max-height: 200px; overflow-y: auto; }
.item-mov { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px; border-bottom: 1px dashed #e0e0e0; font-size: 13px; }
.item-mov:last-child { border-bottom: none; }

.btn-guardar { width: 100%; padding: 18px; background: var(--primary); color: white; border-radius: 10px; font-size: 16px; margin-top: 20px; box-shadow: 0 4px 10px rgba(90, 103, 216, 0.3); }

/* =========================================
   ZONA 3: DASHBOARD GIGANTE (REPORTE)
========================================= */
.btn-modo-reporte {
    background-color: var(--dark);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.btn-modo-reporte:hover { background-color: #111827; transform: translateY(-2px); }

.reporte-detallado {
    background: transparent;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.header-reporte {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.header-reporte h2 { margin: 0; color: var(--dark); display: flex; align-items: center; gap: 10px; }

.btn-volver {
    background-color: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-volver:hover { background-color: #f9fafb; color: #1f2937; }

/* LAYOUT 2 COLUMNAS DASHBOARD */
.layout-reporte {
    display: grid;
    grid-template-columns: 320px 1fr; 
    gap: 30px;
    align-items: start;
}

.columna-resumen-lateral {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.columna-resumen-lateral .resumen-total { margin-bottom: 15px; padding: 20px; }
.columna-resumen-lateral .caja-oscura { margin-bottom: 0; }

.columna-tarjetas-desglose { width: 100%; }

.grid-reporte-gigante {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.card-detallada {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.card-detallada h3 {
    margin-top: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ccc;
    margin-bottom: 15px;
}

.detalle-linea { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 10px; color: #4b5563; }
.detalle-linea.text-danger { color: var(--danger); font-weight: 500; }
.card-detallada hr { border: 0; border-top: 2px solid #eee; margin: 15px 0; }
.detalle-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 900; }

.seccion-motivos {
    background: #fdf2f2; 
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 15px;
}

.badge-gasto {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.bg-danger { background-color: var(--danger); }
.bg-yape { background-color: var(--yape); }
.bg-plin { background-color: var(--plin); }

.contenedor-lista-motivos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-motivo {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4b5563;
    padding: 6px 0;
    border-bottom: 1px dashed #fca5a5;
}
.item-motivo:last-child { border-bottom: none; padding-bottom: 0; }
.motivo-texto { flex-grow: 1; padding-right: 15px; font-style: italic; }
.motivo-monto { font-weight: 700; color: var(--danger); white-space: nowrap; }

.border-efectivo { border-top: 5px solid var(--success); }
.text-efectivo { color: var(--success); }
.border-yape { border-top: 5px solid var(--yape); }
.text-yape { color: var(--yape); }
.border-plin { border-top: 5px solid var(--plin); }
.text-plin { color: var(--plin); }
.border-tarjeta { border-top: 5px solid var(--tarjeta); }
.text-tarjeta { color: var(--tarjeta); }
.border-transf { border-top: 5px solid var(--transf); }
.text-transf { color: var(--transf); }

.swal2-html-container select {
    margin-top: 10px;
}

/* =========================================
   ZONA 4: PANEL ADMINISTRATIVO (NUEVO)
========================================= */
.admin-panel {
    background: transparent;
    animation: fadeIn 0.4s ease-out;
}

.filtros-admin {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

/* Tarjeta Resumen del Historial */
.tarjeta-cuadre {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tarjeta-cuadre:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.info-basica {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.fecha-cuadre { font-weight: bold; font-size: 16px; color: #1f2937; }
.detalles-empleado { font-size: 13px; color: #6b7280; display: flex; gap: 15px; }
.detalles-empleado span { display: flex; align-items: center; gap: 5px; }

.mini-totales {
    display: flex;
    gap: 15px;
    align-items: center;
}
.cuadro-mini {
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    min-width: 100px;
}
.cuadro-mini p { margin: 0 0 3px 0; font-size: 11px; opacity: 0.9; }
.cuadro-mini h4 { margin: 0; font-size: 15px; }

.mini-efectivo { background-color: var(--success); color: white; }
.mini-bancos { background-color: var(--primary); color: white; }
.mini-general { background-color: var(--dark); color: white; border: 2px solid var(--success); }

.btn-ver-mas {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
}
.btn-ver-mas:hover {
    background: var(--primary);
    color: white;
}
/* ==========================================
   MODO RESPONSIVE (CELULARES Y TABLETS)
   ========================================== */

/* Laptops pequeñas y Tablets (rompemos el ancho fijo de 450px del JS) */
@media (max-width: 1024px) {
    #mainContainer {
        grid-template-columns: 1fr !important; /* Fuerza a usar 1 sola columna */
        gap: 20px;
        padding: 15px;
    }
    #secVisual {
        width: 100%;
        margin-top: 20px;
    }
}

/* Celulares */
@media (max-width: 768px) {
    /* Encabezado */
    header {
        flex-direction: row; /* Mantenemos el botón a la derecha */
        padding: 15px;
    }
    header h1 {
        font-size: 20px;
    }
    
    /* Convertimos las dos columnas en una sola */
    .dos-columnas {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* Tarjetas del panel Administrador */
    .tarjeta-cuadre {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Cuadritos de los mini totales en Admin */
    .mini-totales {
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }
    .cuadro-mini {
        flex: 1 1 45%; /* Dos cuadritos por fila para que se vea ordenado */
        min-width: 120px;
    }

    /* Botón Ver Más del Admin */
    .btn-ver-mas {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    /* Detalle VIP (El desglose gigante) */
    .grid-totales-bancos {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 columnas en vez de 4 */
        gap: 10px;
    }
    .totales-secundarios {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Para que los acordeones de PLIN/TARJETA no se aplasten */
    details.estetico summary {
        flex-wrap: wrap;
        gap: 10px;
    }
}