/* ── APP SHELL ─────────────────────────────────────── */
#app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── SCREENS ───────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  bottom: var(--nav-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* ── SCROLL CONTENT ────────────────────────────────── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ── NAVBAR ────────────────────────────────────────── */
.navbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 10px;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  padding: 0;
  transition: color 0.2s;
}
.nav-btn.active { color: var(--brand); }
.nav-icon { width: 22px; height: 22px; }
.nav-btn.active .nav-icon { stroke: var(--brand); }
.nav-center { margin-top: -20px; }
.nav-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-fab);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}
.nav-btn.nav-center:active .nav-fab {
  transform: scale(0.92);
  box-shadow: 0 3px 10px rgba(22,168,106,0.25);
}

/* ── TOPBARS ───────────────────────────────────────── */
.plain-topbar {
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
}
.plain-topbar.with-back { padding-left: 8px; }
.plain-topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.topbar-action {
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}
.back-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: background 0.15s;
}
.back-btn:hover { background: var(--bg); }

/* ── HERO ──────────────────────────────────────────── */
.hero {
  background: var(--brand);
  padding: 20px 16px 22px;
  flex-shrink: 0;
}
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.hero-greeting {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.hero-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
}
.search-bar {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  flex: 1;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.6); }
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 10px 0;
}
.hstat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hstat-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}
.hstat-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.hstat-div {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.25);
}

/* ── SECTION ROW ───────────────────────────────────── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.see-all {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

/* ── QUICK GRID ────────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s, border-color 0.18s;
  box-shadow: var(--shadow-sm);
}
.quick-card:active {
  transform: scale(0.94);
  box-shadow: none;
}
.quick-card:hover { border-color: var(--brand-mid); }
.qcard-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.qcard-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.qcard-price {
  font-size: 11px;
  color: var(--brand);
  font-weight: 600;
}

/* ── APPOINTMENT CARDS ─────────────────────────────── */
.appt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.appt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.appt-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.appt-info { flex: 1; }
.appt-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.appt-meta { font-size: 12px; color: var(--text-secondary); }
.progress-track {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}
.appt-step-hint { font-size: 11px; color: var(--text-secondary); }

/* ── BADGES ────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-progress { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: var(--brand-light); color: var(--brand-dark); }
.badge-done { background: #D1FAE5; color: #065F46; }

/* ── OFFER BANNER ──────────────────────────────────── */
.offer-banner {
  background: linear-gradient(135deg, #0F1923 0%, #1a2a3a 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.offer-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.offer-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  font-family: var(--font-display);
}
.offer-sub { font-size: 12px; color: rgba(255,255,255,0.6); }
.offer-emoji { font-size: 40px; }

/* ── FILTER ROW ────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  background: var(--surface);
  transition: all 0.18s;
  white-space: nowrap;
}
.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── SERVICE LIST ──────────────────────────────────── */
.svc-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
}
.svc-list::-webkit-scrollbar { display: none; }
.svc-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), border-color 0.18s;
  box-shadow: var(--shadow-sm);
}
.svc-row:active { transform: scale(0.97); }
.svc-row:hover { border-color: var(--brand-mid); }
.svc-row-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.svc-row-body { flex: 1; }
.svc-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.svc-row-desc { font-size: 12px; color: var(--text-secondary); }
.svc-row-right { text-align: right; }
.svc-row-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 2px;
}
.svc-row-chev { font-size: 18px; color: var(--text-tertiary); }

