/* ============================================================
   SISTEMA DE PRÉSTAMOS - ESTILOS PERSONALIZADOS
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- Variables CSS ---------- */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --secondary: #FF6B6B;
    --accent-green: #00C9A7;
    --accent-orange: #FF8C42;
    --accent-yellow: #FFD93D;
    --accent-cyan: #00D2FF;
    --accent-pink: #FF6B9D;
    --dark: #1A1A2E;
    --dark-2: #16213E;
    --dark-3: #0F3460;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --bg-light: #F8F9FD;
    --bg-card: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.08);
    --shadow-md: 0 4px 20px rgba(108, 99, 255, 0.12);
    --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.18);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---------- LOGIN PAGE ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before,
.login-wrapper::after {
    display: none;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: conic-gradient(from var(--neon-angle, 0deg),
            #00c853, #f44336, #ffc107, #00c853, #f44336, #ffc107, #00c853);
    z-index: -2;
    animation: neonSpin 4s linear infinite;
}

.login-card::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: calc(var(--radius-lg) - 1px);
    background: rgba(255, 255, 255, 0.95);
    z-index: -1;
}

@property --neon-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes neonSpin {
    to {
        --neon-angle: 360deg;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
    color: white;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.4);
    transform: rotate(-5deg);
    transition: var(--transition);
}

.login-logo .logo-icon:hover {
    transform: rotate(0deg) scale(1.05);
}

.login-logo h1 {
    color: #1a3c2a;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: #5a6b5e;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* --- Login Inputs (standard, no floating) --- */
.login-card .input-group-custom {
    margin-bottom: 18px;
}

.login-card .input-group-custom label {
    display: block;
    color: #3a4a3e;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.login-card .input-group-custom .form-control {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 2px solid rgba(0, 80, 40, 0.12);
    border-radius: var(--radius-sm);
    color: #2d3436 !important;
    font-size: 1rem;
    padding: 14px 16px;
    height: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    caret-color: #2e7d32;
    position: relative;
}

.login-card .input-group-custom .form-control:hover {
    border-color: rgba(46, 125, 50, 0.35);
    background: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.08);
    transform: translateY(-1px);
}

.login-card .input-group-custom .form-control:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #2e7d32;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12), 0 4px 20px rgba(46, 125, 50, 0.15);
    color: #2d3436 !important;
    transform: translateY(-2px);
}

