/* ========================================
   WALYPAY - SISTEMA DE DISEÑO CORPORATIVO
   Paleta: Púrpura Profundo + Verde Esmeralda + Amarillo Dorado
   ======================================== */

:root {
    /* Paleta Corporativa */
    --purple-deep: #6a11cb;
    --purple-light: #7c3aed;
    --purple-dark: #5b21b6;

    --green-emerald: #10b981;
    --green-success: #059669;
    --green-light: #34d399;

    --gold-yellow: #f59e0b;
    --gold-accent: #fbbf24;

    /* Neutrales Premium */
    --dark-bg: #0f172a;
    --dark-sidebar: #1e293b;
    --light-bg: #f8fafc;
    --card-white: #ffffff;

    /* Estados */
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Sombras y Efectos */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-purple: 0 8px 24px rgba(106, 17, 203, 0.25);

    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--light-bg);
    color: #1e293b;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== LAYOUT ==================== */

#wrapper {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ==================== SIDEBAR PREMIUM ==================== */

#sidebar-wrapper {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #6a11cb 0%, #5b21b6 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(106, 17, 203, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== SIDEBAR BRAND (LOGO) ==================== */

.sidebar-brand {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
}

.brand-icon-wrapper i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.sidebar-brand-text {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
}

.sidebar-brand-text span {
    color: var(--gold-yellow);
    margin-left: 1px;
}

.brand-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--purple-light);
    filter: blur(15px);
    opacity: 0.3;
    z-index: -1;
}

.list-group-flush {
    padding: 16px 0;
    flex: 1;
}

.list-group-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 14px 24px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.list-group-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 28px;
}

.list-group-item.active {
    background: linear-gradient(90deg, rgba(106, 17, 203, 0.15) 0%, transparent 100%);
    color: var(--gold-yellow);
    border-left-color: var(--gold-yellow);
    font-weight: 600;
}

/* ==================== PAGE CONTENT ==================== */

#page-content-wrapper {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: var(--light-bg);
    overflow-y: auto;
    min-height: 100vh;
}

/* ==================== CARDS PREMIUM ==================== */

.card-premium {
    background: var(--card-white);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-premium:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-header-premium {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-premium h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* ==================== BOTONES ==================== */

.btn-primary-custom {
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple-light) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(106, 17, 203, 0.3);
    letter-spacing: 0.01em;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(106, 17, 203, 0.4);
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--gold-yellow), var(--gold-accent));
    color: #1e293b;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--green-emerald), var(--green-success));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ==================== TABLAS ==================== */

.table-custom {
    width: 100%;
}

.table-custom thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.table-custom tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.table-custom tbody tr:hover {
    background: #f8fafc;
}

.table-custom tbody td {
    padding: 16px;
    color: #334155;
    font-size: 0.95rem;
}

/* ==================== BADGES ==================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--green-emerald), var(--green-success)) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--gold-yellow), var(--gold-accent)) !important;
    color: #1e293b !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626) !important;
}

/* ==================== MODALES ==================== */

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-light));
    color: white;
    padding: 24px 28px;
    border: none;
}

.modal-header h5 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 20px 28px;
}

/* ==================== FORMS ==================== */

.form-control,
.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--purple-deep);
    box-shadow: 0 0 0 4px rgba(106, 17, 203, 0.1);
    background: white;
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 8px;
}

/* ==================== STATS CARDS ==================== */

.stat-card {
    padding: 24px;
    border-radius: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 12px;
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ==================== RESPONSIVE ==================== */

/* Overlay para móviles */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}


/* ==================== TABS & NAV PILLS ==================== */

.nav-pills .nav-link {
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-pills .nav-link i {
    font-size: 1.1rem;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-light)) !important;
    color: white !important;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: #f1f5f9;
    color: var(--purple-deep);
}

/* ==================== BADGES SOFT ==================== */

.badge-soft {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-success-soft {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.bg-danger-soft {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.bg-info-soft {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.bg-secondary-soft {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

/* Tab panes transition */
.tab-pane {
    animation: fadeInTab 0.4s ease forwards;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Botón de cerrar sidebar en móvil */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        transform: translateX(-100%);
        z-index: 1000;
    }

    #sidebar-wrapper.show {
        transform: translateX(0);
    }

    #sidebar-wrapper.show .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #page-content-wrapper {
        margin-left: 0;
        padding: 20px;
    }

    .card-premium {
        border-radius: 12px;
    }
}

/* ==================== ANIMACIONES ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ==================== GLASSMORPHISM ==================== */

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ==================== SCROLLBAR CUSTOM ==================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--purple-deep), var(--purple-light));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}

/* ==================== PREMIUM NOTIFICATIONS (TOASTS) ==================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1080;
    pointer-events: none;
}

.toast-premium {
    min-width: 320px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.toast-premium.show {
    transform: translateX(0);
}

.toast-premium.hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}

.toast-premium .icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-premium.success .icon-circle {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-premium.error .icon-circle {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-premium .toast-content {
    flex: 1;
}

.toast-premium .toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 2px;
}

.toast-premium .toast-msg {
    font-size: 0.85rem;
    color: #64748b;
}

/* ==================== PREMIUM CONFIRM MODAL ==================== */

.modal-premium {
    border-radius: 24px;
    border: none !important;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.modal-premium .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 24px 32px;
}

.modal-premium .modal-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.modal-premium .modal-body {
    padding: 32px;
}

.modal-premium .modal-footer {
    padding: 24px 32px;
    background: #f8fafc;
    border: none;
}

.modal-premium-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 24px;
}

.modal-premium-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.modal-premium-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.btn-premium-confirm {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-light));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-premium-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(106, 17, 203, 0.3);
    color: white;
}

.btn-premium-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-premium-cancel:hover {
    background: #e2e8f0;
}