:root {
    --yape-color: #742284;
    --yape-light: #a93ac2;
    --bg-color: #f4f6f9;
    --text-dark: #333;
    --white: #ffffff;
    --success: #00c853;
    --error: #d32f2f;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: var(--text-dark);
}

/* --- ESTILOS DEL DASHBOARD --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.container.visible { opacity: 1; visibility: visible; }

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--yape-color);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(116, 34, 132, 0.3);
    margin-bottom: 20px;
}

.logo-area { display: flex; align-items: center; gap: 15px; font-size: 1.5rem; }
.header-text h1 { margin: 0; font-size: 1.5rem; }
.header-text small { display: block; font-size: 0.85rem; opacity: 0.9; font-weight: 300; }

.btn-logout {
    background: white; border: 1px solid #ddd; padding: 8px 15px; border-radius: 20px;
    cursor: pointer; font-size: 0.85rem; color: #555; transition: 0.3s;
}
.btn-logout:hover { background: #fff0f0; color: var(--error); border-color: var(--error); }

/* --- LOGIN MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(45, 12, 54, 0.98); display: none; justify-content: center; align-items: center; z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal-container {
    background: var(--white); padding: 30px; border-radius: 20px; width: 90%; max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); text-align: center; animation: slideUp 0.4s ease-out;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header h3 { color: var(--yape-color); margin: 10px 0 5px; }
.modal-header p { color: #888; font-size: 0.9rem; margin-bottom: 20px; }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: #555; }

.input-full {
    width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 10px; font-size: 1rem;
    box-sizing: border-box; outline: none; transition: 0.3s;
}
.input-full:focus { border-color: var(--yape-light); }

.btn-primary {
    width: 100%; padding: 15px; background: linear-gradient(45deg, var(--yape-color), var(--yape-light));
    color: white; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: 10px; transition: transform 0.2s;
}
.btn-primary:hover { transform: scale(1.02); }
.error-msg { color: var(--error); font-size: 0.85rem; margin-bottom: 10px; min-height: 20px; }

/* --- ZONA DE TRABAJO (2 COLUMNAS) --- */
.work-area {
    display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 20px;
    height: calc(100vh - 140px); min-height: 500px;
}

/* COLUMNA IZQUIERDA: MERCADO */
.section-market {
    background: #eef2f5; border-radius: 15px; padding: 15px; overflow-y: auto; border: 1px solid #ddd;
}
.section-header h3 { margin: 0; color: #555; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.section-header small { color: #888; display: block; margin-bottom: 15px; margin-left: 32px; }

/* Tarjetas Flotantes */
.card-yape {
    background: white; padding: 15px; border-radius: 12px; margin-bottom: 12px;
    border-left: 5px solid #ccc; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.card-yape:hover {
    transform: translateX(5px); border-left-color: var(--yape-color); box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-info h4 { margin: 0 0 5px 0; font-size: 1rem; color: #333; }
.card-info small { font-size: 0.75rem; color: #999; }
.card-action { text-align: right; min-width: 80px; }
.monto-libre { display: block; font-size: 1.2rem; font-weight: bold; color: #555; margin-bottom: 5px; }
.btn-agarrar {
    background: var(--yape-color); color: white; border: none; padding: 5px 15px;
    border-radius: 15px; font-size: 0.8rem; cursor: pointer;
}

/* ESTILO DEL CÓDIGO (NUEVO) */
.msg-codigo {
    display: block; background-color: #fff9c4; color: #333; font-family: monospace;
    font-size: 0.85rem; padding: 6px 10px; border-radius: 6px; border: 1px dashed #fbc02d;
    margin-top: 6px; word-break: break-all;
}

/* COLUMNA DERECHA: MI CARPETA */
.section-folder {
    background: white; border: 2px solid var(--yape-color); border-radius: 15px;
    overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.folder-header {
    background: var(--yape-color); color: white; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.mi-total-badge {
    background: rgba(255,255,255,0.2); padding: 5px 12px; border-radius: 8px; font-size: 1.3rem; font-weight: bold;
}
.folder-body { flex-grow: 1; overflow-y: auto; padding: 0; }
.folder-table { width: 100%; border-collapse: collapse; }
.folder-table th {
    position: sticky; top: 0; background: #f9f9f9; padding: 12px; font-size: 0.85rem; color: #666;
    text-align: left; border-bottom: 1px solid #eee; z-index: 2;
}
.folder-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; color: #444; vertical-align: top; }
.monto-mio { color: var(--success); font-weight: bold; font-size: 1.05rem; }
.fila-mia { animation: highlightFade 1s; }
.vacio { text-align: center; padding: 30px; color: #aaa; font-style: italic; display: block; width: 100%; }

@keyframes highlightFade { from { background-color: rgba(0, 200, 83, 0.2); } to { background-color: transparent; } }

/* Responsive */
@media (max-width: 768px) {
    .work-area { grid-template-columns: 1fr; height: auto; }
    .section-market { min-height: 300px; }
    .section-folder { min-height: 400px; }
    .dashboard-header { flex-direction: column; gap: 15px; text-align: center; }
}