:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 16px; height: 52px; }
.nav-brand { font-weight: 700; font-size: 1rem; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; text-decoration: none; }
.days-until { font-size: 0.75rem; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav-links a { padding: 6px 12px; border-radius: var(--radius); font-size: 0.85rem; color: var(--text); white-space: nowrap; transition: background 0.2s; }
.nav-links a:hover { background: var(--border); text-decoration: none; }
.nav-links a.active { background: var(--primary); color: white; }
.nav-links a.admin-link { border: 1px solid var(--danger); color: var(--danger); }
.nav-links a.admin-link.active { background: var(--danger); color: white; }

.nav-brand { text-decoration: none; color: var(--text); font-weight: 700; font-size: 1rem; white-space: nowrap; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

.hero { padding: 80px 32px; border-radius: 12px; margin-bottom: 32px; text-align: center; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.hero-content { background: rgba(0,0,0,0.6); padding: 32px 48px; border-radius: 12px; color: white; }
.hero-content h1 { font-size: 2.2rem; margin-bottom: 8px; }
.hero-date { font-size: 1.3rem; font-weight: 600; }
.hero-loc { font-size: 1.1rem; opacity: 0.9; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); display: block; text-decoration: none; color: inherit; cursor: pointer; }
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateY(-2px); }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

section { margin-bottom: 32px; }
section h2 { font-size: 1.3rem; margin-bottom: 16px; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.tl-item { background: var(--card); border-left: 4px solid var(--primary); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.tl-time { font-size: 0.85rem; color: var(--primary); font-weight: 600; }
.tl-title { font-weight: 600; margin-top: 4px; }
.tl-desc { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.tl-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.tl-col h3 { font-size: 1rem; margin-bottom: 12px; color: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-style: italic; }

.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; }
.count { font-size: 0.85rem; color: var(--muted); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-btn { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; border: 1px solid var(--border); color: var(--text); transition: all 0.2s; }
.filter-btn:hover { background: var(--border); text-decoration: none; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.item-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.item-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); text-decoration: none; }
.item-thumb { height: 180px; overflow: hidden; background: var(--border); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; }
.item-info { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-info h3 { font-size: 1rem; }
.donor { font-size: 0.85rem; color: var(--muted); }
.bid { font-weight: 600; color: var(--primary); margin-top: auto; }
.badge { display: inline-block; background: #e0e7ff; color: var(--primary); font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.badge-lg { font-size: 0.85rem; padding: 4px 12px; }

.back-link { display: inline-block; margin-bottom: 16px; font-size: 0.9rem; }

.item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.item-detail-photo { min-height: 300px; background: var(--border); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.item-detail-photo img { width: 100%; max-height: 500px; object-fit: contain; }
.no-photo-lg { color: var(--muted); font-size: 1rem; }
.item-detail-info { display: flex; flex-direction: column; gap: 12px; }
.item-detail-info h1 { font-size: 1.5rem; }
.detail-row { font-size: 0.95rem; }
.pricing { display: flex; gap: 16px; margin: 8px 0; }
.price-box { background: var(--bg); padding: 16px; border-radius: var(--radius); flex: 1; text-align: center; }
.price-box.highlight { background: #e0e7ff; }
.price-label { display: block; font-size: 0.8rem; color: var(--muted); }
.price-amount { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
.desc-box { margin-top: 8px; }
.desc-box h3 { font-size: 1rem; margin-bottom: 8px; }
.desc-box p { font-size: 0.95rem; color: var(--muted); line-height: 1.7; }

.item-nav { display: flex; justify-content: space-between; gap: 16px; }
.nav-btn { padding: 10px 20px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; transition: background 0.2s; color: var(--text); }
.nav-btn:hover { background: var(--border); text-decoration: none; }

.vendor-grid, .pos-grid, .idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vendor-card, .pos-card, .idea-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.vendor-card h3, .pos-card h3, .idea-card h3 { font-size: 1.05rem; }
.booth, .time, .contact, .phone, .notes { font-size: 0.9rem; color: var(--muted); }
.spots-open { color: var(--danger); font-size: 0.9rem; margin-top: auto; }
.filled-count { font-weight: 700; color: var(--danger); }
.spots-filled { color: var(--success); font-weight: 700; font-size: 0.9rem; margin-top: auto; }
.signup-btn { margin-top: auto; }

.pos-group { margin-bottom: 24px; }
.pos-group h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--primary); }

.vol-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 0.9rem; }
.vol-list-header { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 10px 16px; background: var(--bg); font-weight: 700; border-bottom: 2px solid var(--border); }
.vol-list-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.vol-list-row:hover { background: var(--bg); }
.vol-list-row:last-child { border-bottom: none; }

.idea-photo { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }
.idea-desc { font-size: 0.9rem; color: var(--muted); }
.idea-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; color: var(--muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.idea-submit-bar { background: var(--card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }

.info-panel { background: #e0e7ff; border-radius: var(--radius); padding: 16px; margin-bottom: 24px; font-size: 0.95rem; }

.btn { display: inline-block; padding: 8px 20px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; border: none; cursor: pointer; transition: background 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 12px 32px; font-size: 1rem; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; border-radius: 4px; border: none; cursor: pointer; color: white; background: var(--primary); }
.btn-danger { background: var(--danger); }

.form-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.form-card h2 { font-size: 1.1rem; margin-bottom: 16px; }
.form-lg { max-width: 600px; margin: 0 auto; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input, .form-row select, .form-row textarea { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; font-family: inherit; }
.form-row textarea { resize: vertical; min-height: 60px; }
.file-label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 1px dashed var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; background: var(--bg); transition: background 0.2s; }
.file-label:hover { background: var(--border); }
.file-label input { position: absolute; opacity: 0; width: 0.1px; height: 0.1px; overflow: hidden; }

.pos-option { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; }
.pos-option input { width: 18px; height: 18px; }
.pos-option small { color: var(--muted); margin-left: auto; }

.msg { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.msg.success { background: #dcfce7; color: #166534; }
.msg.error { background: #fee2e2; color: #991b1b; }

.admin-sections { display: flex; flex-direction: column; gap: 16px; }
.admin-section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.admin-toggle { padding: 14px 20px; font-size: 1rem; cursor: pointer; background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; user-select: none; }
.admin-toggle::before { content: '▼'; font-size: 0.7rem; transition: transform 0.2s; }
.admin-toggle.active::before { transform: rotate(180deg); }
.admin-toggle:hover { background: var(--border); }
.admin-body { padding: 20px; }
.admin-section .admin-toggle.active + .admin-body { display: block; }
.admin-form { max-width: 700px; }
.admin-details { margin-bottom: 16px; }
.admin-details summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--primary); }

.list-table { width: 100%; font-size: 0.85rem; }
.list-header { display: grid; grid-template-columns: 50px 2fr 1fr 1fr 80px 100px; gap: 8px; padding: 8px 12px; background: var(--bg); font-weight: 700; border-bottom: 2px solid var(--border); }
.list-row { display: grid; grid-template-columns: 50px 2fr 1fr 1fr 80px 100px; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.list-row:hover { background: var(--bg); }
.thumb-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.no-thumb { color: var(--muted); font-size: 0.75rem; }
.col-acts { display: flex; gap: 4px; }
.col-acts form { margin: 0; }

.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content { position: relative; background: var(--card); border-radius: var(--radius); padding: 32px; min-width: 400px; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-content h2 { margin-bottom: 20px; }

@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .nav-brand { max-width: 100%; margin-bottom: 4px; }
  .nav-links { width: 100%; gap: 2px; }
  .nav-links a { font-size: 0.78rem; padding: 4px 8px; }
  .item-detail { grid-template-columns: 1fr; }
  .hero { padding: 40px 16px; min-height: 200px; }
  .hero-content { padding: 20px 24px; }
  .hero-content h1 { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid, .vendor-grid, .pos-grid, .idea-grid { grid-template-columns: 1fr; }
  .list-header, .list-row { grid-template-columns: 40px 1fr 80px; }
  .list-header span:nth-child(3), .list-row span:nth-child(3),
  .list-header span:nth-child(4), .list-row span:nth-child(4),
  .list-header span:nth-child(5), .list-row span:nth-child(5) { display: none; }
  .modal-content { min-width: auto; padding: 20px; }
}
