* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #000000; --primary-light: #333; --bg: #FFFFFF;
  --bg-secondary: #F9FAFB; --bg-tertiary: #F3F4F6; --card: #FFFFFF;
  --card-border: #E5E7EB; --text: #111827; --text-muted: #6B7280;
  --text-light: #9CA3AF; --yellow: #F59E0B; --yellow-dark: #D97706;
  --dark: #111827; --danger: #EF4444; --success: #10B981;
}
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-secondary); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--card-border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.logo { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.buyer-badge { background: var(--bg-tertiary); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.nav-link:hover { color: var(--primary); }
main { max-width: 900px; margin: 0 auto; padding: 24px; }
h2 { color: var(--text); font-size: 18px; margin-bottom: 16px; }
.purchase-list, .dispute-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.loading { color: var(--text-muted); font-style: italic; }
.empty-msg { color: var(--text-muted); font-size: 14px; }

/* Purchase card */
.purchase-card { background: var(--card); border-radius: 16px; border: 1px solid var(--card-border); padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.purchase-info h3 { font-size: 16px; margin-bottom: 4px; }
.purchase-meta { font-size: 12px; color: var(--text-muted); }
.purchase-price { color: var(--primary); font-weight: 700; font-size: 18px; margin-right: 16px; }
.purchase-actions { display: flex; align-items: center; gap: 12px; }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-dispute { background: var(--danger); color: white; }
.btn-dispute:hover:not(:disabled) { filter: brightness(1.1); }
.btn-disputed { background: rgba(255,255,255,0.08); color: var(--text-muted); cursor: default; }

/* Dispute card */
.dispute-card { background: var(--card); border-radius: 16px; border: 1px solid var(--card-border); padding: 16px; }
.dispute-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dispute-header h3 { font-size: 15px; }
.status-pill { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-pill.open { background: #FEF3C7; color: #D97706; }
.status-pill.under_review { background: #EFF6FF; color: #2563EB; }
.status-pill.approved { background: #ECFDF5; color: #059669; }
.status-pill.rejected { background: #FEF2F2; color: #DC2626; }
.dispute-reason { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.dispute-evidence { font-size: 12px; color: var(--text-muted); }
.dispute-date { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.visible { display: flex; }
.modal { background: var(--card); border-radius: 20px; border: 1px solid var(--card-border); box-shadow: 0 24px 48px rgba(0,0,0,0.15); padding: 32px; max-width: 500px; width: 90%; }
.modal h2 { margin-bottom: 8px; }
.modal-item-name { color: var(--primary); margin-bottom: 16px; font-size: 15px; }
.modal label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; margin-top: 12px; }
.modal textarea { width: 100%; padding: 10px; border: 1px solid var(--card-border); border-radius: 6px; background: var(--bg-secondary); color: var(--text); font-size: 13px; resize: vertical; }
.modal input[type="file"] { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.upload-progress { font-size: 12px; color: var(--text-muted); margin-top: 6px; min-height: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-submit { background: var(--primary); color: white; flex: 1; text-align: center; }
.btn-submit:hover:not(:disabled) { background: var(--primary-light); }
.btn-cancel { background: var(--bg-tertiary); color: var(--text-muted); }
.btn-cancel:hover { background: var(--card-border); }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: var(--primary); border: none; color: white; padding: 12px 24px; border-radius: 12px; font-size: 14px; z-index: 1100; transition: transform 0.3s ease; }
.toast.visible { transform: translateX(-50%) translateY(0); }

/* Purchase thumbnail */
.purchase-card { display: flex; align-items: center; gap: 14px; }
.purchase-thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.purchase-thumb img { width: 100%; height: 100%; object-fit: cover; }
.purchase-info { flex: 1; }

/* Resolved dispute button colors */
.btn-disputed.approved { background: #ECFDF5; color: #059669; }
.btn-disputed.rejected { background: #FEF2F2; color: #DC2626; }

/* Voided items */
.purchase-card.voided { border: 2px solid var(--danger); opacity: 0.85; position: relative; }
.voided-banner { background: var(--danger); color: white; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 6px; position: absolute; top: -10px; left: 16px; z-index: 1; }
.btn-voided { background: #FEF2F2; color: #DC2626; cursor: default; }
.btn-disputed.auto_refunded { background: #FEF2F2; color: #DC2626; }
.status-pill.auto_refunded { background: #FEF2F2; color: #DC2626; }

.header-nav { display: flex; gap: 8px; align-items: center; }
.header-nav a { color: #6B7280; text-decoration: none; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 8px; transition: all 0.15s; }
.header-nav a:hover { color: #111827; background: #F3F4F6; }
.header-nav a.active { color: #111827; font-weight: 700; background: #F3F4F6; }
