* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d395;
    --primary-dark: #00a876;
    --secondary: #6c5ce7;
    --bg-main: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border: #dfe6e9;
    --success: #00d68f;
    --danger: #ff3d71;
    --warning: #ffa900;
    --yape-purple: #722f84;
    --plin-blue: #00c8aa;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--bg-main);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(0, 211, 149, 0.1);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(0, 211, 149, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Balance Widget with Dropdown */
.balance-container {
    position: relative;
}

.balance-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.balance-widget:hover {
    background: rgba(0, 211, 149, 0.1);
}

.balance-amount {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.balance-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    min-width: 200px;
    display: none;
    z-index: 100;
}

.balance-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-icon {
    font-size: 1.2rem;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Section */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.bet-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
}

.bet-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
    transform: translateY(-4px);
}

.bet-card:active {
    transform: translateY(-2px);
}

.bet-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.bet-type-badge.standard {
    background: rgba(108, 92, 231, 0.1);
    color: var(--secondary);
}

.bet-type-badge.yesno {
    background: rgba(0, 211, 149, 0.1);
    color: var(--primary);
}

.bet-event {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.bet-league {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.bet-selection-box {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 1rem 0;
}

.bet-selection {
    font-weight: 600;
}

.bet-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.bet-odd {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.bet-amount {
    font-size: 1.1rem;
    font-weight: 600;
}

.value-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.value-badge.good {
    background: rgba(0, 214, 143, 0.15);
    color: var(--success);
}

.value-badge.average {
    background: rgba(255, 169, 0, 0.15);
    color: var(--warning);
}

/* Form Elements */
.form-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 211, 149, 0.1);
}

/* Info Box */
.info-box {
    background: rgba(108, 92, 231, 0.1);
    border-left: 4px solid var(--secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.info-box.success {
    background: rgba(0, 214, 143, 0.1);
    border-left-color: var(--success);
}

.info-box-title {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box.success .info-box-title {
    color: var(--success);
}

.info-box-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Risk Profile */
.risk-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.risk-option {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.risk-option:hover {
    border-color: var(--primary);
}

.risk-option.selected {
    border-color: var(--primary);
    background: rgba(0, 211, 149, 0.05);
}

.risk-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.risk-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.risk-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Calculator */
.calculator-result {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.result-value.highlight {
    color: var(--primary);
    font-size: 1.3rem;
}

/* Payment Methods */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-option {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-option:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.payment-option.selected {
    border-color: var(--primary);
    background: rgba(0, 211, 149, 0.05);
}

.payment-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.payment-logo.yape {
    background: var(--yape-purple);
    color: white;
}

.payment-logo.plin {
    background: var(--plin-blue);
    color: white;
}

.payment-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.payment-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.qr-code {
    width: 250px;
    height: 250px;
    margin: 1rem auto;
    border: 8px solid var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: repeating-linear-gradient(
        0deg,
        var(--text-primary),
        var(--text-primary) 10px,
        white 10px,
        white 20px
    ), repeating-linear-gradient(
        90deg,
        var(--text-primary),
        var(--text-primary) 10px,
        white 10px,
        white 20px
    );
}

.qr-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.qr-instructions h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.qr-instructions ol {
    text-align: left;
    margin-left: 2rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Amount Input Section */
.amount-input-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.amount-input-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.amount-slider-container {
    margin: 1rem 0;
}

.amount-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.amount-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.amount-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-hover);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-message {
    flex: 1;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Quiz */
.quiz-question {
    margin-bottom: 2rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--primary);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(0, 211, 149, 0.05);
}

.bet-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .header {
        padding: 0.75rem 0;
    }

    .nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .section-header > div:first-child {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .section-header .btn-primary {
        width: 100%;
    }

    .risk-selector {
        grid-template-columns: 1fr;
    }

    .payment-grid {
        grid-template-columns: 1fr;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        top: 60px;
        min-width: auto;
        font-size: 0.9rem;
    }

    .filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.5rem;
    }
    
    .filters::-webkit-scrollbar {
        height: 4px;
    }
    
    .filters::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }

    .bet-input-row {
        grid-template-columns: 1fr;
    }
    
    .bet-card {
        padding: 1.25rem;
    }
    
    .form-card {
        padding: 1.25rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .balance-widget {
        font-size: 0.9rem;
    }
    
    .balance-amount {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .section-title {
        font-size: 1.35rem;
    }
    
    .cards-grid {
        gap: 0.75rem;
    }
    
    .bet-card {
        padding: 1rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        margin: 0.75rem;
    }
    
    .notification {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
}

/* ============ DASHBOARD DE GOBIERNO DE DATOS ============ */

/* KPIs Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid var(--primary);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-card.kpi-primary { border-left-color: var(--primary); }
.kpi-card.kpi-secondary { border-left-color: var(--secondary); }
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }

.kpi-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.kpi-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kpi-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.kpi-badge.success { background: rgba(0, 214, 143, 0.1); color: var(--success); }
.kpi-badge.info { background: rgba(108, 92, 231, 0.1); color: var(--secondary); }
.kpi-badge.warning { background: rgba(255, 169, 0, 0.1); color: var(--warning); }

/* Trends Chart */
.trends-header {
    margin-bottom: 1rem;
}

.trends-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.trends-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 150px;
    padding: 1rem 0;
    border-bottom: 2px solid var(--border);
}

.trend-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
}

.trend-bar.volume {
    background: linear-gradient(to top, var(--primary), var(--primary-dark));
    opacity: 0.8;
}

.trend-bar.users {
    background: linear-gradient(to top, var(--secondary), #5a4bc7);
    opacity: 0.7;
}

.trend-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.trends-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.volume { background: var(--primary); }
.legend-color.users { background: var(--secondary); }

.trends-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.trend-summary-item {
    text-align: center;
}

.trend-summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trend-summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* User Segments */
.segments-header {
    margin-bottom: 1rem;
}

.segments-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.segments-chart {
    display: flex;
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.segment-bar {
    transition: width 0.5s ease;
    min-width: 2px;
}

.segments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.segment-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.segment-emoji {
    font-size: 2rem;
}

.segment-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.segment-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.segment-percentage {
    font-weight: 700;
    color: var(--primary);
}

/* Conversion Funnel */
.funnel-header {
    margin-bottom: 1.5rem;
}

.funnel-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.funnel-stage {
    position: relative;
}

.funnel-bar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.funnel-bar {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s ease;
    min-width: 60px;
}

.funnel-count {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.funnel-label {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.funnel-label strong {
    color: var(--text-primary);
}

.funnel-percentage {
    color: var(--primary);
    font-weight: 600;
}

.funnel-dropoff {
    text-align: center;
    color: var(--danger);
    font-size: 0.8rem;
    padding: 0.5rem 0;
}

/* Top Users */
.top-users-header {
    margin-bottom: 1rem;
}

.top-users-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.top-users-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.top-users-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--bg-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.top-users-tab:hover {
    background: var(--border);
}

.top-users-tab.active {
    background: var(--primary);
    color: white;
}

.top-users-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.top-users-list.active {
    display: flex;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: transform 0.2s;
}

.top-user-item:hover {
    transform: translateX(4px);
}

.top-user-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    width: 40px;
    text-align: center;
}

.top-user-info {
    flex: 1;
}

.top-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.top-user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.top-user-stat {
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* Category Performance */
.category-performance-header {
    margin-bottom: 1rem;
}

.category-performance-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.category-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-performance-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.category-performance-card:hover {
    transform: translateY(-4px);
}

.category-perf-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.category-perf-emoji {
    font-size: 2rem;
}

.category-perf-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.category-perf-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-perf-stat {
    display: flex;
    flex-direction: column;
}

.category-perf-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.category-perf-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.category-perf-stat .stat-value.highlight {
    color: var(--primary);
}

.category-perf-progress {
    margin: 1rem 0;
}

.category-perf-progress .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.category-perf-progress .progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.category-perf-progress .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-perf-amounts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.category-perf-amounts .amount-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.category-perf-amounts .amount-row span:first-child {
    color: var(--text-secondary);
}

.category-perf-amounts .amount-row .success {
    color: var(--success);
    font-weight: 600;
}

/* Retention Table */
.retention-header {
    margin-bottom: 1rem;
}

.retention-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.retention-table {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.retention-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.2fr;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.retention-row.header {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.retention-row:last-child {
    border-bottom: none;
}

.retention-cell {
    display: flex;
    align-items: center;
}

.retention-cell.period {
    font-weight: 600;
    color: var(--text-primary);
}

.retention-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.retention-badge.success {
    background: rgba(0, 214, 143, 0.1);
    color: var(--success);
}

.retention-badge.warning {
    background: rgba(255, 169, 0, 0.1);
    color: var(--warning);
}

.retention-badge.danger {
    background: rgba(255, 61, 113, 0.1);
    color: var(--danger);
}

/* ============================================
   ADMIN DASHBOARD - ESTILOS MODERNOS
   ============================================ */

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.admin-header-content {
    flex: 1;
}

.admin-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.admin-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.admin-header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-admin-action {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-admin-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-admin-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 211, 149, 0.3);
}

.btn-admin-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 211, 149, 0.4);
}

/* Admin KPIs */
.admin-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.admin-kpi-card.users::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.admin-kpi-card.bets::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.admin-kpi-card.volume::before { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.admin-kpi-card.revenue::before { background: linear-gradient(90deg, #43e97b, #38f9d7); }

.admin-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.admin-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admin-kpi-card.users .admin-kpi-icon { background: rgba(102, 126, 234, 0.1); }
.admin-kpi-card.bets .admin-kpi-icon { background: rgba(245, 87, 108, 0.1); }
.admin-kpi-card.volume .admin-kpi-icon { background: rgba(79, 172, 254, 0.1); }
.admin-kpi-card.revenue .admin-kpi-icon { background: rgba(67, 233, 123, 0.1); }

.admin-kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.admin-kpi-trend.up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.admin-kpi-trend.down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.admin-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.admin-kpi-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-kpi-detail {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-kpi-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.admin-kpi-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.admin-kpi-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.admin-kpi-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Admin Charts Row */
.admin-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-charts-row:nth-child(odd) {
    grid-template-columns: 1fr 1fr;
}

.admin-chart-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.admin-chart-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.admin-chart-large { grid-column: span 1; }
.admin-chart-medium { grid-column: span 1; }
.admin-chart-small { grid-column: span 1; }

.admin-chart-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.admin-chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-chart-body {
    padding: 1.5rem;
    height: 300px;
    position: relative;
}

.admin-chart-body canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Admin Section Card */
.admin-section-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.admin-section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-badge {
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-section-body {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

/* Admin Loading State */
.admin-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.admin-loading::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-right: 0.75rem;
    animation: admin-spin 1s linear infinite;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

/* Admin Bet Card */
.admin-bet-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.admin-bet-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 211, 149, 0.1);
}

.admin-bet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-bet-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.admin-bet-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.admin-bet-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.admin-bet-badge.futbol { background: #dcfce7; color: #166534; }
.admin-bet-badge.basket { background: #fef3c7; color: #92400e; }
.admin-bet-badge.voley { background: #dbeafe; color: #1e40af; }
.admin-bet-badge.yesno { background: #f3e8ff; color: #7c3aed; }
.admin-bet-badge.pending { background: #fef3c7; color: #92400e; }
.admin-bet-badge.active { background: #dcfce7; color: #166534; }

.admin-bet-odds {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 800;
}

.admin-bet-selection {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-bet-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-bet-amount {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.admin-bet-amount-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.admin-bet-amount-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-bet-amount-value.success { color: #10b981; }

/* Admin Progress Bar */
.admin-progress {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.admin-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Admin Acceptances */
.admin-acceptances {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.admin-acceptances-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.admin-acceptance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.admin-acceptance-user {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-acceptance-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-acceptance-status {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-acceptance-status.active { background: #dcfce7; color: #166534; }
.admin-acceptance-status.won { background: #dbeafe; color: #1e40af; }
.admin-acceptance-status.lost { background: #fee2e2; color: #dc2626; }

/* Admin Bet Footer */
.admin-bet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-admin-small {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-admin-small:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Admin Empty State */
.admin-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.admin-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Responsive Admin Dashboard */
@media (max-width: 1200px) {
    .admin-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-charts-row {
        grid-template-columns: 1fr;
    }
    
    .admin-charts-row:nth-child(odd) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .admin-kpis {
        grid-template-columns: 1fr;
    }
    
    .admin-kpi-value {
        font-size: 1.5rem;
    }
    
    .admin-chart-body {
        height: 250px;
    }
    
    .admin-bet-amounts {
        grid-template-columns: 1fr;
    }
    
    .admin-bet-footer {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

/* Admin KPI Badges */
.admin-kpi-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.35rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.admin-kpi-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.admin-kpi-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.admin-kpi-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Admin Badge for Section Headers */
.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    border-radius: 50px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Admin Section Header */
.admin-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Admin Bet Badge Categories */
.admin-bet-badge.futbol { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.admin-bet-badge.voley { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.admin-bet-badge.basket { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.admin-bet-badge.yesno { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* Admin Bet Badge Status */
.admin-bet-badge.pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.admin-bet-badge.active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.admin-bet-badge.resolved { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.admin-bet-badge.cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }


