/* Sidebar menu pages — match reference designs */
.app-page { max-width: 960px; margin: 0 auto; padding: 0 0 32px; min-height: 60vh; }
.app-page.app-page-wide { max-width: 1140px; }

.page-banner {
  background: #fde8dc;
  text-align: center;
  padding: 18px 16px 52px;
  position: relative;
}
.page-banner h1 { font-size: 18px; font-weight: 700; color: #1a1a1a; }

/* ── Profile ── */
.profile-page { background: #fff; }
.profile-hero { text-align: center; padding: 0 16px 20px; margin-top: -40px; position: relative; }
.profile-avatar-wrap {
  width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%;
  border: 4px solid #c8e6c9; background: #e8f5e9; overflow: hidden;
  display: grid; place-items: center;
}
.profile-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-wrap .avatar-icon { width: 52px; height: 52px; color: #81c784; }
.profile-hero h2 { font-size: 17px; font-weight: 700; text-transform: lowercase; }
.profile-delete {
  position: absolute; right: 16px; top: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: none; font-size: 13px; color: #333; cursor: pointer; font-family: inherit;
}
.profile-delete svg { color: #e53935; width: 18px; height: 18px; }

.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 0 16px 18px; max-width: 720px; margin: 0 auto;
}
.profile-stat-card {
  border: 1.5px solid #ffd4b8; border-radius: 12px; padding: 18px 12px;
  text-align: center; background: #fff;
}
.profile-stat-card .stat-icon {
  width: 36px; height: 36px; border-radius: 50%; background: #e8f5e9;
  display: grid; place-items: center; margin: 0 auto 10px; color: #66bb6a;
}
.profile-stat-card strong { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.profile-stat-card span { font-size: 12px; color: #888; }

.profile-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 0 16px 24px; max-width: 720px; margin: 0 auto;
}
.profile-action-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e8e8e8; border-radius: 12px; padding: 14px 14px;
  background: #fff; font-size: 13px; font-weight: 600; min-height: 52px;
}
.profile-action-card.clickable { cursor: pointer; border: none; font-family: inherit; color: inherit; width: 100%; text-align: left; }
.profile-action-card .pa-icon { color: #888; flex-shrink: 0; width: 20px; height: 20px; }
.profile-action-card .pa-label { flex: 1; }
.profile-toggle {
  width: 44px; height: 24px; border-radius: 999px; border: none; cursor: pointer;
  background: #fde8dc; position: relative; flex-shrink: 0; padding: 0;
}
.profile-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s;
}
.profile-toggle.on { background: #ff6b00; }
.profile-toggle.on::after { transform: translateX(20px); }

/* ── Address ── */
.address-page-wrap { padding: 0 16px 24px; }
.address-card-main {
  background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,.06);
  overflow: hidden; margin-top: -28px; position: relative; z-index: 2;
}
.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 768px) { .address-grid { grid-template-columns: 1fr; } }
.address-col-left { padding: 20px; border-right: 1px solid #f0f0f0; }
@media (max-width: 768px) { .address-col-left { border-right: none; border-bottom: 1px solid #f0f0f0; } }
.address-col-right { padding: 20px; }
.address-map-box {
  height: 220px; border-radius: 10px; overflow: hidden;
  border: 2px solid #ff6b00; margin-bottom: 16px;
}
.address-map-box .leaflet-container { height: 100%; width: 100%; }
.address-label-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.address-label-btns { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.address-label-btn {
  flex: 1; min-width: 80px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: 8px; border: 1px solid #ddd; background: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: #666;
}
.address-label-btn.active {
  background: #ff6b00; border-color: #ff6b00; color: #fff;
}
.address-label-btn.active svg { color: #fff; }
.address-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.address-field input, .address-field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: #1a1a1a; margin-bottom: 14px;
}
.address-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.address-phone-wrap {
  display: flex; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; margin-bottom: 14px;
}
.address-phone-prefix {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-right: 1px solid #ddd; background: #fafafa; font-size: 14px; white-space: nowrap;
}
.address-phone-prefix img { width: 22px; height: 14px; object-fit: cover; border-radius: 2px; }
.address-phone-wrap input { border: none; margin: 0; flex: 1; border-radius: 0; }
.btn-save-location {
  width: 100%; padding: 14px; border: none; border-radius: 8px;
  background: #ff6b00; color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-top: 4px;
}
.btn-save-location:hover { background: #e55f00; }

/* ── Help & Support ── */
.help-page-wrap { padding: 24px 16px 32px; max-width: 1100px; margin: 0 auto; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 768px) { .help-grid { grid-template-columns: 1fr; } }
.help-left { text-align: center; padding: 12px 8px; }
.help-illustration { max-width: 280px; width: 100%; margin: 0 auto 20px; display: block; }
.help-left h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.help-left p { font-size: 14px; color: #666; line-height: 1.6; max-width: 340px; margin: 0 auto; }
.help-cards-wrap {
  background: #f5f5f5; border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.help-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.help-card-icon {
  width: 44px; height: 44px; border-radius: 10px; background: #fff3e8;
  display: grid; place-items: center; flex-shrink: 0; color: #ff6b00;
}
.help-card-body { flex: 1; min-width: 0; }
.help-card-body h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.help-card-body p { font-size: 12px; color: #888; line-height: 1.4; margin-bottom: 4px; }
.help-card-body strong { font-size: 13px; font-weight: 700; color: #1a1a1a; }
.help-card-action {
  width: 40px; height: 40px; border-radius: 50%; background: #4caf50;
  display: grid; place-items: center; flex-shrink: 0; color: #fff; border: none; cursor: pointer;
}

/* ── Legacy page header (other sidebar pages) ── */
.app-page-header {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.app-page-header h1 { font-size: 18px; flex: 1; text-align: center; margin-right: 34px; font-weight: 700; }
.app-page-body { padding: 16px; }

.order-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.order-tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer;
}
.order-tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }

.order-card {
  background: var(--surface); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer;
}
.order-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.order-card h3 { font-size: 15px; margin-bottom: 4px; }
.order-status {
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  background: #e8f5e9; color: #2e7d32;
}
.order-status.pending { background: #fff3e0; color: #e65100; }
.order-status.delivered { background: #e3f2fd; color: #1565c0; }
.order-card-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

.lang-list { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.lang-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font: inherit; color: inherit;
}
.lang-item:last-child { border-bottom: none; }
.lang-item.active { background: var(--menu-bg); }
.lang-check { color: var(--orange); font-weight: 700; }

.coupon-apply-row { display: flex; gap: 8px; margin-bottom: 16px; }
.coupon-apply-row input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--surface); color: var(--text);
}
.coupon-card {
  background: var(--surface); border: 2px dashed var(--orange); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}
.coupon-card .code { font-weight: 800; color: var(--orange); font-size: 16px; }
.coupon-card .desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

.chat-page { display: flex; flex-direction: column; height: calc(100vh - 120px); max-height: 640px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4;
}
.chat-bubble.agent { background: var(--cream); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-bubble.user { background: var(--orange); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-row {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-row input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px;
}

.policy-section { margin-bottom: 20px; }
.policy-section h3 { font-size: 16px; margin-bottom: 8px; }
.policy-section p { font-size: 14px; color: var(--muted); line-height: 1.6; }

.join-form { background: var(--surface); border-radius: var(--radius); padding: 20px 16px; box-shadow: var(--shadow); }
.join-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.join-form input, .join-form select, .join-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--surface); color: var(--text);
}
.join-form textarea { min-height: 80px; resize: vertical; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

/* Dark theme overrides for sidebar pages */
html.dark-theme .profile-page,
html.dark-theme .address-card-main,
html.dark-theme .help-card { background: #141414; }
html.dark-theme .page-banner { background: #2a2018; }
html.dark-theme .profile-stat-card,
html.dark-theme .profile-action-card { background: #1a1a1a; border-color: #333; }
html.dark-theme .help-cards-wrap { background: #111; }
html.dark-theme .address-col-left { border-color: #333; }
html.dark-theme .address-field input,
html.dark-theme .address-phone-wrap { background: #1a1a1a; border-color: #333; color: #eee; }
html.dark-theme .address-phone-prefix { background: #222; border-color: #333; }

/* ── Join Delivery / Join Restaurant ── */
.join-page-wrap { padding: 0 16px 32px; max-width: 1100px; margin: 0 auto; }
.join-card {
  background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,.06);
  padding: 28px 24px 24px; margin-top: -24px; position: relative; z-index: 2;
  margin-bottom: 20px;
}
.join-card-center-title { text-align: center; margin-bottom: 20px; }
.join-card-center-title h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.join-card-center-title p { font-size: 13px; color: #888; }

.join-upload-box {
  width: 140px; height: 140px; margin: 0 auto 24px; border: 2px dashed #d4a574;
  border-radius: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; cursor: pointer; color: #999; font-size: 12px;
  text-align: center; padding: 12px; background: #fafafa;
}
.join-upload-box.wide { width: 100%; max-width: none; height: auto; min-height: 120px; margin: 0 0 16px; }
.join-upload-box.rect { width: 100%; min-height: 100px; aspect-ratio: 3/1; max-height: 120px; }
.join-upload-box.tin { width: 100%; min-height: 160px; border-style: dashed; border-color: #ddd; background: #f9f9f9; }
.join-upload-box svg { opacity: .5; }

.join-field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.join-field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) {
  .join-field-grid, .join-field-grid-2 { grid-template-columns: 1fr; }
}

.join-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.join-input-wrap {
  display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px;
  overflow: hidden; background: #fff;
}
.join-input-wrap input, .join-input-wrap select {
  flex: 1; border: none; padding: 11px 12px; font-size: 14px; font-family: inherit;
  background: transparent; color: #1a1a1a; min-width: 0;
}
.join-input-wrap .field-icon { padding: 0 12px; color: #aaa; display: grid; place-items: center; flex-shrink: 0; }
.join-input-wrap .field-eye {
  border: none; background: none; padding: 0 12px; color: #aaa; cursor: pointer;
}
.join-input-wrap select { appearance: none; cursor: pointer; }
.join-field select.join-select {
  width: 100%; padding: 11px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: #1a1a1a;
}
.join-phone-prefix {
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border-right: 1px solid #ddd; font-size: 14px; white-space: nowrap; color: #333;
}
.join-phone-prefix img { width: 22px; height: 14px; border-radius: 2px; }

.join-section-head {
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid #eee;
}
.join-section-head svg { color: #333; }

.join-step-note {
  font-size: 13px; color: #888; margin: -8px 0 20px; line-height: 1.5;
}
.join-upload-grid { display: flex; flex-direction: column; gap: 0; }

.join-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.join-btn-reset {
  padding: 10px 22px; border: 1px solid #ddd; border-radius: 8px; background: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; color: #666;
}
.join-btn-next {
  padding: 10px 28px; border: none; border-radius: 8px; background: #ff6b00;
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.join-btn-next:hover { background: #e55f00; }

.join-stepper {
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 20px 16px 8px; max-width: 640px; margin: 0 auto;
}
.join-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative;
}
.join-step::before {
  content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px;
  background: #e0e0e0; z-index: 0;
}
.join-step:last-child::before { display: none; }
.join-step-dot {
  width: 28px; height: 28px; border-radius: 50%; background: #e0e0e0; color: #888;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; z-index: 1; position: relative;
}
.join-step.active .join-step-dot { background: #ff6b00; color: #fff; }
.join-step.done .join-step-dot { background: #ff6b00; color: #fff; }
.join-step-label { font-size: 11px; color: #888; text-align: center; max-width: 100px; }
.join-step.active .join-step-label { color: #ff6b00; font-weight: 600; }

.join-lang-tab {
  display: inline-block; font-size: 14px; font-weight: 600; padding-bottom: 8px;
  border-bottom: 2px solid #ff6b00; margin-bottom: 18px; color: #1a1a1a;
}
.join-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .join-two-col { grid-template-columns: 1fr; } }

.join-outlined-field { position: relative; margin-bottom: 16px; }
.join-outlined-field label {
  position: absolute; top: -8px; left: 12px; background: #fff; padding: 0 6px;
  font-size: 12px; color: #666; font-weight: 500;
}
.join-outlined-field input, .join-outlined-field textarea {
  width: 100%; padding: 14px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.join-outlined-field textarea { min-height: 100px; resize: vertical; }
.join-outlined-field .field-suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #ff6b00;
}
.join-outlined-field.has-suffix input { padding-right: 40px; }

.join-map-search {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px 8px 0 0;
  font-size: 14px; border-bottom: none;
}
.join-map-box { height: 260px; border: 1px solid #ddd; border-radius: 0 0 8px 8px; overflow: hidden; }
.join-map-box .leaflet-container { height: 100%; width: 100%; }

.join-general-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1.6fr; gap: 16px; align-items: start;
}
@media (max-width: 900px) { .join-general-row { grid-template-columns: 1fr; } }

.join-tin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .join-tin-row { grid-template-columns: 1fr; } }

.join-required { color: #ff6b00; }

html.dark-theme .join-card { background: #141414; }
html.dark-theme .join-input-wrap,
html.dark-theme .join-field select.join-select,
html.dark-theme .join-outlined-field input,
html.dark-theme .join-outlined-field textarea { background: #1a1a1a; border-color: #333; color: #eee; }
html.dark-theme .join-outlined-field label { background: #141414; }
html.dark-theme .join-upload-box { background: #1a1a1a; }
