*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --acc: #1a73e8;
  --acc-dark: #174EA6;
  --acc-light: #E8F0FE;
  --acc-mid: #B5D0F7;
  --green: #34A853;
  --green-light: #E6F4EA;
  --red: #C5221F;
  --red-light: #FCE8E9;
  --text: #202124;
  --text-secondary: #5F6368;
  --border: #e0e0e0;
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* LAYOUT */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  box-shadow: var(--shadow-md);
}

/* PAGES */
.page { display: none; min-height: 100vh; flex-direction: column; }
.page.active { display: flex; }

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}
.topbar-title { font-size: 16px; font-weight: 500; color: var(--text); flex: 1; }
.topbar-back { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--bg-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* BOTTOM NAV */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 0.5px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  border: none;
  background: none;
}
.nav-item.active { color: var(--acc); }
.nav-item svg { width: 22px; height: 22px; }

/* BUTTONS */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary { background: var(--acc); color: #fff; }
.btn-secondary { background: var(--acc-light); color: var(--acc-dark); }
.btn-outline { background: transparent; color: var(--acc); border: 1.5px solid var(--acc); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-sm { padding: 8px 16px; width: auto; font-size: 13px; border-radius: 20px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* INPUTS */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; display: block; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--acc); }
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: none;
  min-height: 80px;
  transition: border-color 0.2s;
}
.form-textarea:focus { border-color: var(--acc); }

/* CARDS */
.card {
  background: var(--bg);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 14px;
  margin-bottom: 10px;
}
.card-elevated { box-shadow: var(--shadow); border: none; }

