/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #f0f2f5;
  color: #2d3748;
  line-height: 1.6;
  font-size: 16px;
}

/* ── Typography ───────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
p  { margin-bottom: 6px; }
a  { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 0.82rem; color: #718096; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 28px; padding-bottom: 48px; }

/* ── Header & Nav ─────────────────────────────────────────────────────── */
header {
  background: #2c3e50;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 58px;
}
.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; color: #ecf0f1; }

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-desktop a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-desktop a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
}
.nav-desktop .nav-signout {
  color: rgba(255,255,255,0.55);
  font-size: 0.84rem;
}
.nav-desktop .nav-admin {
  background: rgba(231,76,60,0.25);
  color: #ff8a80;
}
.nav-desktop .nav-admin:hover {
  background: rgba(231,76,60,0.45);
  color: white;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  margin-right: 4px;
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-chip span {
  font-size: 0.87rem;
  font-weight: 500;
  color: white;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  background: #243342;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0 12px;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.88);
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.nav-mobile a:hover { background: rgba(255,255,255,0.07); text-decoration: none; }
.nav-mobile .nav-mobile-user {
  padding: 12px 20px 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 4px;
}
.nav-mobile .nav-signout { color: rgba(255,180,180,0.8); }

/* ── Flash Messages ───────────────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 18px;
  margin-bottom: 14px;
  border-radius: 9px;
  font-size: 0.94rem;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 2px 12px rgba(0,0,0,0.04);
  transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 4px 20px rgba(0,0,0,0.07);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin: 0; }

/* ── Stat Cards ───────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px 16px 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  transition: transform 0.15s, box-shadow 0.15s;
  border-top: 4px solid transparent;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.stat-card.blue   { border-top-color: #3498db; }
.stat-card.green  { border-top-color: #27ae60; }
.stat-card.orange { border-top-color: #e67e22; }
.stat-card.purple { border-top-color: #9b59b6; }
.stat-card.teal   { border-top-color: #1abc9c; }

.stat-icon  { font-size: 2rem; line-height: 1; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-bottom: 4px; }
.stat-label { font-size: 0.78rem; color: #718096; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sub   { font-size: 0.78rem; color: #a0aec0; margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  text-decoration: none;
}
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-sm  { padding: 6px 14px; font-size: 0.83rem; border-radius: 6px; }
.btn-lg  { padding: 13px 28px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary   { background: #3498db; color: white; }
.btn-primary:hover   { background: #2980b9; color: white; }
.btn-success   { background: #27ae60; color: white; }
.btn-success:hover   { background: #219a52; color: white; }
.btn-danger    { background: #e74c3c; color: white; }
.btn-danger:hover    { background: #c0392b; color: white; }
.btn-secondary { background: #718096; color: white; }
.btn-secondary:hover { background: #4a5568; color: white; }
.btn-outline   { background: transparent; color: #3498db; border: 2px solid #3498db; }
.btn-outline:hover   { background: #3498db; color: white; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 0.91rem;
  color: #4a5568;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.96rem;
  color: #2d3748;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
  background: white;
}
.form-group input[disabled],
.form-group input:disabled {
  background: #edf2f7;
  color: #a0aec0;
  cursor: not-allowed;
}
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group small    { display: block; margin-top: 5px; }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.91rem;
  color: #4a5568;
  font-weight: normal;
}
.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #3498db;
  border-radius: 4px;
}

/* Terms box */
.terms-box {
  padding: 16px 18px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-bottom: 20px;
}

/* ── Status Badges ────────────────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.status-open         { background: #e8f5e9; color: #2e7d32; }
.status-bidding      { background: #e3f2fd; color: #1565c0; }
.status-accepted     { background: #fff8e1; color: #e65100; }
.status-deposit_paid { background: #e8f5e9; color: #2e7d32; }
.status-completed    { background: #c8e6c9; color: #1b5e20; }
.status-cancelled    { background: #fce4ec; color: #b71c1c; }
.status-expired      { background: #f3f4f6; color: #6b7280; }

.badge-hauler   { background: #e8f5e9; color: #2e7d32; }
.badge-customer { background: #e3f2fd; color: #1565c0; }
.badge-pending  { background: #f0f0f0; color: #666; }
.badge-setup    { background: #fff3cd; color: #856404; }

.distance-badge {
  background: #e3f2fd;
  color: #1565c0;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Section Headers ──────────────────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 14px;
  gap: 12px;
}
.section-title { font-size: 1.2rem; font-weight: 700; color: #2d3748; margin: 0; }

/* ── Info Banners ─────────────────────────────────────────────────────── */
.banner {
  padding: 15px 18px;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
}
.banner-warning  { background: #fff8e1; border: 1px solid #ffe082; color: #5d4037; }
.banner-success  { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.banner-info     { background: #e3f2fd; border: 1px solid #90caf9; color: #0d47a1; }
.banner-payment  { background: #fffde7; border: 2px solid #ffc107; color: #5d4037; }
.banner-complete { background: #e8f5e9; border: 2px solid #4caf50; color: #1b5e20; }

/* ── Photo Grid ───────────────────────────────────────────────────────── */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.photo-grid img {
  width: 130px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}
.photo-grid img:hover { opacity: 0.88; }
.photo-broken {
  width: 130px;
  height: 100px;
  border-radius: 8px;
  border: 1px dashed #cbd5e0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  font-size: 0.72rem;
  text-align: center;
  padding: 6px;
  gap: 4px;
  flex-shrink: 0;
}
.photo-broken-icon { font-size: 1.4rem; }

/* ── Divider ──────────────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid #edf2f7; margin: 18px 0; }

/* ── Quick Actions ────────────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

/* ── Earnings Hero ────────────────────────────────────────────────────── */
.earnings-hero {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border-radius: 12px;
  padding: 28px 24px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 10px;
}
.earnings-hero .val { font-size: 2rem; font-weight: 800; line-height: 1; }
.earnings-hero .lbl { font-size: 0.82rem; margin-top: 6px; opacity: 0.88; }

/* ── Bid Row ──────────────────────────────────────────────────────────── */
.bid-row {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.bid-row:hover { border-color: #90caf9; }
.bid-row.accepted { border-color: #a5d6a7; background: #f1f8e9; }
.bid-amount { font-size: 1.4rem; font-weight: 800; color: #2d3748; line-height: 1.1; }
.bid-meta   { font-size: 0.84rem; color: #718096; }

/* ── User Row ─────────────────────────────────────────────────────────── */
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.user-meta  { flex: 1; min-width: 0; }
.user-name  { font-weight: 600; margin-bottom: 2px; }
.user-email { font-size: 0.87rem; color: #718096; }
.user-detail{ font-size: 0.83rem; color: #a0aec0; margin-top: 3px; }

/* ── Back Link ────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #718096;
  font-size: 0.88rem;
  margin-bottom: 18px;
  text-decoration: none;
}
.back-link:hover { color: #3498db; text-decoration: none; }

/* ── Page Title Row ───────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 14px;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: #2d3748; margin: 0; }

/* ── Empty State ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: #718096;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-state p { font-size: 1rem; margin-bottom: 18px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.75);
  padding: 40px 0 24px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.footer-brand { font-size: 1.2rem; font-weight: 800; color: white; margin-bottom: 8px; display: block; }
.footer-desc  { font-size: 0.88rem; opacity: 0.65; line-height: 1.5; }
.footer-col h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
  font-weight: 700;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger   { display: flex; }

  h2 { font-size: 1.2rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .earnings-hero { grid-template-columns: 1fr; padding: 20px 16px; }
  .earnings-hero .val { font-size: 1.7rem; }
  .card { padding: 16px; }
  .btn-lg { padding: 12px 20px; font-size: 1rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .user-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .photo-grid img { width: 100px; height: 80px; }
  .footer-inner { grid-template-columns: 1fr; }
  .quick-actions .btn { flex: 1; min-width: 140px; }
  .bid-row .bid-header { flex-direction: column; gap: 6px; }
}
