/* =========================================
   ESTILO NEO-BLACK PROFESIONAL - 2026
   ========================================= */

/* Importar tipografía moderna */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;800&display=swap');

:root {
    --bg-deep: #05070a;       /* Negro profundo */
    --bg-card: #0d1117;       /* Gris oscuro para tarjetas */
    --accent-neo: #2dd4bf;    /* Turquesa Neón */
    --border-soft: rgba(255, 255, 255, 0.05);
    
    /* Colores de las Tarjetas */
    --color-cyan: #06b6d4;
    --color-green: #10b981;
    --color-red: #ef4444;
    --color-gold: #fbbf24;
}

/* 1. RESET Y ESTRUCTURA GLOBAL */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-deep);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    display: flex; /* Sidebar y Main conviven lado a lado */
    min-height: 100vh;
}

/* 2. CONTENIDO PRINCIPAL (CORRECCIÓN DE POSICIÓN) */
.main-content {
    flex: 1;
    /* Ajusta este margen al ancho real de tu sidebar */
    margin-left: 260px; 
    padding: 40px;
    box-sizing: border-box;
    background: radial-gradient(circle at top right, #0a1018, #05070a);
}

.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* 3. CABECERA (TÍTULO Y FILTROS) */
.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.2rem;
    color: var(--accent-neo);
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.3));
}

.header-wrapper h1 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Inputs y Botones Estilo Neo */
.input-fecha-neo {
    background: var(--bg-card);
    border: 1px solid #30363d;
    color: #fff;
    padding: 10px 15px;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
}

.input-fecha-neo:focus {
    border-color: var(--accent-neo);
}

/* 4. GRID DE TARJETAS (4 EN FILA) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columnas iguales */
    gap: 20px;
    margin-bottom: 35px;
}

/* 5. TARJETAS NEO-BLACK COMPACTAS */
.card-neo {
    background: linear-gradient(145deg, #0f172a, #05070a);
    border-top: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    padding: 20px;
    border-radius: 18px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.card-neo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-neo span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.card-neo i {
    font-size: 1.5rem;
}

.card-neo h2 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
}

/* 6. COLORES ESPECÍFICOS Y BORDES (IZQUIERDA Y ABAJO) */
.card-cyan { border-left: 4px solid var(--color-cyan); border-bottom: 4px solid var(--color-cyan); }
.card-cyan span, .card-cyan h2, .card-cyan i { color: var(--color-cyan); }

.card-green { border-left: 4px solid var(--color-green); border-bottom: 4px solid var(--color-green); }
.card-green span, .card-green h2, .card-green i { color: var(--color-green); }

.card-red { border-left: 4px solid var(--color-red); border-bottom: 4px solid var(--color-red); }
.card-red span, .card-red h2, .card-red i { color: var(--color-red); }

.card-gold { border-left: 4px solid var(--color-gold); border-bottom: 4px solid var(--color-gold); }
.card-gold span, .card-gold h2, .card-gold i { color: var(--color-gold); }

/* --- CONTENEDOR DEL GRÁFICO --- */
.graph-section {
    background: linear-gradient(180deg, #0d1117 0%, #05070a 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px;
    margin-top: 50px; /* Más espacio debajo de la tabla */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Efecto de cristal al badge de ganancia */
.net-profit-badge {
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.net-profit-badge:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.graph-header {
    margin-bottom: 20px;
}

.graph-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
}

/* Ajuste de altura del gráfico */
#movimientosChart {
    max-height: 400px;
    width: 100% !important;
}

/* --- CONTENEDOR DE ALERTA DORADO PREMIUM --- */
.alert-premium {
    background: rgba(251, 191, 36, 0.03) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    padding: 12px 25px !important;
    border-radius: 100px !important; /* Alerta redondeada también */
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fbbf24; /* Color dorado para el texto e icono */
}

.alert-content i {
    font-size: 1.4rem;
}

.alert-text {
    display: flex;
    flex-direction: column;
}

.alert-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.alert-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* --- ESTILO BASE PARA BOTONES NEO-BLACK --- */
.btn-nuevo-neo, .btn-alert-gold {
    border: none;
    padding: 10px 25px;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease-in-out; /* Transición rápida para el efecto click */
    position: relative;
    outline: none;
}

/* --- BOTÓN TURQUESA (NUEVA OPERACIÓN) --- */
.btn-nuevo-neo {
    background: #111827; /* Fondo oscuro inicial */
    color: #2dd4bf;
    border: 1px solid rgb(45, 212, 191);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5), 
                -2px -2px 10px rgba(255, 255, 255, 0.02);
}

/* EFECTO HOVER: SE UNDE Y BRILLA TURQUESA */
.btn-nuevo-neo:hover {
    transform: scale(0.95);
    background: #132f2c; /* Fondo ligeramente teñido */
    color: #fff;
    border-color: #2dd4bf;
    /* Triple capa de brillo para efecto neón */
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.8),
                0 0 10px rgba(45, 212, 191, 0.5), 
                0 0 20px rgba(45, 212, 191, 0.2);
}
/* --- BOTÓN DORADO (IR AL CONTEO) --- */
.btn-alert-gold {
    background: #111827;
    color: #fbbf24;
    border: 1px solid rgb(250, 183, 10);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    display: inline-flex;
}