/* CHIPS / BADGES */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.chip-blue { background: var(--acc-light); color: var(--acc-dark); }
.chip-green { background: var(--green-light); color: #137333; }
.chip-gray { background: #F1F3F4; color: #5F6368; }
.chip-red { background: var(--red-light); color: var(--red); }
.chip-orange { background: #FEF3E2; color: #945900; }

/* DIVIDER */
.divider { height: 0.5px; background: var(--border); margin: 12px 0; }

/* AVATAR */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--acc-light);
  color: var(--acc-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500;
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* TASK CARD */
.task-card {
  background: var(--bg);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.task-card:hover { box-shadow: var(--shadow); border-color: var(--acc-mid); }
.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.task-price { font-size: 18px; font-weight: 500; color: var(--acc); }
.task-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.4; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* MAP */
#map { width: 100%; height: 100%; min-height: calc(100vh - 56px); }
.map-container {
  flex: 1;
  position: relative;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.map-fab {
  position: fixed;
  bottom: 72px; right: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26,115,232,0.5);
  z-index: 90;
  transition: transform 0.2s, background 0.2s;
}
.map-fab:hover { transform: scale(1.05); }
.map-fab.active { background: #e53935; transform: rotate(45deg); }
.map-search {
  position: fixed;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 90;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  display: flex; align-items: center;
  padding: 0 14px;
  height: 44px;
  gap: 8px;
  font-size: 14px;
  color: #aaa;
  border: 0.5px solid var(--border);
}

/* BOTTOM SHEET */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 0 32px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.sheet-title { font-size: 16px; font-weight: 500; padding: 0 16px 12px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.modal-body { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; }

/* COUNTDOWN */
.countdown-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--acc);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0 auto;
}
.countdown-time { font-size: 18px; font-weight: 500; color: var(--acc); }
.countdown-label { font-size: 10px; color: var(--text-secondary); }

/* PROGRESS BAR */
.progress-bar { height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: var(--acc); border-radius: 2px; transition: width 1s linear; }

/* MEDIA UPLOAD GRID */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 16px; }
.media-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--acc-mid);
  background: var(--acc-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: var(--acc);
  font-weight: 500;
  gap: 4px;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.media-slot:hover { background: var(--acc-mid); }
.media-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.media-slot.empty { font-size: 24px; color: var(--acc-mid); }

/* PROFILE ROWS */
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}
.profile-row:hover { background: var(--bg-secondary); }
.profile-row-left { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.profile-row-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--acc-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* WALLET */
.wallet-header { background: var(--acc); padding: 24px 16px 28px; color: #fff; }
.wallet-balance { font-size: 32px; font-weight: 500; }
.wallet-sub { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 4px; }
.wallet-actions { display: flex; gap: 10px; margin-top: 16px; }
.wallet-btn {
  flex: 1; background: rgba(255,255,255,0.2);
  border: none; border-radius: var(--radius-sm);
  padding: 8px; text-align: center;
  font-size: 13px; color: #fff;
  font-weight: 500; cursor: pointer;
}
.wallet-btn:hover { background: rgba(255,255,255,0.3); }
.tx-row {
  display: flex; align-items: center;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  gap: 12px;
}
.tx-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.tx-info { flex: 1; }
.tx-title { font-size: 13px; font-weight: 500; }
.tx-date { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 500; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* NOTIFICATIONS */
.notif-row { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 0.5px solid var(--border); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); margin-top: 5px; flex-shrink: 0; }
.notif-dot.read { background: var(--border); }
.notif-title { font-size: 13px; font-weight: 500; }
.notif-body { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 11px; color: #aaa; margin-top: 3px; }

/* CONTENT PADDING */
.content { padding: 16px; flex: 1; padding-bottom: 80px; }

/* LOADING */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--acc-light);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 14px; line-height: 1.6; }

/* MEDIA TOGGLE */
.media-toggle { display: flex; gap: 8px; padding: 0 16px 12px; }
.media-toggle-btn {
  flex: 1; padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.media-toggle-btn.selected {
  border-color: var(--acc);
  background: var(--acc-light);
  color: var(--acc-dark);
  font-weight: 500;
}

/* REJECTION OPTIONS */
.reject-option {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.reject-option.selected { border-color: var(--acc); background: var(--acc-light); color: var(--acc-dark); font-weight: 500; }

/* SCROLL */
.scroll-content { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* SPLASH */
.splash { background: var(--acc); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.splash-logo { width: 80px; height: 80px; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 500; color: var(--acc); }
.splash-name { font-size: 28px; font-weight: 500; color: #fff; letter-spacing: 1px; }
.splash-tag { font-size: 14px; color: rgba(255,255,255,0.75); }

/* AUTH */
.auth-header { background: var(--acc); padding: 32px 24px 40px; text-align: center; }
.auth-logo { font-size: 24px; font-weight: 500; color: #fff; }
.auth-sub { font-size: 13px; color: rgba(255,255,255,0.8); margin-top: 4px; }
.auth-body { padding: 24px 20px; }
.auth-link { color: var(--acc); cursor: pointer; }

/* ONBOARDING */
.onboard-slide { padding: 0; text-align: center; }
.onboard-visual { height: 200px; background: var(--acc-light); display: flex; align-items: center; justify-content: center; }
.onboard-icon-wrap { width: 90px; height: 90px; border-radius: 50%; background: var(--acc); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.onboard-content { padding: 24px 24px 16px; }
.onboard-title { font-size: 20px; font-weight: 500; margin-bottom: 10px; }
.onboard-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.onboard-dots { display: flex; gap: 6px; justify-content: center; padding: 12px 0; }
.onboard-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc-light); }
.onboard-dot.active { background: var(--acc); width: 22px; border-radius: 4px; }
.onboard-actions { padding: 0 20px 32px; display: flex; gap: 10px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px; }
.stat-card { background: var(--acc-light); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat-num { font-size: 18px; font-weight: 500; color: var(--acc); }
.stat-lbl { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

/* TASK MAP POPUP */
.map-task-popup {
  position: fixed;
  bottom: 76px; left: 50%; transform: translateX(-50%);
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  padding: 16px;
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 80;
  display: none;
}
.map-task-popup.visible { display: block; animation: slideUp 0.2s ease; }

/* RESPONSIVE */
@media (min-width: 480px) {
  .bottom-nav { max-width: 480px; }
  .map-fab { right: calc(50% - 224px); }
  .map-search { max-width: 448px; }
}
