/* ============================================
   BUYER REPORT PAGE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f3f4f6;
    color: #111827;
    min-height: 100vh;
}

/* ---- Header ---- */
.report-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 60%, #a78bfa 100%);
    color: white;
    padding: 20px 20px 32px;
    position: relative;
    overflow: hidden;
}

.report-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.report-header::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.report-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.report-back:hover {
    color: white;
}

.report-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.report-subtitle {
    font-size: 13px;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* ---- Main content ---- */
.report-body {
    padding: 20px 16px 40px;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    margin-top: -16px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-card .stat-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.accent-purple .stat-value {
    color: #6366f1;
}

.stat-card.accent-green .stat-value {
    color: #059669;
}

.stat-card.accent-orange .stat-value {
    color: #d97706;
}

.stat-card.accent-blue .stat-value {
    color: #2563eb;
}

/* ---- AI Note Card ---- */
.ai-note-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}

.ai-note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-note-header .ai-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.ai-note-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #4c1d95;
}

.ai-note-text {
    font-size: 14px;
    line-height: 1.65;
    color: #374151;
}

.ai-note-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

.ai-note-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Section Header ---- */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Order List ---- */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.order-row {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-row-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.order-row-info {
    flex: 1;
    min-width: 0;
}

.order-row-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-row-seller {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}

.order-row-right {
    text-align: right;
    flex-shrink: 0;
}

.order-row-price {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.order-row-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 3px;
    display: inline-block;
}

.order-row-status.confirmed {
    background: #d1fae5;
    color: #065f46;
}

.order-row-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-row-status.pending_agreement {
    background: #e0e7ff;
    color: #3730a3;
}

.order-row-status.pending_payment {
    background: #fce7f3;
    color: #9d174d;
}

/* ---- Category Breakdown ---- */
.category-list {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.category-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    min-width: 80px;
}

.category-count {
    font-size: 12px;
    color: #6b7280;
    min-width: 28px;
    text-align: right;
}

/* ---- Empty State ---- */
.empty-report {
    text-align: center;
    padding: 48px 20px;
    color: #6b7280;
}

.empty-report .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-report p {
    font-size: 15px;
}

.empty-report a {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}