*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --surface2: #242424;
    --border: #2e2e2e;
    --text: #f0f0f0;
    --muted: #888;
    --accent: #e6a817;
    --danger: #c0392b;
    --success: #27ae60;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; min-height: 100vh; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 360px; }

.auth-card h1 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1.5rem; }

.auth-card input { display: block; width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; padding: 0.75rem 1rem; margin-bottom: 1rem; outline: none; }

.auth-card input:focus { border-color: var(--accent); }

.auth-card button, .btn-primary { display: block; width: 100%; background: var(--accent); border: none; border-radius: 8px; color: #000; font-size: 1rem; font-weight: 600; padding: 0.75rem; cursor: pointer; margin-top: 0.5rem; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert.error { background: rgba(192,57,43,0.15); border: 1px solid var(--danger); color: #e74c3c; }

.muted { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }

.topbar-title { font-weight: 600; font-size: 1rem; }

.btn-logout { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 0.85rem; padding: 0.35rem 0.75rem; cursor: pointer; text-decoration: none; }

.connect-banner { background: rgba(230,168,23,0.1); border-bottom: 1px solid var(--accent); padding: 1rem; text-align: center; }
.connect-banner p { margin-bottom: 0.5rem; color: var(--muted); }
.connect-banner a { display: inline-block; width: auto; padding: 0.5rem 1.5rem; }

.tab-bar { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }

.tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.95rem; padding: 0.85rem; cursor: pointer; }
.tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }

.content { padding: 1rem; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.toolbar input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95rem; padding: 0.6rem 0.85rem; outline: none; }
.toolbar input:focus { border-color: var(--accent); }

.btn-secondary { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.9rem; padding: 0.6rem 1rem; cursor: pointer; white-space: nowrap; }

.card-list { display: flex; flex-direction: column; gap: 0.75rem; }

.listing-card, .order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; cursor: pointer; }
.listing-card:active, .order-card:active { background: var(--surface2); }

.card-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--muted); font-size: 0.82rem; display: flex; gap: 1rem; }
.card-price { color: var(--accent); font-weight: 600; }

.badge { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; }
.badge-active { background: rgba(39,174,96,0.15); color: var(--success); }
.badge-ended  { background: rgba(192,57,43,0.15); color: var(--danger); }

.loading { color: var(--muted); text-align: center; padding: 2rem; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; display: flex; align-items: flex-end; }
.modal.hidden { display: none; }
.modal-box { background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-height: 85vh; overflow-y: auto; padding: 1.25rem; }
.modal-close { float: right; background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

.modal-field { margin-bottom: 1rem; }
.modal-field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.3rem; }
.modal-field input, .modal-field textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95rem; padding: 0.6rem 0.85rem; outline: none; }
.modal-field input:focus, .modal-field textarea:focus { border-color: var(--accent); }
.modal-field textarea { resize: vertical; min-height: 80px; }

.modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.modal-actions button { flex: 1; padding: 0.75rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; }
.btn-save { background: var(--accent); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-cancel { background: var(--surface2); color: var(--text); border: 1px solid var(--border) !important; }

.order-status { font-size: 0.82rem; color: var(--muted); }
.order-buyer { font-weight: 500; }
.order-total { color: var(--accent); font-weight: 600; }

.ship-form input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95rem; padding: 0.6rem 0.85rem; outline: none; margin-bottom: 0.75rem; }