/* =====================================================
   DASHBOARD STYLES
   ===================================================== */

/* Wallet Overview Card */
.wallet-overview {
    margin-bottom: 30px;
    animation: slideInDown 0.4s ease;
}

.wallet-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 0;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.wallet-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.wallet-title i {
    font-size: 1.3rem;
}

.wallet-body {
    padding: 28px;
}

.wallet-main-balance {
    margin-bottom: 24px;
}

.balance-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.balance-amount .currency {
    font-size: 1.8rem;
    font-weight: 600;
    opacity: 0.9;
}

.balance-amount .amount {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.wallet-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.wallet-detail-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
}

.wallet-detail-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.wallet-detail-item.locked {
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.detail-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.wallet-footer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid rgba(255,255,255,0.2);
}

.wallet-action-btn {
    padding: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wallet-action-btn:first-child {
    border-right: 1px solid rgba(255,255,255,0.2);
}

.wallet-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.wallet-action-btn i {
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.stat-trend {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.stat-trend.up {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Quick Actions */
.quick-actions-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-action-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.qa-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.qa-icon.blue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
}

.qa-icon.green {
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
}

.qa-icon.yellow {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.qa-icon.purple {
    background: linear-gradient(135deg, #A855F7, #9333EA);
    color: white;
}

.qa-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Transaction Table Enhancements */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-actions {
    display: flex;
    gap: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr.table-row-clickable {
    cursor: pointer;
}

.data-table td {
    padding: 16px 20px;
    color: var(--text-primary);
}

.transaction-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.txn-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.txn-title i {
    color: var(--text-tertiary);
}

.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge.buyer {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.role-badge.seller {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
}

.amount-cell {
    font-weight: 700;
    color: var(--text-primary);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-badge.pending_acceptance,
.status-badge.pending_payment {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.status-badge.funded,
.status-badge.in_progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.status-badge.in_dispute,
.status-badge.cancelled,
.status-badge.expired {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.action-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--primary-black);
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wallet-details {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .balance-amount .amount {
        font-size: 2.2rem;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}