/* ============================================
   SOURSET - Dashboard Enterprise Styles
   Versión: 2.0.0
   Cubre: Stats, Charts, Widgets, Gamificación,
          CRM, Analytics, Credit, Auctions, Disputes
   ============================================ */

/* ============================================
   1. VARIABLES ESPECÍFICAS DEL DASHBOARD
   ============================================ */
:root {
    --dashboard-gap: 20px;
    --dashboard-radius: 12px;
    --dashboard-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --dashboard-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Colores de niveles de gamificación */
    --level-novato: #94a3b8;
    --level-explorador: #3b82f6;
    --level-profesional: #8b5cf6;
    --level-experto: #f59e0b;
    --level-maestro: #ef4444;
    --level-leyenda: #10b981;
    
    /* Colores de rareza de logros */
    --rarity-common: #94a3b8;
    --rarity-rare: #3b82f6;
    --rarity-epic: #8b5cf6;
    --rarity-legendary: #f59e0b;
    
    /* Colores de pipeline CRM */
    --pipeline-prospect: #94a3b8;
    --pipeline-contacted: #3b82f6;
    --pipeline-meeting: #8b5cf6;
    --pipeline-proposal: #f59e0b;
    --pipeline-negotiation: #ec4899;
    --pipeline-won: #10b981;
    --pipeline-lost: #ef4444;
}

/* ============================================
   2. DASHBOARD HEADER
   ============================================ */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    padding: 40px;
    margin: -32px -32px 24px -32px;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-header h1 {
    color: white;
    font-size: 32px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.dashboard-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.dashboard-header-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.dashboard-header-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.dashboard-header-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================
   3. STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--dashboard-gap);
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--dashboard-radius);
    box-shadow: var(--dashboard-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dashboard-shadow-hover);
    border-color: var(--primary);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.info .stat-icon { background: var(--primary-50); color: var(--info); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-light);
    font-size: 13px;
    margin: 4px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   4. KPI CARDS
   ============================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    padding: 20px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

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

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-change {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-top: 4px;
}

.kpi-change.positive {
    background: var(--success-light);
    color: var(--success-dark);
}