/* ── BOOKING ───────────────────────────────────────── */
.book-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  background: var(--bg);
}
.book-content::-webkit-scrollbar { display: none; }
.book-block {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.book-block-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}
.selected-service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
}
.pill-price {
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.vehicle-selector { display: flex; flex-direction: column; gap: 8px; }
.vehicle-opt {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.vehicle-opt.selected {
  border-color: var(--brand);
  background: var(--brand-light);
}
.v-plate {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.v-name { font-size: 12px; color: var(--text-secondary); }

/* Date grid */
.date-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.date-cell {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  background: var(--surface);
}
.date-cell:active { transform: scale(0.93); }
.date-cell.sel {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.04);
}
.date-day { font-size: 10px; color: var(--text-tertiary); margin-bottom: 3px; }
.date-num { font-size: 16px; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }
.date-cell.sel .date-day { color: rgba(255,255,255,0.75); }
.date-cell.sel .date-num { color: #fff; }

/* Time grid */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.time-chip {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.18s var(--ease-spring);
  background: var(--surface);
}
.time-chip:active { transform: scale(0.93); }
.time-chip.sel {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: scale(1.04);
}
.time-chip.na {
  opacity: 0.38;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Note input */
.note-input {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.18s;
}
.note-input:focus { border-color: var(--brand); }

/* Summary */
.summary-block { border-radius: 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 5px 0;
}
.summary-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

/* CTA */
.cta-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 10px 16px 0;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s;
}
.cta-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(22,168,106,0.2);
}

/* ── TRACK SCREEN ──────────────────────────────────── */
.track-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.track-tab {
  flex: 1;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2.5px solid transparent;
  transition: all 0.2s;
}
.track-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab-panel {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px;
}
.tab-panel::-webkit-scrollbar { display: none; }
.tab-panel.hidden { display: none; }

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.order-id { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; font-weight: 600; }
.order-name { font-size: 15px; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }
.order-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Stepper */
.stepper { display: flex; flex-direction: column; margin-bottom: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-col { display: flex; flex-direction: column; align-items: center; width: 18px; flex-shrink: 0; }
.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-strong);
  transition: background 0.3s;
  margin-top: 2px;
}
.step-line {
  width: 2px;
  min-height: 24px;
  flex: 1;
  background: var(--border);
  margin: 3px 0;
}
.step.done .step-dot { background: var(--brand); }
.step.done .step-line { background: var(--brand); }
.step.active .step-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.step-body { padding-bottom: 18px; flex: 1; }
.step.last .step-body { padding-bottom: 0; }
.step-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.step.pending .step-name { color: var(--text-tertiary); }
.step-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.step.active .step-time { color: var(--brand); font-weight: 600; }

.outline-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-md);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  background: none;
  cursor: pointer;
  transition: background 0.18s;
}
.outline-btn:hover { background: var(--brand-light); }

.star-row { display: flex; align-items: center; gap: 3px; margin-top: 10px; }
.star { font-size: 16px; color: var(--border-strong); }
.star.filled { color: #F59E0B; }
.review-text { font-size: 12px; color: var(--text-secondary); margin-left: 6px; }
.rate-prompt {
  margin-top: 10px;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

/* ── PROFILE ───────────────────────────────────────── */
.profile-hero {
  background: var(--brand);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.profile-avatar-wrap { position: relative; margin-bottom: 10px; }
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-display);
}
.avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--surface);
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.profile-phone { font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 16px; }
.profile-stats {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  width: 100%;
  padding: 10px 0;
}
.pstat { flex: 1; text-align: center; }
.pstat-val { display: block; font-size: 18px; font-weight: 800; color: #fff; font-family: var(--font-display); }
.pstat-lbl { display: block; font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.pstat-div { width: 1px; height: 32px; background: rgba(255,255,255,0.25); }

/* Menu */
.menu-group {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 12px 16px 0;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.menu-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.menu-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}
.menu-badge.offers {
  background: var(--accent-light);
  color: var(--accent);
}
.menu-chev { font-size: 18px; color: var(--text-tertiary); }
.logout-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  padding: 14px;
  border: 1.5px solid #FECACA;
  border-radius: var(--radius-lg);
  color: #DC2626;
  font-size: 14px;
  font-weight: 700;
  background: #FEF2F2;
  cursor: pointer;
  transition: background 0.15s;
}
.logout-btn:hover { background: #FEE2E2; }

/* ── TOAST ─────────────────────────────────────────── */
.toast {
  position: absolute;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
  pointer-events: none;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