.login-card .input-group-custom .form-control::placeholder {
    color: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.login-card .input-group-custom .form-control:focus::placeholder {
    color: rgba(0, 0, 0, 0.15);
    transform: translateX(5px);
}

.login-card .input-group-custom .form-control:-webkit-autofill,
.login-card .input-group-custom .form-control:-webkit-autofill:hover,
.login-card .input-group-custom .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #2d3436 !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(245, 240, 232, 0.95) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}




.btn-login {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(46, 125, 50, 0.4);
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    color: #fff;
}

.btn-login:active {
    transform: translateY(0);
}

.login-alert {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #c0392b;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ---------- DASHBOARD LAYOUT ---------- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

.main-content {
    flex: 1;
    padding: 30px;
    margin-right: 280px;
    transition: var(--transition);
}

/* Layout sin sidebar (cobrador) */
.dashboard-wrapper.no-sidebar .main-content {
    margin-right: 0;
}

/* Tarjetas de navegación cobrador */
.nav-card-green,
.nav-card-cyan,
.nav-card-orange {
    cursor: pointer;
    transition: all .2s ease;
}

.nav-card-green:hover,
.nav-card-cyan:hover,
.nav-card-orange:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(108, 92, 231, .15);
}

/* ---------- SIDEBAR DERECHA ---------- */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 50%, var(--dark-3) 100%);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .user-avatar {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.sidebar-header .user-avatar-img {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.sidebar-header h5 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-header .badge-role {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-admin {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.badge-cobrador {
    background: linear-gradient(135deg, var(--accent-green), #00B894);
    color: #fff;
}

.badge-asesor {
    background: linear-gradient(135deg, var(--accent-orange), #E17055);
    color: #fff;
}

/* Nav Links */
.sidebar-nav {
    padding: 15px 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    padding: 12px 14px 6px;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: rgba(108, 99, 255, 0.15);
    color: #fff;
    transform: translateX(-3px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.25), rgba(108, 99, 255, 0.1));
    color: #fff;
    box-shadow: 0 2px 10px rgba(108, 99, 255, 0.15);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--secondary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-footer .btn-logout:hover {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

/* ---------- HEADER TOP ---------- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-header h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header .fecha-hoy {
    background: rgba(108, 99, 255, 0.08);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
}

/* ---------- DASHBOARD CARDS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: #fff;
}

.stat-card .card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Card colors */
.stat-card.card-clientes::before {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.stat-card.card-clientes .card-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.stat-card.card-clientes .card-value {
    color: var(--primary);
}

.stat-card.card-cobrados::before {
    background: linear-gradient(90deg, var(--accent-green), #00B894);
}

.stat-card.card-cobrados .card-icon {
    background: linear-gradient(135deg, var(--accent-green), #00B894);
}

.stat-card.card-cobrados .card-value {
    color: var(--accent-green);
}

.stat-card.card-por-cobrar::before {
    background: linear-gradient(90deg, var(--accent-orange), #E17055);
}

.stat-card.card-por-cobrar .card-icon {
    background: linear-gradient(135deg, var(--accent-orange), #E17055);
}

.stat-card.card-por-cobrar .card-value {
    color: var(--accent-orange);
}

.stat-card.card-negativas::before {
    background: linear-gradient(90deg, var(--secondary), #EE5A6F);
}

.stat-card.card-negativas .card-icon {
    background: linear-gradient(135deg, var(--secondary), #EE5A6F);
}

.stat-card.card-negativas .card-value {
    color: var(--secondary);
}

.stat-card.card-solicitudes::before {
    background: linear-gradient(90deg, var(--accent-cyan), #0984E3);
}

.stat-card.card-solicitudes .card-icon {
    background: linear-gradient(135deg, var(--accent-cyan), #0984E3);
}

.stat-card.card-solicitudes .card-value {
    color: var(--accent-cyan);
}

/* ---------- CONTENT CARD ---------- */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.content-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- BUTTONS ---------- */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--accent-green), #00B894);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 201, 167, 0.3);
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 201, 167, 0.4);
    color: #fff;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--secondary), #EE5A6F);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    color: #fff;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    color: #fff;
}

.btn-lg-custom {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* ---------- TABLES ---------- */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table-custom thead th {
    background: var(--dark);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border: none;
}

.table-custom thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table-custom thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table-custom tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: rgba(108, 99, 255, 0.03);
}

/* ---------- STATUS BADGES ---------- */
.badge-estatus {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pendiente {
    background: rgba(255, 217, 61, 0.15);
    color: #E67E22;
}

.badge-aprobado {
    background: rgba(0, 201, 167, 0.15);
    color: var(--accent-green);
}

.badge-rechazado {
    background: rgba(255, 107, 107, 0.15);
    color: var(--secondary);
}

.badge-activo {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary);
}

.badge-completado {
    background: rgba(0, 210, 255, 0.15);
    color: var(--accent-cyan);
}

.badge-vencido {
    background: rgba(255, 107, 107, 0.25);
    color: #C0392B;
}

/* ---------- MOBILE TOGGLE ---------- */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-size: 1.4rem;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.08);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .login-card {
        padding: 35px 25px;
    }
}

/* ---------- SCROLLBAR SIDEBAR ---------- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* ---------- ANIMATIONS ---------- */
.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* ---------- WELCOME SECTION ---------- */
.welcome-section {
    background: linear-gradient(135deg, var(--primary), var(--dark-3));
    border-radius: var(--radius-lg);
    padding: 35px;
    color: #fff;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -50px;
    right: -30px;
}

.welcome-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.welcome-section p {
    opacity: 0.85;
    font-size: 0.95rem;
}