.kpi-change.negative {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ============================================
   5. CHARTS CONTAINERS
   ============================================ */
.chart-container {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    padding: 24px;
    box-shadow: var(--dashboard-shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.chart-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-canvas-wrapper {
    position: relative;
    height: 300px;
}

.chart-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.chart-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* ============================================
   6. WIDGETS
   ============================================ */
.widget {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    box-shadow: var(--dashboard-shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.widget-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-actions {
    display: flex;
    gap: 8px;
}

.widget-body {
    padding: 24px;
}

.widget-footer {
    padding: 12px 24px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================
   7. ACTIVITY FEED
   ============================================ */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item-advanced {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

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

.activity-item-advanced:hover {
    background: var(--bg);
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-radius: 8px;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-avatar.success { background: var(--success-light); color: var(--success); }
.activity-avatar.warning { background: var(--warning-light); color: var(--warning); }
.activity-avatar.danger { background: var(--danger-light); color: var(--danger); }
.activity-avatar.info { background: var(--primary-50); color: var(--info); }

.activity-content {
    flex-grow: 1;
    min-width: 0;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.activity-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.activity-time {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 4px;
}

/* ============================================
   8. QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--bg);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-action:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--dashboard-shadow-hover);
    color: var(--primary);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s;
}

.quick-action:hover .quick-action-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.quick-action-label {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* ============================================
   9. PROGRESS BARS
   ============================================ */
.progress-container {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.progress-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
    position: relative;
}

.progress-fill.success {
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.progress-fill.animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   10. DATA TABLES ENHANCED
   ============================================ */
.data-table-container {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    box-shadow: var(--dashboard-shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.data-table-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.data-table-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.table-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.table-action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ============================================
   11. TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 1;
}

.timeline-marker.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-marker.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-marker.danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }

.timeline-content {
    background: var(--bg);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.timeline-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    line-height: 1.5;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-lighter);
}

/* ============================================
   12. GAMIFICACIÓN - NIVELES Y LOGROS
   ============================================ */
.level-card {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    padding: 30px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--level-color, var(--primary));
}

.level-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--level-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.level-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--level-color, var(--primary));
    margin: 0 0 10px;
}

.level-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
}

.level-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-stat strong {
    color: var(--text);
}

.level-stat span {
    color: var(--text-light);
}

/* Achievement cards */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: linear-gradient(135deg, var(--rarity-bg, #e2e8f0) 0%, white 100%);
    border: 2px solid var(--rarity-color, #94a3b8);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.achievement-card.common { --rarity-color: var(--rarity-common); --rarity-bg: #e2e8f0; }
.achievement-card.rare { --rarity-color: var(--rarity-rare); --rarity-bg: #dbeafe; }
.achievement-card.epic { --rarity-color: var(--rarity-epic); --rarity-bg: #ede9fe; }
.achievement-card.legendary { --rarity-color: var(--rarity-legendary); --rarity-bg: #fef3c7; }

.achievement-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--rarity-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.achievement-info {
    flex-grow: 1;
    min-width: 0;
}

.achievement-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}

.achievement-description {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.3;
}

.achievement-rarity {
    font-size: 11px;
    color: var(--rarity-color);
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Leaderboard */
.leaderboard-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: var(--primary-50);
}

.leaderboard-item.current-user {
    background: var(--primary-50);
    border: 2px solid var(--primary);
}

.leaderboard-medal {
    font-size: 24px;
    text-align: center;
}

.leaderboard-info {
    min-width: 0;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 14px;
}

.leaderboard-level {
    font-size: 12px;
    color: var(--text-light);
}

.leaderboard-xp {
    text-align: right;
}

.leaderboard-xp strong {
    color: var(--primary);
    font-size: 18px;
    display: block;
}

.leaderboard-xp span {
    font-size: 11px;
    color: var(--text-light);
}

/* ============================================
   13. CRÉDITO B2B
   ============================================ */
.credit-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.credit-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.credit-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.credit-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

.credit-card-progress {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.credit-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.6s;
}

/* ============================================
   14. PIPELINE CRM
   ============================================ */
.pipeline-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.pipeline-stage {
    text-decoration: none;
    color: var(--text);
    padding: 20px 15px;
    background: var(--surface);
    border: 2px solid var(--stage-color, var(--border));
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.pipeline-stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stage-color, var(--primary));
}

.pipeline-stage:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pipeline-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.pipeline-label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.pipeline-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--stage-color, var(--primary));
}

.pipeline-value {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 5px;
}

/* ============================================
   15. FUNNEL DE CONVERSIÓN
   ============================================ */
.funnel-step {
    display: grid;
    grid-template-columns: 200px 1fr 100px 100px;
    gap: 15px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.funnel-step:last-child {
    border-bottom: none;
}

.funnel-step-info {
    min-width: 0;
}

.funnel-step-name {
    font-weight: 600;
    font-size: 14px;
}

.funnel-step-description {
    font-size: 12px;
    color: var(--text-light);
}

.funnel-bar-wrapper {
    position: relative;
}

.funnel-bar {
    background: var(--bg-alt);
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.funnel-bar-fill {
    height: 100%;
    background: var(--primary);
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    transition: width 0.5s;
}

.funnel-bar-fill.final {
    background: var(--success);
}

.funnel-users {
    text-align: center;
}

.funnel-users strong {
    font-size: 16px;
    display: block;
}

.funnel-users small {
    font-size: 11px;
    color: var(--text-light);
}

.funnel-dropoff {
    text-align: center;
}

.funnel-dropoff strong {
    color: var(--danger);
    font-weight: 600;
}

.funnel-dropoff small {
    font-size: 11px;
    color: var(--text-light);
    display: block;
}

/* ============================================
   16. SUBASTAS INVERSAS
   ============================================ */
.auction-card {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    padding: 24px;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s;
}

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

.auction-card.best-bid {
    border: 2px solid var(--success);
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.auction-best-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.auction-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 15px;
    background: var(--bg-alt);
    border-radius: 8px;
    margin: 15px 0;
}

.auction-detail-item {
    text-align: center;
}

.auction-detail-label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auction-detail-value {
    font-weight: 700;
    font-size: 18px;
    margin-top: 4px;
}

/* ============================================
   17. DISPUTAS
   ============================================ */
.dispute-card {
    background: var(--surface);
    border-radius: var(--dashboard-radius);
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    margin-bottom: 15px;
    transition: all 0.2s;
}

.dispute-card.urgent { border-left-color: var(--danger); }
.dispute-card.high { border-left-color: var(--warning); }
.dispute-card.medium { border-left-color: var(--info); }
.dispute-card.low { border-left-color: var(--success); }

.dispute-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.dispute-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.dispute-meta {
    font-size: 12px;
    color: var(--text-light);
}

.dispute-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
}

.dispute-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* ============================================
   18. LOADING STATES
   ============================================ */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-chart {
    height: 200px;
}

/* ============================================
   19. EMPTY STATES
   ============================================ */
.empty-state-advanced {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ============================================
   20. DASHBOARD GRID LAYOUTS
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--dashboard-gap);
    margin-bottom: var(--dashboard-gap);
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--dashboard-gap);
}

/* ============================================
   21. ALERTAS Y BADGES ESPECIALES
   ============================================ */
.alert-banner {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
}

.alert-banner.warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #92400e;
}

.alert-banner.danger {
    background: var(--danger-light);
    border-color: var(--danger);
    color: #991b1b;
}

.alert-banner.success {
    background: var(--success-light);
    border-color: var(--success);
    color: #065f46;
}

.alert-banner.info {
    background: var(--primary-50);
    border-color: var(--primary);
    color: #1e40af;
}

.alert-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-banner-content {
    flex-grow: 1;
}

.alert-banner-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-banner-text {
    font-size: 13px;
    opacity: 0.9;
}

/* ============================================
   22. HEATMAP (Analytics)
   ============================================ */
.heatmap-grid {
    display: grid;
    grid-template-columns: auto repeat(24, 1fr);
    gap: 2px;
    font-size: 11px;
}

.heatmap-cell {
    aspect-ratio: 1;
    background: var(--bg-alt);
    border-radius: 2px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 10;
}

.heatmap-cell.level-1 { background: #dbeafe; }
.heatmap-cell.level-2 { background: #93c5fd; }
.heatmap-cell.level-3 { background: #3b82f6; }
.heatmap-cell.level-4 { background: #1e40af; }

.heatmap-label {
    display: flex;
    align-items: center;
    padding-right: 8px;
    color: var(--text-light);
    font-size: 11px;
}

/* ============================================
   23. NOTIFICATION BADGE
   ============================================ */
.notification-badge {
    position: relative;
    display: inline-block;
}

.notification-badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    border: 2px solid var(--surface);
}

.notification-badge[data-count="0"] .notification-badge-count {
    display: none;
}

/* ============================================
   24. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 30px 20px;
        margin: -20px -20px 20px -20px;
    }
    
    .dashboard-header h1 {
        font-size: 26px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pipeline-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .funnel-step {
        grid-template-columns: 150px 1fr 80px;
    }
    
    .funnel-dropoff {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px;
        margin: -16px -16px 16px -16px;
        border-radius: 0 0 12px 12px;
    }
    
    .dashboard-header h1 {
        font-size: 22px;
    }
    
    .dashboard-header p {
        font-size: 14px;
    }
    
    .dashboard-header-actions {
        flex-direction: column;
    }
    
    .dashboard-header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid,
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .pipeline-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .widget-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-card-value,
    .kpi-value {
        font-size: 24px;
    }
    
    .chart-canvas-wrapper {
        height: 250px;
    }
    
    .funnel-step {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .level-card {
        padding: 20px;
        text-align: center;
    }
    
    .level-icon {
        margin: 0 auto 20px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-item {
        grid-template-columns: 40px 1fr auto;
        gap: 10px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .pipeline-container {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .chart-canvas-wrapper {
        height: 200px;
    }
}

/* ============================================
   25. DARK MODE
   ============================================ */
[data-theme="dark"] .dashboard-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .widget,
[data-theme="dark"] .level-card,
[data-theme="dark"] .auction-card,
[data-theme="dark"] .dispute-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .achievement-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, var(--surface) 100%);
}

[data-theme="dark"] .leaderboard-item {
    background: var(--bg-alt);
}

[data-theme="dark"] .leaderboard-item.current-user {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

[data-theme="dark"] .pipeline-stage {
    background: var(--surface);
}

[data-theme="dark"] .funnel-bar {
    background: var(--bg-alt);
}

[data-theme="dark"] .timeline-content {
    background: var(--bg-alt);
}

/* ============================================
   26. PRINT STYLES
   ============================================ */
@media print {
    .dashboard-header,
    .chart-actions,
    .widget-actions,
    .quick-actions,
    .btn,
    .alert-banner {
        display: none !important;
    }
    
    .stat-card,
    .kpi-card,
    .chart-container,
    .widget {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ============================================
   27. ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.4s ease-out; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Stagger animations para listas */
.stagger-item {
    animation: fadeInUp 0.4s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   28. UTILIDADES
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-hover {
    transition: all 0.2s;
}

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

.border-gradient {
    position: relative;
    background: var(--surface);
    border: none;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Scrollbar personalizado */
.widget-body::-webkit-scrollbar,
.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.widget-body::-webkit-scrollbar-track,
.activity-feed::-webkit-scrollbar-track {
    background: transparent;
}

.widget-body::-webkit-scrollbar-thumb,
.activity-feed::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.widget-body::-webkit-scrollbar-thumb:hover,
.activity-feed::-webkit-scrollbar-thumb:hover {
    background: var(--text-lighter);
}