/* EFECTO HOVER: SE UNDE Y BRILLA DORADO */
.btn-alert-gold:hover {
    transform: scale(0.95);
    background: #2a2416; /* Fondo ligeramente teñido */
    color: #fff;
    border-color: #fbbf24;
    /* Triple capa de brillo dorado */
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.8),
                0 0 10px rgba(251, 191, 36, 0.5), 
                0 0 20px rgba(251, 191, 36, 0.2);
}

/* --- BOTÓN FILTRAR (LUPA) --- */
.btn-filtrar {
    background: #0f172a;
    border: 1px solid rgba(45, 212, 191, 0.2);
    color: #2dd4bf;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.btn-filtrar:hover {
    transform: scale(0.9);
    color: #fff;
    border-color: #2dd4bf;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.8),
                0 0 15px rgba(45, 212, 191, 0.4);
}

/* --- CONTENEDOR DE LA TABLA --- */
.recent-activity {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-neo);
}

/* --- ESTILO DE LA TABLA --- */
.neo-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.neo-table th {
    padding: 12px 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: 1px;
}

.neo-table td {
    padding: 15px;
    font-size: 0.9rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

/* Efecto de fila */
.neo-table tr:hover td {
    background: rgba(45, 212, 191, 0.03);
    color: var(--accent-neo);
    transition: 0.3s;
}

/* Badge de tipo (Entrada/Salida) */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-in { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-out { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* --- BOTÓN HISTORIAL (ESTILO HUNDIDO) --- */
.btn-history {
    background: #0f172a;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--border-soft);
    transition: all 0.3s;
}

.btn-history:hover {
    transform: scale(0.95);
    color: var(--accent-neo);
    border-color: var(--accent-neo);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.8), 0 0 10px rgba(45, 212, 191, 0.2);
}

.btn-delete-neo {
    background: #0f172a;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-delete-neo:hover {
    transform: scale(0.9);
    background: #271616;
    color: #fff;
    border-color: #ef4444;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.8),
                0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-delete-neo i {
    font-size: 1.1rem;
}

select.input-neo {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232dd4bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Asegura que el modal flote sobre todo */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* El contenedor del formulario */
.modal-content {
    background: #0d1117;
    border: 2px solid #2dd4bf; /* Borde turquesa neón como tus tarjetas */
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.2);
}

/* --- ESTILO DE LOS BOTONES --- */
.modal-footer {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Botón GUARDAR (Gemelo del botón + NUEVA) */
.btn-save-neo {
    flex: 2;
    background: #0d1117; /* Fondo oscuro */
    color: #2dd4bf;      /* Texto turquesa */
    border: 1px solid rgba(45, 212, 191, 0.4);
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-save-neo:hover {
    transform: scale(0.95); /* Efecto hundido */
    background: #132f2c;    /* Toque turquesa oscuro */
    color: #fff;
    border-color: #2dd4bf;
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.4); /* Brillo neón */
}

/* Botón CANCELAR (Estilo Neo-Red) */
.btn-cancel-neo {
    flex: 1;
    background: #0d1117;
    color: #ef4444; /* Rojo neón */
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel-neo:hover {
    transform: scale(0.95);
    background: #2a1212;
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.input-neo {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-neo:focus {
    outline: none;
    border-color: #2dd4bf;
    background: #1c2128;
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.15);
}

/* Estilo para el contenedor de botones para que se vean como el botón "NUEVA" */
.modal-footer button {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.5px;
}

/* Contenedor flexible para alinear en línea */
.input-monto-container {
    display: flex;
    align-items: center; /* Centra verticalmente el símbolo y el texto */
    background: #0d1117; /* Fondo oscuro igual al dashboard */
    border: 1px solid rgba(45, 212, 191, 0.3); /* Borde turquesa suave */
    border-radius: 10px;
    padding: 0 12px; /* Espacio interno lateral */
    height: 45px; /* Altura fija para consistencia */
}

/* Estilo del símbolo (₡) */
.monto-simbolo {
    color: #2dd4bf;
    font-weight: 800;
    font-size: 1.1rem;
    margin-right: 8px; /* Separación del número */
    user-select: none;
}

/* Estilo del input (le quitamos los bordes propios) */
.input-monto-container input {
    flex: 1; /* El input toma todo el espacio restante */
    background: transparent !important;
    border: none !important;
    color: #fff;
    font-size: 1rem;
    outline: none !important;
    padding: 0;
    height: 100%;
}

/* Efecto al hacer clic en el campo */
.input-monto-container:focus-within {
    border-color: #2dd4bf;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}