
:root{
  --primary:#F04E23;
  --primary-hover:#D8431B;
  --primary-light:#FFF2EE;
  --bg:#F7F4EE;
  --card-bg:#FFFFFF;
  --text-main:#1A1714;
  --text-muted:#7A7268;
  --border:#E6DFD3;
  --border-focus:#F04E23;
  --green:#2B9E49;
  --green-light:#EBF7EE;
  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:24px;
  --radius-xl:32px;
  --shadow-sm:0 2px 8px rgba(26,23,20,.04);
  --shadow-md:0 12px 30px rgba(26,23,20,.07);
  --shadow-lg:0 20px 50px rgba(26,23,20,.12);
  --font-title:'Bricolage Grotesque',system-ui,sans-serif;
  --font-body:'Manrope',system-ui,sans-serif;
}

/* Feedback that stays above the app without blocking the page behind it. */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #1A1714;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 12px 30px rgba(26,23,20,.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.app-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.app-toast.error { background: #A5281C; }
.app-toast.success { background: #207B39; }
.pwa-install-banner button { pointer-events: auto; }

/* Keep desktop layouts usable on medium-width tablets. */
@media (max-width: 1100px) and (min-width: 769px) {
  .navbar { padding-left: 16px; padding-right: 16px; }
  .nav-middle { margin: 0 8px; gap: 8px; }
  .address-pill { max-width: 220px; overflow: hidden; }
  .address-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .navbar { padding: 8px 12px; }
  .nav-container { width: 100%; min-width: 0; gap: 8px; overflow: visible; }
  .logo-wrap { min-width: 0; gap: 8px; }
  .logo-wrap > div:last-child { min-width: 0; }
  .logo-title { font-size: 17px; white-space: nowrap; }
  .logo-sub { display: none; }
  .nav-middle { display: none !important; visibility: hidden; width: 0; margin: 0; }
  .nav-actions { margin-left: auto; flex-shrink: 0; gap: 5px; }
  .nav-actions > button { min-height: 40px; }
  .lang-btn { min-width: 42px; padding: 6px 8px; }
  .cart-nav-btn { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
  .cart-nav-btn #navCartTotal { display: none; }
  .user-btn { width: 40px; min-width: 40px; height: 40px; padding: 0; justify-content: center; }
  .user-btn > span { display: none; }
  .user-avatar-mini { width: 24px; height: 24px; }

  .mobile-top-bar { padding: 9px 14px 10px; }
  .mob-address-row { min-height: 28px; min-width: 0; }
  .mob-address-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-search-row { min-height: 42px; }

  .main-wrapper { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .hero-banner { padding: 22px 18px; margin-bottom: 20px; min-height: 0; }
  .hero-glow { width: 280px; height: 280px; right: 0; top: -70px; filter: blur(34px); }
  .hero-text { position: relative; z-index: 1; max-width: 100%; }
  .hero-text h1 { font-size: clamp(23px, 6.5vw, 29px); line-height: 1.12; }
  .hero-text p { font-size: 13.5px; line-height: 1.45; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
  .hero-stat-num { font-size: clamp(15px, 4vw, 20px); letter-spacing: -.45px; white-space: nowrap; }
  .hero-stat-desc { font-size: 10.5px; line-height: 1.2; }

  .cat-slider { gap: 8px; margin-bottom: 24px; padding-bottom: 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .cat-slider::-webkit-scrollbar { display: none; }
  .cat-pill { min-height: 42px; padding: 9px 15px; font-size: 13.5px; }
  .section-header { display: block; margin-bottom: 16px; }
  .section-title { font-size: 22px; line-height: 1.15; margin-bottom: 10px; }
  .sort-pills { width: 100%; overflow-x: auto; justify-content: stretch; scrollbar-width: none; }
  .sort-pills::-webkit-scrollbar { display: none; }
  .sort-btn { flex: 1 0 auto; min-height: 40px; padding: 7px 12px; white-space: nowrap; }
  .resto-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .resto-thumb { height: clamp(165px, 48vw, 210px); }
  .resto-info { padding: 14px 15px 16px; }
  .resto-name-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .resto-name { font-size: 17px; }

  .resto-detail-header { height: 280px; margin-bottom: 20px; }
  .resto-detail-header-overlay { display: block; padding: 20px 18px; }
  .resto-header-info { padding-top: 52px; }
  .resto-header-info h2 { font-size: clamp(25px, 7vw, 31px); line-height: 1.1; }
  .resto-header-meta { flex-wrap: wrap; gap: 5px 10px; font-size: 12.5px; line-height: 1.3; }
  .back-btn { position: absolute; top: 14px; left: 14px; padding: 9px 12px; max-width: calc(100% - 28px); font-size: 12.5px; }
  .dishes-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dishes-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dish-card { min-width: 0; }
  .dish-thumb { height: clamp(150px, 43vw, 190px); }
  .dish-body { padding: 14px; }
  .dish-footer { gap: 10px; }
  .add-dish-btn { min-height: 42px; padding: 8px 13px; }
  .cart-sidebar { position: static; padding: 18px; }
  .qty-btn { width: 32px; height: 32px; border-radius: 9px; }

  .track-card { padding: 18px 15px; border-radius: 22px; }
  .track-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .track-header > div:last-child { text-align: left !important; }
  .track-header > div:first-child > div:nth-child(2) { font-size: 21px !important; line-height: 1.2; }
  .track-steps { gap: 4px; margin: 18px 0 24px; }
  .track-steps::before { left: 18px; right: 18px; top: 17px; }
  .step-circle { width: 34px; height: 34px; }
  .step-label { max-width: 72px; font-size: 10.5px; }
  #qordaiLeafletMap { height: 240px; }
  .courier-card { align-items: flex-start !important; gap: 10px; }
  .courier-card > button { min-height: 42px; padding: 8px 10px !important; }
  .track-actions { flex-direction: column; }
  .track-actions .form-btn { min-height: 46px; }

  .dashboard-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .dash-sidebar, .dash-content { border-radius: 20px; padding: 16px; min-width: 0; }
  .dash-sidebar { gap: 5px; }
  .dash-nav-btn { min-height: 44px; padding: 10px 12px; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-box { padding: 12px 10px; min-width: 0; }
  .stat-box-num { font-size: 17px; overflow-wrap: anywhere; }
  .stat-box-desc { font-size: 10.5px; line-height: 1.25; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { padding: 10px 8px; }

  .modal-overlay { align-items: flex-start; padding: 12px; overflow-y: auto; }
  .modal-card { width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 16px; border-radius: 22px; margin: auto 0; }
  .modal-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .form-input { min-height: 46px; }
  .form-btn, .checkout-btn { min-height: 46px; }

  .mobile-nav-bar { min-height: 70px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .mob-tab-btn { min-width: 64px; min-height: 50px; justify-content: center; }
  .pwa-install-banner { left: 10px; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); padding: 12px; gap: 10px; border-radius: 18px; pointer-events: none; }
  .pwa-install-banner > * { pointer-events: none; }
  .pwa-install-banner > div:nth-child(2) { min-width: 0; }
  .pwa-install-banner > div:nth-child(2) > div:first-child { font-size: 13px !important; }
  .pwa-install-banner > div:nth-child(2) > div:last-child { font-size: 11px !important; line-height: 1.25; }
  .pwa-btn-install { min-height: 40px; white-space: nowrap; }
  .pwa-btn-close { width: 40px; height: 40px; }
  .app-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Final mobile overrides (kept last so inline desktop defaults cannot win). */
/* Role picker: compact cards keep the complete onboarding choice visible on phones. */
.welcome-shell {
  width: min(900px, 100%);
  margin: 4px auto 0;
  padding: 0 0 24px;
  text-align: center;
}
.welcome-title {
  margin: 0 0 8px;
  color: var(--text-main);
  font-family: var(--font-title);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -.7px;
  line-height: 1.08;
}
.welcome-subtitle {
  max-width: 620px;
  margin: 0 auto 24px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.role-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  text-align: left;
}
.role-card {
  display: flex;
  min-width: 0;
  min-height: 188px;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  appearance: none;
}
.role-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.role-card:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(240,78,35,.16), var(--shadow-md); outline: none; }
.role-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-light);
  font-size: 24px;
  line-height: 1;
}
.role-card-courier .role-card-icon { background: #EBF7EE; }
.role-card-resto .role-card-icon { background: #FFF4E6; }
.role-card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.role-card-title { font-family: var(--font-title); font-size: 18px; font-weight: 800; line-height: 1.18; }
.role-card-sub { color: var(--text-muted); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.role-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #F0ECE4;
}
.role-card-label { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.role-card-action { color: var(--primary); font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.role-card-courier .role-card-action { color: var(--green); }
.role-card-resto .role-card-action { color: #E8590C; }
.admin-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  margin: 18px auto 0;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.admin-entry:hover, .admin-entry:focus-visible { border-color: var(--primary); background: #fff; color: var(--primary); outline: none; }
.empty-state-card {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 22px 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--bg);
  text-align: center;
}
.empty-state-icon { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.empty-state-title { font-family: var(--font-title); font-size: 16px; font-weight: 800; }
.empty-state-sub { max-width: 360px; color: var(--text-muted); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.table-empty-state { min-height: 130px; border: 0; }

@media (max-width: 768px) {
  .role-guest .mobile-nav-bar { display: none !important; }
  .role-guest .main-wrapper { padding-bottom: 24px; }
  .welcome-shell { margin-top: 0; padding-bottom: 16px; }
  .welcome-title { font-size: clamp(26px, 8vw, 33px); line-height: 1.08; }
  .welcome-subtitle { margin-bottom: 14px; font-size: 13px; line-height: 1.35; }
  .role-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .role-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 88px;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }
  .role-card:hover { transform: none; }
  .role-card-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 14px; font-size: 22px; }
  .role-card-copy { gap: 3px; }
  .role-card-title { font-size: 15px; line-height: 1.16; }
  .role-card-sub { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .role-card-footer { min-width: 74px; flex-direction: column; align-items: flex-end; gap: 3px; margin-top: 0; padding-top: 0; border-top: 0; }
  .role-card-label { font-size: 9px; line-height: 1.15; text-align: right; white-space: nowrap; }
  .role-card-action { font-size: 11.5px; }
}
@media (max-width: 360px) {
  .welcome-title { font-size: 25px; }
  .welcome-subtitle { font-size: 12px; }
  .role-card { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 82px; gap: 8px; padding: 10px; }
  .role-card-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 20px; }
  .role-card-title { font-size: 14px; }
  .role-card-sub { font-size: 10.5px; }
  .role-card-footer { min-width: 68px; }
  .role-card-label { font-size: 8.5px; }
  .role-card-action { font-size: 11px; }
}

/* Qordai Go visual system v2: balanced surfaces, predictable controls and
   safe touch targets across desktop, tablets and small phones. */
:root {
  --shadow-sm: 0 2px 8px rgba(26, 23, 20, .045);
  --shadow-md: 0 12px 28px rgba(26, 23, 20, .085);
  --shadow-lg: 0 22px 52px rgba(26, 23, 20, .14);
  --focus-ring: 0 0 0 4px rgba(240, 78, 35, .16);
}

body {
  color: var(--text-main);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.navbar {
  padding: 12px 20px;
  box-shadow: 0 1px 0 rgba(26, 23, 20, .02);
}
.nav-container,
.main-wrapper { max-width: 1280px; }
.nav-container { min-height: 44px; }
.nav-actions { gap: 8px; }
.lang-btn,
.cart-nav-btn,
.user-btn,
.role-btn,
.cat-pill,
.sort-btn,
.add-dish-btn,
.form-btn,
.checkout-btn,
.admin-entry {
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.lang-btn,
.cart-nav-btn,
.user-btn,
.role-btn,
.cat-pill,
.sort-btn,
.add-dish-btn,
.form-btn,
.checkout-btn,
.admin-entry,
.back-btn,
.dash-nav-btn,
.mob-tab-btn,
.qty-btn,
.modal-close {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease,
    background-color .18s ease, color .18s ease;
}
.lang-btn:hover,
.cart-nav-btn:hover,
.user-btn:hover,
.role-btn:hover,
.cat-pill:hover,
.sort-btn:hover,
.add-dish-btn:hover,
.form-btn:hover,
.checkout-btn:hover,
.admin-entry:hover,
.back-btn:hover,
.dash-nav-btn:hover { transform: translateY(-1px); }
.lang-btn:active,
.cart-nav-btn:active,
.user-btn:active,
.role-btn:active,
.cat-pill:active,
.sort-btn:active,
.add-dish-btn:active,
.form-btn:active,
.checkout-btn:active,
.admin-entry:active,
.back-btn:active,
.dash-nav-btn:active,
.mob-tab-btn:active,
.qty-btn:active,
.modal-close:active { transform: scale(.97); }
.lang-btn:focus-visible,
.cart-nav-btn:focus-visible,
.user-btn:focus-visible,
.role-btn:focus-visible,
.cat-pill:focus-visible,
.sort-btn:focus-visible,
.add-dish-btn:focus-visible,
.form-btn:focus-visible,
.checkout-btn:focus-visible,
.admin-entry:focus-visible,
.back-btn:focus-visible,
.dash-nav-btn:focus-visible,
.mob-tab-btn:focus-visible,
.qty-btn:focus-visible,
.modal-close:focus-visible,
.form-input:focus-visible,
.search-bar input:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.search-bar input,
.address-pill,
.mob-search-row { min-height: 44px; }
.search-bar input { border-radius: 14px; }
.address-pill { padding-top: 9px; padding-bottom: 9px; }

.welcome-shell {
  width: min(980px, 100%);
  margin-top: 10px;
}
.welcome-title { letter-spacing: -.9px; }
.welcome-subtitle { margin-bottom: 28px; }
.role-cards { max-width: 980px; margin: 0 auto; gap: 18px; }
.role-card {
  min-height: 214px;
  padding: 22px;
  border-radius: 24px;
  border-color: rgba(230, 223, 211, .95);
  box-shadow: 0 6px 18px rgba(26, 23, 20, .05);
}
.role-card:hover { box-shadow: 0 16px 30px rgba(26, 23, 20, .11); }
.role-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: var(--primary);
}
.role-card-courier .role-card-icon { color: var(--green); }
.role-card-resto .role-card-icon { color: #E8590C; }
.role-card-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.role-card-title { font-size: 19px; }
.role-card-sub { font-size: 13px; }
.role-card-action { display: inline-flex; align-items: center; gap: 4px; }
.admin-entry { padding: 9px 18px; border-radius: 13px; }
.admin-entry-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero-banner,
.resto-card,
.dish-card,
.cart-sidebar,
.track-card,
.dash-sidebar,
.dash-content,
.role-card,
.modal-card {
  border-color: rgba(230, 223, 211, .92);
}
.resto-card,
.dish-card,
.track-card,
.dash-sidebar,
.dash-content { box-shadow: 0 7px 22px rgba(26, 23, 20, .055); }
.resto-card:hover,
.dish-card:hover { box-shadow: 0 16px 32px rgba(26, 23, 20, .11); }
.resto-info,
.dish-body { gap: 8px; }
.resto-name-row { min-height: 24px; }
.section-title { letter-spacing: -.55px; }
.sort-pills { box-shadow: var(--shadow-sm); }
.cat-slider { scrollbar-width: none; }
.cat-slider::-webkit-scrollbar { display: none; }
.add-dish-btn { box-shadow: inset 0 0 0 1px rgba(240, 78, 35, .04); }
.checkout-btn,
.form-btn { box-shadow: 0 7px 16px rgba(240, 78, 35, .18); }
.checkout-btn:hover,
.form-btn:hover { box-shadow: 0 11px 22px rgba(240, 78, 35, .24); }
.dash-content > h2,
.dash-content > h3 { letter-spacing: -.35px; }
.data-table th { text-transform: none; }
.data-table tbody tr { transition: background-color .15s ease; }
.data-table tbody tr:hover { background: rgba(247, 244, 238, .55); }
.empty-state-card { box-shadow: inset 0 0 0 1px rgba(230, 223, 211, .28); }

@media (max-width: 768px) {
  .navbar { padding: 8px 12px; }
  .nav-container { min-height: 40px; }
  .nav-actions > button { min-height: 40px; }
  .main-wrapper { max-width: 100%; padding-left: 14px; padding-right: 14px; }
  .welcome-shell { margin-top: 0; width: 100%; }
  .welcome-subtitle { margin-bottom: 16px; }
  .role-cards { width: 100%; gap: 10px; }
  .role-card {
    min-height: 92px;
    padding: 12px;
    border-radius: 19px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 11px;
  }
  .role-card-icon { width: 46px; height: 46px; border-radius: 15px; }
  .role-card-icon svg { width: 25px; height: 25px; }
  .role-card-title { font-size: 15px; }
  .role-card-sub { font-size: 11px; }
  .role-card-footer { min-width: 78px; }
  .role-card-label { font-size: 9px; }
  .role-card-action { font-size: 11.5px; }
  .admin-entry { min-height: 42px; margin-top: 14px; }
  .hero-banner { border-radius: 24px; }
  .resto-card,
  .dish-card,
  .track-card,
  .dash-sidebar,
  .dash-content,
  .cart-sidebar { border-radius: 22px; }
  .section-header { gap: 10px; }
  .sort-pills { border-radius: 13px; }
  .data-table { border-radius: 14px; }
  .mobile-nav-bar { min-height: 72px; }
}
@media (max-width: 360px) {
  .main-wrapper { padding-left: 10px; padding-right: 10px; }
  .role-card { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 86px; gap: 8px; padding: 10px; }
  .role-card-icon { width: 40px; height: 40px; border-radius: 13px; }
  .role-card-icon svg { width: 22px; height: 22px; }
  .role-card-footer { min-width: 68px; }
  .role-card-label { font-size: 8.5px; }
}

@media (max-width: 1100px) and (min-width: 769px) {
  .navbar { padding-left: 16px; padding-right: 16px; }
  .nav-middle { margin: 0 8px; gap: 8px; }
  .address-pill { max-width: 220px; overflow: hidden; }
  .address-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .navbar { padding: 8px 12px; }
  .nav-container { width: 100%; min-width: 0; gap: 8px; overflow: visible; }
  .logo-wrap { min-width: 0; gap: 8px; }
  .logo-wrap > div:last-child { min-width: 0; }
  .logo-title { font-size: 17px; white-space: nowrap; }
  .logo-sub { display: none; }
  .nav-middle { display: none !important; visibility: hidden; width: 0; margin: 0; }
  .nav-actions { margin-left: auto; flex-shrink: 0; gap: 5px; }
  .nav-actions > button { min-height: 40px; }
  .lang-btn { min-width: 42px; padding: 6px 8px; }
  .cart-nav-btn { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
  .cart-nav-btn #navCartTotal { display: none; }
  .user-btn { width: 40px; min-width: 40px; height: 40px; padding: 0; justify-content: center; }
  .user-btn > span { display: none; }
  .user-avatar-mini { width: 24px; height: 24px; }
  .mobile-top-bar { padding: 9px 14px 10px; }
  .mob-address-row { min-height: 28px; min-width: 0; }
  .mob-address-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-search-row { min-height: 42px; }
  .main-wrapper { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .hero-banner { padding: 22px 18px; margin-bottom: 20px; min-height: 0; }
  .hero-glow { width: 280px; height: 280px; right: 0; top: -70px; filter: blur(34px); }
  .hero-text { position: relative; z-index: 1; max-width: 100%; }
  .hero-text h1 { font-size: clamp(23px, 6.5vw, 29px); line-height: 1.12; }
  .hero-text p { font-size: 13.5px; line-height: 1.45; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
  .hero-stat-num { font-size: clamp(15px, 4vw, 20px); letter-spacing: -.45px; white-space: nowrap; }
  .hero-stat-desc { font-size: 10.5px; line-height: 1.2; }
  .cat-slider { gap: 8px; margin-bottom: 24px; padding-bottom: 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .cat-slider::-webkit-scrollbar { display: none; }
  .cat-pill { min-height: 42px; padding: 9px 15px; font-size: 13.5px; }
  .section-header { display: block; margin-bottom: 16px; }
  .section-title { font-size: 22px; line-height: 1.15; margin-bottom: 10px; }
  .sort-pills { width: 100%; overflow-x: auto; justify-content: stretch; scrollbar-width: none; }
  .sort-pills::-webkit-scrollbar { display: none; }
  .sort-btn { flex: 1 0 auto; min-height: 40px; padding: 7px 12px; white-space: nowrap; }
  .resto-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .resto-thumb { height: clamp(165px, 48vw, 210px); }
  .resto-info { padding: 14px 15px 16px; }
  .resto-name-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .resto-name { font-size: 17px; }
  .resto-detail-header { height: 280px; margin-bottom: 20px; }
  .resto-detail-header-overlay { display: block; padding: 20px 18px; }
  .resto-header-info { padding-top: 52px; }
  .resto-header-info h2 { font-size: clamp(25px, 7vw, 31px); line-height: 1.1; }
  .resto-header-meta { flex-wrap: wrap; gap: 5px 10px; font-size: 12.5px; line-height: 1.3; }
  .back-btn { position: absolute; top: 14px; left: 14px; padding: 9px 12px; max-width: calc(100% - 28px); font-size: 12.5px; }
  .dishes-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dishes-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dish-card { min-width: 0; }
  .dish-thumb { height: clamp(150px, 43vw, 190px); }
  .dish-body { padding: 14px; }
  .dish-footer { gap: 10px; }
  .add-dish-btn { min-height: 42px; padding: 8px 13px; }
  .cart-sidebar { position: static; padding: 18px; }
  .qty-btn { width: 32px; height: 32px; border-radius: 9px; }
  .track-card { padding: 18px 15px; border-radius: 22px; }
  .track-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .track-header > div:last-child { text-align: left !important; }
  .track-header > div:first-child > div:nth-child(2) { font-size: 21px !important; line-height: 1.2; }
  .track-steps { gap: 4px; margin: 18px 0 24px; }
  .track-steps::before { left: 18px; right: 18px; top: 17px; }
  .step-circle { width: 34px; height: 34px; }
  .step-label { max-width: 72px; font-size: 10.5px; }
  #qordaiLeafletMap { height: 240px; }
  .courier-card { align-items: flex-start !important; gap: 10px; }
  .courier-card > button { min-height: 42px; padding: 8px 10px !important; }
  .track-actions { flex-direction: column; }
  .track-actions .form-btn { min-height: 46px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .dash-sidebar, .dash-content { border-radius: 20px; padding: 16px; min-width: 0; }
  .dash-sidebar { gap: 5px; }
  .dash-nav-btn { min-height: 44px; padding: 10px 12px; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-box { padding: 12px 10px; min-width: 0; }
  .stat-box-num { font-size: 17px; overflow-wrap: anywhere; }
  .stat-box-desc { font-size: 10.5px; line-height: 1.25; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .modal-overlay { align-items: flex-start; padding: 12px; overflow-y: auto; }
  .modal-card { width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 16px; border-radius: 22px; margin: auto 0; }
  .modal-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .form-input { min-height: 46px; }
  .form-btn, .checkout-btn { min-height: 46px; }
  .mobile-nav-bar { min-height: 70px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .mob-tab-btn { min-width: 64px; min-height: 50px; justify-content: center; }
  .pwa-install-banner { left: 10px; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); padding: 12px; gap: 10px; border-radius: 18px; pointer-events: none; }
  .pwa-install-banner > * { pointer-events: none; }
  .pwa-install-banner > div:nth-child(2) { min-width: 0; }
  .pwa-install-banner > div:nth-child(2) > div:first-child { font-size: 13px !important; }
  .pwa-install-banner > div:nth-child(2) > div:last-child { font-size: 11px !important; line-height: 1.25; }
  .pwa-btn-install { min-height: 40px; white-space: nowrap; }
  .pwa-btn-close { width: 40px; height: 40px; }
  .app-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .navbar { padding-left: 9px; padding-right: 9px; }
  .logo-badge { width: 34px; height: 34px; font-size: 18px; }
  .logo-title { font-size: 16px; }
  .nav-actions { gap: 3px; }
  .lang-btn { min-width: 39px; padding-left: 6px; padding-right: 6px; }
  .cart-nav-btn, .user-btn { width: 38px; min-width: 38px; }
  .main-wrapper { padding-left: 10px; padding-right: 10px; }
  .hero-banner { padding-left: 15px; padding-right: 15px; }
  .hero-stat-desc { font-size: 9.5px; }
  .cat-pill { padding-left: 12px; padding-right: 12px; }
  .stats-row { grid-template-columns: 1fr; }
}

/* Toast base styles must come after the global reset. */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #1A1714;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 12px 30px rgba(26,23,20,.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.app-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.app-toast.error { background: #A5281C; }
.app-toast.success { background: #207B39; }

@media (max-width: 360px) {
  .navbar { padding-left: 9px; padding-right: 9px; }
  .logo-badge { width: 34px; height: 34px; font-size: 18px; }
  .logo-title { font-size: 16px; }
  .nav-actions { gap: 3px; }
  .lang-btn { min-width: 39px; padding-left: 6px; padding-right: 6px; }
  .cart-nav-btn, .user-btn { width: 38px; min-width: 38px; }
  .main-wrapper { padding-left: 10px; padding-right: 10px; }
  .hero-banner { padding-left: 15px; padding-right: 15px; }
  .hero-stat-desc { font-size: 9.5px; }
  .cat-pill { padding-left: 12px; padding-right: 12px; }
  .stats-row { grid-template-columns: 1fr; }
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
body{
  background:var(--bg);
  color:var(--text-main);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  overflow-x:hidden;
}
button,input,textarea,select{font-family:inherit}
button{cursor:pointer;border:none;outline:none}
a{text-decoration:none;color:inherit}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#D6CBB8;border-radius:10px}

@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes scaleUp{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
@keyframes pulseGlow{0%,100%{box-shadow:0 0 0 0 rgba(240,78,35,.4)}50%{box-shadow:0 0 0 12px rgba(240,78,35,0)}}

.navbar{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  padding:12px 24px;
}
.nav-container{
  max-width:1320px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.logo-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  cursor:pointer;
  flex-shrink:0;
}
.logo-badge{
  width:42px;
  height:42px;
  border-radius:14px;
  background:var(--primary);
  color:#fff;
  font-family:var(--font-title);
  font-weight:800;
  font-size:22px;
  display:grid;
  place-items:center;
  box-shadow:0 6px 16px rgba(240,78,35,.3);
}
.logo-title{
  font-family:var(--font-title);
  font-weight:800;
  font-size:21px;
  line-height:1;
  letter-spacing:-.5px;
}
.logo-sub{
  font-size:11.5px;
  color:var(--text-muted);
  font-weight:600;
  margin-top:3px;
}
.nav-middle{
  display:flex;
  align-items:center;
  gap:16px;
  flex:1;
  max-width:620px;
  margin:0 20px;
}
.address-pill{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:14px;
  padding:8px 14px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  flex-shrink:0;
  transition:all .2s;
}
.address-pill:hover{
  background:#fff;
  border-color:var(--primary);
}
.search-bar{
  position:relative;
  width:100%;
}
.search-bar input{
  width:100%;
  padding:10px 16px 10px 40px;
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:14px;
  font-size:13.5px;
  font-weight:600;
  color:var(--text-main);
  outline:none;
  transition:all .2s;
}
.search-bar input:focus{
  background:#fff;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(240,78,35,.1);
}
.search-icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-muted);
  pointer-events:none;
}
.role-pills{
  display:flex;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:14px;
  padding:3px;
  gap:2px;
}
.role-btn{
  padding:7px 13px;
  border-radius:11px;
  font-size:12.5px;
  font-weight:700;
  background:transparent;
  color:var(--text-muted);
  transition:all .2s;
}
.role-btn.active{
  background:#fff;
  color:var(--text-main);
  box-shadow:var(--shadow-sm);
}
.nav-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.lang-btn{
  background:#1A1714;
  color:#fff;
  padding:8px 13px;
  border-radius:12px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.5px;
}
.cart-nav-btn{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--primary);
  color:#fff;
  padding:8px 16px;
  border-radius:14px;
  font-weight:700;
  font-size:13.5px;
  transition:all .2s;
  box-shadow:0 4px 14px rgba(240,78,35,.28);
}
.cart-nav-btn:hover{
  background:var(--primary-hover);
  transform:translateY(-1px);
}
.user-btn{
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid var(--border);
  padding:6px 12px;
  border-radius:14px;
  font-size:13px;
  font-weight:700;
  transition:all .2s;
}
.user-avatar-mini{
  width:26px;
  height:26px;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:12px;
}
.main-wrapper{
  max-width:1320px;
  margin:0 auto;
  padding:24px 20px 60px;
  width:100%;
  flex:1;
}

.hero-banner{
  background:linear-gradient(135deg, #1A1714 0%, #2A241F 100%);
  border-radius:var(--radius-xl);
  padding:36px 44px;
  color:#fff;
  position:relative;
  overflow:hidden;
  margin-bottom:32px;
  box-shadow:var(--shadow-md);
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.hero-glow{
  position:absolute;
  width:500px;
  height:500px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(240,78,35,.6) 0%, rgba(247,179,43,.2) 40%, transparent 70%);
  right:-100px;
  top:-150px;
  filter:blur(40px);
  pointer-events:none;
}
.hero-text h1{
  font-family:var(--font-title);
  font-size:36px;
  font-weight:800;
  line-height:1.15;
  letter-spacing:-.8px;
  margin-bottom:10px;
}
.hero-text h1 span{color:var(--primary)}
.hero-text p{
  font-size:15px;
  color:rgba(255,255,255,.75);
  font-weight:500;
  max-width:480px;
  line-height:1.5;
}
.hero-stats{
  display:flex;
  gap:28px;
  margin-top:22px;
}
.hero-stat-item{display:flex;flex-direction:column}
.hero-stat-num{
  font-family:var(--font-title);
  font-weight:800;
  font-size:22px;
  color:#fff;
}
.hero-stat-desc{
  font-size:12px;
  color:rgba(255,255,255,.55);
  font-weight:600;
}
.cat-slider{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding-bottom:12px;
  margin-bottom:28px;
}
.cat-pill{
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:10px 18px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
  transition:all .2s;
}
.cat-pill:hover{
  border-color:var(--primary);
  transform:translateY(-2px);
}
.cat-pill.active{
  background:#1A1714;
  color:#fff;
  border-color:#1A1714;
  box-shadow:var(--shadow-sm);
}
.section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
}
.section-title{
  font-family:var(--font-title);
  font-size:24px;
  font-weight:800;
  letter-spacing:-.4px;
}
.sort-pills{
  display:flex;
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:3px;
  gap:2px;
}
.sort-btn{
  padding:6px 14px;
  border-radius:11px;
  font-size:12.5px;
  font-weight:700;
  background:transparent;
  color:var(--text-muted);
  transition:all .2s;
}
.sort-btn.active{
  background:var(--bg);
  color:var(--text-main);
}
.resto-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(310px, 1fr));
  gap:24px;
}
.resto-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  cursor:pointer;
  transition:all .3s cubic-bezier(.2,.8,.2,1);
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
}
.resto-card:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-md);
  border-color:rgba(240,78,35,.3);
}
.resto-thumb{
  position:relative;
  height:175px;
  background:#EAE3D5;
  overflow:hidden;
}
.resto-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .4s;
}
.resto-card:hover .resto-thumb img{transform:scale(1.04)}
.thumb-gradient{
  position:absolute;
  inset:auto 0 0 0;
  height:80px;
  background:linear-gradient(to top, rgba(20,15,10,.75), transparent);
  pointer-events:none;
}
.thumb-topdish{
  position:absolute;
  left:14px;
  bottom:10px;
  color:#fff;
  font-family:var(--font-title);
  font-weight:700;
  font-size:13.5px;
  text-shadow:0 2px 8px rgba(0,0,0,.6);
}
.thumb-tag-rating{
  position:absolute;
  top:12px;
  left:12px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(6px);
  border-radius:10px;
  padding:4px 9px;
  font-size:12px;
  font-weight:800;
}
.thumb-tag-time{
  position:absolute;
  top:12px;
  right:12px;
  background:rgba(26,23,20,.85);
  backdrop-filter:blur(6px);
  color:#fff;
  border-radius:10px;
  padding:4px 9px;
  font-size:12px;
  font-weight:700;
}
.resto-info{
  padding:16px 18px 18px;
  display:flex;
  flex-direction:column;
  flex:1;
  justify-content:space-between;
}
.resto-name-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
}
.resto-name{
  font-family:var(--font-title);
  font-size:18px;
  font-weight:800;
  letter-spacing:-.3px;
}
.resto-fee{
  font-size:12px;
  color:var(--text-muted);
  font-weight:700;
  flex-shrink:0;
}
.resto-meta{
  font-size:13px;
  color:var(--text-muted);
  margin-top:4px;
  font-weight:600;
}

.resto-detail-view{animation:fadeIn .3s ease}
.resto-detail-header{
  position:relative;
  border-radius:var(--radius-xl);
  height:240px;
  overflow:hidden;
  margin-bottom:24px;
  box-shadow:var(--shadow-md);
}
.resto-detail-header img{width:100%;height:100%;object-fit:cover}
.resto-detail-header-overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(to top, rgba(20,15,10,.85) 0%, rgba(20,15,10,.3) 60%, transparent 100%);
  display:flex;
  align-items:flex-end;
  padding:28px 32px;
  color:#fff;
  justify-content:space-between;
}
.resto-header-info h2{
  font-family:var(--font-title);
  font-size:32px;
  font-weight:800;
  letter-spacing:-.6px;
}
.resto-header-meta{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:6px;
  font-size:14px;
  font-weight:600;
  color:rgba(255,255,255,.85);
}
.back-btn{
  background:rgba(255,255,255,.2);
  backdrop-filter:blur(8px);
  color:#fff;
  border-radius:14px;
  padding:10px 18px;
  font-size:13.5px;
  font-weight:700;
  transition:all .2s;
}
.back-btn:hover{background:rgba(255,255,255,.35)}
.dishes-layout{
  display:grid;
  grid-template-columns:1fr 340px;
  gap:28px;
  align-items:flex-start;
}
@media(max-width:960px){.dishes-layout{grid-template-columns:1fr}}
.dishes-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:18px;
}
.dish-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow-sm);
  transition:all .2s;
}
.dish-card:hover{
  border-color:rgba(240,78,35,.4);
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
}
.dish-thumb{
  height:145px;
  background:#EAE3D5;
  overflow:hidden;
  position:relative;
}
.dish-thumb img{width:100%;height:100%;object-fit:cover}
.dish-body{
  padding:14px 16px 16px;
  display:flex;
  flex-direction:column;
  flex:1;
  justify-content:space-between;
}
.dish-title{
  font-family:var(--font-title);
  font-weight:700;
  font-size:15.5px;
}
.dish-desc{
  font-size:12.5px;
  color:var(--text-muted);
  margin:4px 0 12px;
  line-height:1.4;
  font-weight:500;
}
.dish-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:auto;
}
.dish-price{
  font-family:var(--font-title);
  font-weight:800;
  font-size:17px;
  color:var(--text-main);
}
.add-dish-btn{
  background:var(--primary-light);
  color:var(--primary);
  border:1px solid rgba(240,78,35,.2);
  border-radius:12px;
  padding:7px 14px;
  font-weight:800;
  font-size:13px;
  transition:all .2s;
}
.add-dish-btn:hover{background:var(--primary);color:#fff}
.cart-sidebar{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:22px;
  box-shadow:var(--shadow-md);
  position:sticky;
  top:84px;
}
.cart-title{
  font-family:var(--font-title);
  font-weight:800;
  font-size:20px;
  margin-bottom:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.cart-lines{
  display:flex;
  flex-direction:column;
  gap:12px;
  max-height:300px;
  overflow-y:auto;
  margin-bottom:16px;
}
.cart-line-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:10px;
  border-bottom:1px solid #F0ECE4;
  gap:10px;
}
.cart-line-name{font-weight:700;font-size:13.5px}
.cart-line-price{font-size:12px;color:var(--text-muted);font-weight:600}
.qty-controls{
  display:flex;
  align-items:center;
  gap:6px;
  background:var(--bg);
  border-radius:10px;
  padding:3px 6px;
}
.qty-btn{
  width:22px;
  height:22px;
  border-radius:7px;
  background:#fff;
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:13px;
}
.cart-total-row{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:var(--text-muted);
  font-weight:600;
  margin-bottom:6px;
}
.cart-grand-total{
  display:flex;
  justify-content:space-between;
  font-family:var(--font-title);
  font-weight:800;
  font-size:19px;
  color:var(--text-main);
  margin:12px 0 16px;
  padding-top:10px;
  border-top:1.5px dashed var(--border);
}
.checkout-btn{
  width:100%;
  background:var(--primary);
  color:#fff;
  border-radius:16px;
  padding:14px;
  font-family:var(--font-title);
  font-weight:800;
  font-size:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:all .2s;
  box-shadow:0 6px 20px rgba(240,78,35,.3);
}
.checkout-btn:hover{background:var(--primary-hover);transform:translateY(-1px)}

.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(26,23,20,.65);
  backdrop-filter:blur(8px);
  z-index:999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  animation:fadeIn .2s ease;
}
.modal-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:32px 28px;
  width:100%;
  max-width:440px;
  box-shadow:var(--shadow-lg);
  animation:scaleUp .25s cubic-bezier(.16,1,.3,1);
  position:relative;
}
.modal-close{
  position:absolute;
  top:20px;
  right:20px;
  width:32px;
  height:32px;
  border-radius:50%;
  background:var(--bg);
  color:var(--text-muted);
  display:grid;
  place-items:center;
  font-size:18px;
  font-weight:700;
}
.modal-title{
  font-family:var(--font-title);
  font-size:24px;
  font-weight:800;
  letter-spacing:-.4px;
  margin-bottom:6px;
}
.modal-sub{
  font-size:13.5px;
  color:var(--text-muted);
  font-weight:600;
  margin-bottom:22px;
}
.input-group{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:14px;
}
.input-label{
  font-size:12.5px;
  font-weight:700;
  color:var(--text-muted);
}
.form-input{
  width:100%;
  padding:13px 16px;
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:14px;
  font-size:14px;
  font-weight:600;
  color:var(--text-main);
  outline:none;
  transition:all .2s;
}
.form-input:focus{
  background:#fff;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(240,78,35,.1);
}
.form-btn{
  width:100%;
  background:var(--primary);
  color:#fff;
  border-radius:16px;
  padding:15px;
  font-family:var(--font-title);
  font-weight:800;
  font-size:15px;
  margin-top:10px;
  transition:all .2s;
}
.form-btn:hover{background:var(--primary-hover)}
.form-msg{
  margin-top:12px;
  font-size:13px;
  text-align:center;
  font-weight:600;
  min-height:20px;
}
.form-toggle{
  text-align:center;
  margin-top:16px;
  font-size:13px;
  color:var(--text-muted);
  font-weight:600;
}
.form-toggle a{
  color:var(--primary);
  font-weight:800;
  cursor:pointer;
}
.track-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:26px;
  box-shadow:var(--shadow-md);
  margin-bottom:24px;
}
.track-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}
.track-steps{
  display:flex;
  justify-content:space-between;
  position:relative;
  margin:20px 0 28px;
}
.track-steps::before{
  content:'';
  position:absolute;
  top:18px;
  left:30px;
  right:30px;
  height:3px;
  background:#EFE9DE;
  z-index:1;
}
.track-step-item{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  text-align:center;
}
.step-circle{
  width:36px;
  height:36px;
  border-radius:50%;
  background:#fff;
  border:2px solid #D6CBB8;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:14px;
  color:var(--text-muted);
  transition:all .3s;
}
.track-step-item.done .step-circle{
  background:var(--green);
  border-color:var(--green);
  color:#fff;
}
.track-step-item.active .step-circle{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
  box-shadow:0 0 0 6px rgba(240,78,35,.2);
  animation:pulseGlow 2s infinite;
}
.step-label{
  font-size:12px;
  font-weight:700;
  color:var(--text-muted);
  max-width:80px;
}
.track-step-item.active .step-label{color:var(--text-main);font-weight:800}
.map-canvas{
  background:#E4EFE3;
  border-radius:var(--radius-lg);
  height:200px;
  position:relative;
  overflow:hidden;
  border:1px solid #D2E4D0;
  margin-bottom:20px;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:24px;
  min-width:0;
  max-width:100%;
}
@media(max-width:1040px){.dashboard-grid{grid-template-columns:minmax(0,1fr)}}
.dash-sidebar{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:20px;
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.dash-nav-btn{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border-radius:14px;
  font-weight:700;
  font-size:14px;
  background:transparent;
  color:var(--text-muted);
  transition:all .2s;
}
.dash-nav-btn.active{background:var(--bg);color:var(--text-main)}
.dash-nav-btn:hover{background:var(--bg)}
.dash-content{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:28px;
  box-shadow:var(--shadow-sm);
  min-width:0;
}
.stats-row{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:16px;
  margin-bottom:24px;
}
.stat-box{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:18px 20px;
}
.stat-box-num{
  font-family:var(--font-title);
  font-weight:800;
  font-size:24px;
  margin-bottom:4px;
}
.stat-box-desc{
  font-size:12.5px;
  color:var(--text-muted);
  font-weight:600;
}
.data-table{width:100%;border-collapse:collapse}
.data-table th{
  text-align:left;
  font-size:12px;
  font-weight:800;
  color:var(--text-muted);
  padding:12px 14px;
  border-bottom:1.5px solid var(--border);
  letter-spacing:.5px;
}
.data-table td{
  padding:14px;
  font-size:13.5px;
  font-weight:600;
  border-bottom:1px solid #F0ECE4;
}
.status-pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:8px;
  font-size:12px;
  font-weight:800;
}
.status-pill.green{background:var(--green-light);color:var(--green)}
.status-pill.orange{background:var(--primary-light);color:var(--primary)}
.mobile-nav-bar{
  display:none;
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(16px);
  border-top:1px solid var(--border);
  padding:8px 16px 16px;
  z-index:99;
  justify-content:space-around;
}
@media(max-width:768px){
  .mobile-nav-bar{display:flex}
  .nav-middle{display:none}
  .role-pills{display:none}
  .hero-banner{padding:24px 20px}
  .hero-text h1{font-size:26px}
  .main-wrapper{padding-bottom:90px}
}
.mob-tab-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  background:transparent;
  color:var(--text-muted);
  font-size:11px;
  font-weight:700;
}
.mob-tab-btn.active{color:var(--primary)}

/* PWA Safe Area & Mobile Optimization */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.mobile-top-bar {
  display: none;
  background: #fff;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 8px;
}
.mob-address-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.mob-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 12px;
}
.mob-search-row input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
}

/* PWA Bottom Navigation Badge */
.mob-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.mob-badge.pulse {
  animation: pulseGlow 2s infinite;
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 82px;
  left: 16px;
  right: 16px;
  background: #1A1714;
  color: #fff;
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 1000;
  animation: fadeIn .3s ease;
}
.pwa-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  display: grid;
  place-items: center;
}
.pwa-btn-install {
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12.5px;
}
.pwa-btn-close {
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
}

/* Real Interactive Leaflet Map for Qordai */
.track-map-shell {
  position: relative;
  margin-bottom: 20px;
  isolation: isolate;
}
.track-map-live-strip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(220, 211, 198, .92);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 7px 22px rgba(26, 23, 20, .14);
  backdrop-filter: blur(10px);
}
.track-map-live-state { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; font-weight: 800; }
.track-map-live-state i { width: 7px; height: 7px; border-radius: 50%; background: #aaa096; }
.track-map-live-state.is-moving { color: #217a43; }
.track-map-live-state.is-moving i { background: #2fab58; box-shadow: 0 0 0 5px rgba(47, 171, 88, .14); animation: liveDot 1.6s ease-in-out infinite; }
.track-map-live-strip strong { color: var(--primary); font-family: var(--font-title); font-size: 13px; font-weight: 800; white-space: nowrap; }
#qordaiLeafletMap {
  height: 320px;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  z-index: 10;
}
#qordaiLeafletMap .leaflet-control-zoom {
  margin: 12px;
  overflow: hidden;
  border: 1px solid rgba(214, 204, 191, .95);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(26, 23, 20, .16);
}
#qordaiLeafletMap .leaflet-control-zoom a {
  width: 32px;
  height: 32px;
  line-height: 30px;
  border: 0;
  color: var(--text-main);
  background: rgba(255, 255, 255, .94);
  font-weight: 800;
}
#qordaiLeafletMap .leaflet-control-zoom a:hover { color: var(--primary); background: #fff; }
#qordaiLeafletMap .leaflet-control-attribution {
  margin: 0 6px 6px 0;
  padding: 3px 7px;
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .86);
  font-size: 10px;
}
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
}

/* Custom Marker styles */
.courier-pulse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 14px rgba(240,78,35,.5);
  animation: pulseGlow 1.8s infinite;
}
.courier-marker-host { overflow: visible !important; border: 0 !important; background: transparent !important; }
.courier-marker-wrap { display: flex; align-items: center; gap: 6px; width: max-content; filter: drop-shadow(0 6px 10px rgba(26, 23, 20, .16)); }
.courier-marker-wrap > span {
  padding: 6px 9px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #1a1714;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.track-courier-icon.is-waiting { background: #f1ece5; color: #8d8173; box-shadow: none; }
.resto-map-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #1A1714;
  color: #fff;
  font-size: 16px;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}

@media (max-width: 768px) {
  body.role-client .mobile-top-bar { display: flex; }
  .navbar .nav-middle { display: none; }
  .navbar .address-pill { display: none; }
  .main-wrapper { padding: 14px 14px 90px; }
  .hero-banner { padding: 22px 18px; margin-bottom: 20px; }
  .hero-text h1 { font-size: 24px; }
  .hero-stats { gap: 16px; margin-top: 16px; }
  .hero-stat-num { font-size: 18px; }
  .hero-stat-desc { font-size: 11px; }

  .navbar {
    padding: 10px 14px;
  }
  .nav-actions {
    gap: 6px;
  }
  .lang-btn {
    padding: 6px 9px;
    font-size: 11px;
    border-radius: 10px;
  }
  .cart-nav-btn {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 10px;
    gap: 5px;
  }
  .user-btn {
    padding: 5px 9px;
    font-size: 12px;
    border-radius: 10px;
    gap: 6px;
  }
  .user-avatar-mini {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  .logo-badge {
    width: 36px;
    height: 36px;
    font-size: 19px;
    border-radius: 11px;
  }
  .logo-title {
    font-size: 18px;
  }
  .logo-sub {
    font-size: 10px;
  }
  .modal-card {
    padding: 20px 16px;
    border-radius: 20px;
    width: calc(100% - 24px);
    margin: 12px;
  }
  .dishes-grid {
    grid-template-columns: 1fr;
  }
  .resto-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .data-table th, .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
}

/* Final mobile overrides (kept last so inline desktop defaults cannot win). */
@media (max-width: 1100px) and (min-width: 769px) {
  .navbar { padding-left: 16px; padding-right: 16px; }
  .nav-middle { margin: 0 8px; gap: 8px; }
  .address-pill { max-width: 220px; overflow: hidden; }
  .address-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .navbar { padding: 8px 12px; }
  .nav-container { width: 100%; min-width: 0; gap: 8px; overflow: visible; }
  .logo-wrap { min-width: 0; gap: 8px; }
  .logo-wrap > div:last-child { min-width: 0; }
  .logo-title { font-size: 17px; white-space: nowrap; }
  .logo-sub { display: none; }
  .nav-middle { display: none !important; visibility: hidden; width: 0; margin: 0; }
  .nav-actions { margin-left: auto; flex-shrink: 0; gap: 5px; }
  .nav-actions > button { min-height: 40px; }
  .lang-btn { min-width: 42px; padding: 6px 8px; }
  .cart-nav-btn { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
  .cart-nav-btn #navCartTotal { display: none; }
  .user-btn { width: 40px; min-width: 40px; height: 40px; padding: 0; justify-content: center; }
  .user-btn > span { display: none; }
  .user-avatar-mini { width: 24px; height: 24px; }
  .mobile-top-bar { padding: 9px 14px 10px; }
  .mob-address-row { min-height: 28px; min-width: 0; }
  .mob-address-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-search-row { min-height: 42px; }
  .main-wrapper { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .hero-banner { padding: 22px 18px; margin-bottom: 20px; min-height: 0; }
  .hero-glow { width: 280px; height: 280px; right: 0; top: -70px; filter: blur(34px); }
  .hero-text { position: relative; z-index: 1; max-width: 100%; }
  .hero-text h1 { font-size: clamp(23px, 6.5vw, 29px); line-height: 1.12; }
  .hero-text p { font-size: 13.5px; line-height: 1.45; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
  .hero-stat-num { font-size: clamp(15px, 4vw, 20px); letter-spacing: -.45px; white-space: nowrap; }
  .hero-stat-desc { font-size: 10.5px; line-height: 1.2; }
  .cat-slider { gap: 8px; margin-bottom: 24px; padding-bottom: 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .cat-slider::-webkit-scrollbar { display: none; }
  .cat-pill { min-height: 42px; padding: 9px 15px; font-size: 13.5px; }
  .section-header { display: block; margin-bottom: 16px; }
  .section-title { font-size: 22px; line-height: 1.15; margin-bottom: 10px; }
  .sort-pills { width: 100%; overflow-x: auto; justify-content: stretch; scrollbar-width: none; }
  .sort-pills::-webkit-scrollbar { display: none; }
  .sort-btn { flex: 1 0 auto; min-height: 40px; padding: 7px 12px; white-space: nowrap; }
  .resto-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .resto-thumb { height: clamp(165px, 48vw, 210px); }
  .resto-info { padding: 14px 15px 16px; }
  .resto-name-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .resto-name { font-size: 17px; }
  .resto-detail-header { height: 280px; margin-bottom: 20px; }
  .resto-detail-header-overlay { display: block; padding: 20px 18px; }
  .resto-header-info { padding-top: 52px; }
  .resto-header-info h2 { font-size: clamp(25px, 7vw, 31px); line-height: 1.1; }
  .resto-header-meta { flex-wrap: wrap; gap: 5px 10px; font-size: 12.5px; line-height: 1.3; }
  .back-btn { position: absolute; top: 14px; left: 14px; padding: 9px 12px; max-width: calc(100% - 28px); font-size: 12.5px; }
  .dishes-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dishes-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dish-card { min-width: 0; }
  .dish-thumb { height: clamp(150px, 43vw, 190px); }
  .dish-body { padding: 14px; }
  .dish-footer { gap: 10px; }
  .add-dish-btn { min-height: 42px; padding: 8px 13px; }
  .cart-sidebar { position: static; padding: 18px; }
  .qty-btn { width: 32px; height: 32px; border-radius: 9px; }
  .track-card { padding: 18px 15px; border-radius: 22px; }
  .track-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .track-header > div:last-child { text-align: left !important; }
  .track-header > div:first-child > div:nth-child(2) { font-size: 21px !important; line-height: 1.2; }
  .track-steps { gap: 4px; margin: 18px 0 24px; }
  .track-steps::before { left: 18px; right: 18px; top: 17px; }
  .step-circle { width: 34px; height: 34px; }
  .step-label { max-width: 72px; font-size: 10.5px; }
  #qordaiLeafletMap { height: 240px; }
  .courier-card { align-items: flex-start !important; gap: 10px; }
  .courier-card > button { min-height: 42px; padding: 8px 10px !important; }
  .track-actions { flex-direction: column; }
  .track-actions .form-btn { min-height: 46px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .dash-sidebar, .dash-content { border-radius: 20px; padding: 16px; min-width: 0; }
  .dash-sidebar { gap: 5px; }
  .dash-nav-btn { min-height: 44px; padding: 10px 12px; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-box { padding: 12px 10px; min-width: 0; }
  .stat-box-num { font-size: 17px; overflow-wrap: anywhere; }
  .stat-box-desc { font-size: 10.5px; line-height: 1.25; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .modal-overlay { align-items: flex-start; padding: 12px; overflow-y: auto; }
  .modal-card { width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 16px; border-radius: 22px; margin: auto 0; }
  .modal-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .form-input { min-height: 46px; }
  .form-btn, .checkout-btn { min-height: 46px; }
  .mobile-nav-bar { min-height: 70px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .mob-tab-btn { min-width: 64px; min-height: 50px; justify-content: center; }
  .pwa-install-banner { left: 10px; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); padding: 12px; gap: 10px; border-radius: 18px; pointer-events: none; }
  .pwa-install-banner > * { pointer-events: none; }
  .pwa-install-banner > div:nth-child(2) { min-width: 0; }
  .pwa-install-banner > div:nth-child(2) > div:first-child { font-size: 13px !important; }
  .pwa-install-banner > div:nth-child(2) > div:last-child { font-size: 11px !important; line-height: 1.25; }
  .pwa-btn-install { min-height: 40px; white-space: nowrap; }
  .pwa-btn-close { width: 40px; height: 40px; }
  .app-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .navbar { padding-left: 9px; padding-right: 9px; }
  .logo-badge { width: 34px; height: 34px; font-size: 18px; }
  .logo-title { font-size: 16px; }
  .nav-actions { gap: 3px; }
  .lang-btn { min-width: 39px; padding-left: 6px; padding-right: 6px; }
  .cart-nav-btn, .user-btn { width: 38px; min-width: 38px; }
  .main-wrapper { padding-left: 10px; padding-right: 10px; }
  .hero-banner { padding-left: 15px; padding-right: 15px; }
  .hero-stat-desc { font-size: 9.5px; }
  .cat-pill { padding-left: 12px; padding-right: 12px; }
  .stats-row { grid-template-columns: 1fr; }
}
/* Final cascade: keep the visual system authoritative after legacy rules. */
:root {
  --shadow-sm: 0 2px 8px rgba(26, 23, 20, .045);
  --shadow-md: 0 12px 28px rgba(26, 23, 20, .085);
  --shadow-lg: 0 22px 52px rgba(26, 23, 20, .14);
  --focus-ring: 0 0 0 4px rgba(240, 78, 35, .16);
}
body { color: var(--text-main); background: var(--bg); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.navbar { padding: 12px 20px; box-shadow: 0 1px 0 rgba(26, 23, 20, .02); }
.nav-container, .main-wrapper { max-width: 1280px; }
.nav-container { min-height: 44px; }
.nav-actions { gap: 8px; }
.lang-btn, .cart-nav-btn, .user-btn, .role-btn, .cat-pill, .sort-btn, .add-dish-btn, .form-btn, .checkout-btn, .admin-entry { min-height: 44px; align-items: center; justify-content: center; }
.lang-btn, .cart-nav-btn, .user-btn, .role-btn, .cat-pill, .sort-btn, .add-dish-btn, .form-btn, .checkout-btn, .admin-entry, .back-btn, .dash-nav-btn, .mob-tab-btn, .qty-btn, .modal-close { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease; }
.lang-btn:hover, .cart-nav-btn:hover, .user-btn:hover, .role-btn:hover, .cat-pill:hover, .sort-btn:hover, .add-dish-btn:hover, .form-btn:hover, .checkout-btn:hover, .admin-entry:hover, .back-btn:hover, .dash-nav-btn:hover { transform: translateY(-1px); }
.lang-btn:active, .cart-nav-btn:active, .user-btn:active, .role-btn:active, .cat-pill:active, .sort-btn:active, .add-dish-btn:active, .form-btn:active, .checkout-btn:active, .admin-entry:active, .back-btn:active, .dash-nav-btn:active, .mob-tab-btn:active, .qty-btn:active, .modal-close:active { transform: scale(.97); }
.lang-btn:focus-visible, .cart-nav-btn:focus-visible, .user-btn:focus-visible, .role-btn:focus-visible, .cat-pill:focus-visible, .sort-btn:focus-visible, .add-dish-btn:focus-visible, .form-btn:focus-visible, .checkout-btn:focus-visible, .admin-entry:focus-visible, .back-btn:focus-visible, .dash-nav-btn:focus-visible, .mob-tab-btn:focus-visible, .qty-btn:focus-visible, .modal-close:focus-visible, .form-input:focus-visible, .search-bar input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.search-bar input, .address-pill, .mob-search-row { min-height: 44px; }

.welcome-shell { width: min(980px, 100%); margin-top: 10px; }
.welcome-subtitle { margin-bottom: 28px; }
.role-cards { max-width: 980px; margin: 0 auto; gap: 18px; }
.role-card { min-height: 214px; padding: 22px; border-radius: 24px; border-color: rgba(230, 223, 211, .95); box-shadow: 0 6px 18px rgba(26, 23, 20, .05); }
.role-card:hover { box-shadow: 0 16px 30px rgba(26, 23, 20, .11); }
.role-card-icon { width: 52px; height: 52px; border-radius: 17px; color: var(--primary); }
.role-card-courier .role-card-icon { color: var(--green); }
.role-card-resto .role-card-icon { color: #E8590C; }
.role-card-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.role-card-title { font-size: 19px; }
.role-card-sub { font-size: 13px; }
.role-card-action { display: inline-flex; align-items: center; gap: 4px; }
.admin-entry { min-height: 44px; padding: 9px 18px; border-radius: 13px; }
.admin-entry-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-banner, .resto-card, .dish-card, .cart-sidebar, .track-card, .dash-sidebar, .dash-content, .role-card, .modal-card { border-color: rgba(230, 223, 211, .92); }
.resto-card, .dish-card, .track-card, .dash-sidebar, .dash-content { box-shadow: 0 7px 22px rgba(26, 23, 20, .055); }
.resto-card:hover, .dish-card:hover { box-shadow: 0 16px 32px rgba(26, 23, 20, .11); }
.resto-info, .dish-body { gap: 8px; }
.resto-name-row { min-height: 24px; }
.sort-pills { box-shadow: var(--shadow-sm); }
.cat-slider { scrollbar-width: none; }
.cat-slider::-webkit-scrollbar { display: none; }
.checkout-btn, .form-btn { box-shadow: 0 7px 16px rgba(240, 78, 35, .18); }
.checkout-btn:hover, .form-btn:hover { box-shadow: 0 11px 22px rgba(240, 78, 35, .24); }
.data-table tbody tr { transition: background-color .15s ease; }
.data-table tbody tr:hover { background: rgba(247, 244, 238, .55); }

@media (max-width: 768px) {
  .navbar { padding: 8px 12px; }
  .nav-container { min-height: 40px; }
  .nav-actions > button { min-height: 40px; }
  .main-wrapper { max-width: 100%; padding-left: 14px; padding-right: 14px; }
  .welcome-shell { margin-top: 0; width: 100%; }
  .welcome-subtitle { margin-bottom: 16px; }
  .role-cards { width: 100%; gap: 10px; }
  .role-card { min-height: 92px; padding: 12px; border-radius: 19px; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 11px; }
  .role-card-icon { width: 46px; height: 46px; border-radius: 15px; }
  .role-card-icon svg { width: 25px; height: 25px; }
  .role-card-title { font-size: 15px; }
  .role-card-sub { font-size: 11px; }
  .role-card-footer { min-width: 78px; }
  .role-card-label { font-size: 9px; }
  .role-card-action { font-size: 11.5px; }
  .admin-entry { min-height: 42px; margin-top: 14px; }
  .hero-banner { border-radius: 24px; }
  .resto-card, .dish-card, .track-card, .dash-sidebar, .dash-content, .cart-sidebar { border-radius: 22px; }
  .mobile-nav-bar { min-height: 72px; }
}
@media (max-width: 360px) {
  .main-wrapper { padding-left: 10px; padding-right: 10px; }
  .role-card { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 86px; gap: 8px; padding: 10px; }
  .role-card-icon { width: 40px; height: 40px; border-radius: 13px; }
  .role-card-icon svg { width: 22px; height: 22px; }
  .role-card-footer { min-width: 68px; }
}
.shift-toggle-btn, .dash-logout-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; cursor: pointer; }
.shift-toggle-btn:hover, .dash-logout-btn:hover { filter: brightness(.98); box-shadow: 0 8px 16px rgba(26, 23, 20, .08); transform: translateY(-1px); }
.courier-card { border-color: rgba(230, 223, 211, .95) !important; box-shadow: 0 4px 14px rgba(26, 23, 20, .035); }
.courier-card > div:first-child { min-width: 0; flex: 1; }
.courier-card > div:first-child > div { overflow-wrap: anywhere; }
.courier-card > div:last-child { flex: 0 0 auto; }
.courier-card > div:last-child .form-btn { min-height: 44px; }
@media (max-width: 768px) {
  .courier-card { flex-direction: column; align-items: stretch !important; gap: 14px !important; padding: 15px !important; }
  .courier-card > div:last-child { width: 100%; }
  .courier-card > div:last-child .form-btn { width: 100% !important; }
  .dash-content .section-title { margin-bottom: 14px !important; }
  .dash-sidebar > div:last-child { margin-top: 12px !important; }
}
.data-table td { vertical-align: middle; }
.data-table td > button { min-height: 40px; padding: 8px 13px !important; border-radius: 11px !important; box-shadow: 0 5px 12px rgba(26, 23, 20, .08); }
@media (max-width: 768px) {
  .data-table td > button { min-height: 44px; }
}
.role-card-icon { flex-basis: 52px; }
@media (max-width: 768px) { .role-card-icon { flex-basis: 46px; } }
@media (max-width: 360px) { .role-card-icon { flex-basis: 40px; } }
.role-guest #navUserBtn { display: none !important; }
.role-guest .nav-container { justify-content: flex-start; }
.role-guest .nav-actions { margin-left: 14px; }
.switch-account-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 800;
}
.switch-account-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.profile-logout-btn { min-height: 46px; }
.role-switch-modal { max-width: 420px; }
.role-switch-list { display: grid; gap: 10px; margin-top: 18px; }
.role-switch-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: var(--text-main);
  text-align: left;
  font-size: 14px;
  font-weight: 800;
}
.role-switch-option:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.role-switch-option > span:last-child { color: var(--text-muted); font-size: 18px; }
.role-switch-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-light); color: var(--primary); font-size: 20px; }
.role-switch-courier .role-switch-icon { background: var(--green-light); color: var(--green); }
.role-switch-resto .role-switch-icon { background: #FFF4E6; color: #E8590C; }
.admin-portal-shell { max-width: 560px; padding-top: 36px; text-align: center; }
.admin-portal-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; background: #1A1714; color: #fff; box-shadow: 0 12px 24px rgba(26, 23, 20, .18); }
.admin-portal-mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-portal-login { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 22px; border-radius: 15px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 8px 18px rgba(240, 78, 35, .22); }
.admin-portal-login:hover { background: var(--primary-hover); box-shadow: 0 12px 24px rgba(240, 78, 35, .28); transform: translateY(-1px); }
.admin-portal-back { display: block; width: fit-content; margin: 18px auto 0; color: var(--text-muted); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.admin-portal-back:hover { color: var(--primary); }
@media (max-width: 768px) {
  .role-guest .nav-actions { margin-left: 12px; }
  .role-switch-modal { width: 100%; }
  .admin-portal-shell { padding-top: 18px; }
}
.courier-dashboard { grid-template-columns: 276px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.courier-sidebar { padding: 18px; background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%); border-top: 3px solid var(--primary); }
.courier-sidebar-head { display: flex; align-items: center; gap: 11px; padding: 2px 2px 18px; border-bottom: 1px solid var(--border); }
.courier-sidebar-head strong { display: block; font-family: var(--font-title); font-size: 18px; line-height: 1.1; }
.courier-sidebar-head small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.courier-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; background: var(--primary); color: #fff; box-shadow: 0 7px 16px rgba(240, 78, 35, .22); }
.courier-mark svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.courier-profile { display: flex; align-items: center; gap: 10px; margin: 16px 0 18px; padding: 10px; border-radius: 15px; background: var(--bg); }
.courier-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: #1a1714; color: #fff; font-family: var(--font-title); font-size: 16px; font-weight: 800; }
.courier-profile strong { display: block; overflow: hidden; color: var(--text-main); font-size: 12.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.courier-profile small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10.5px; font-weight: 700; }
.courier-sidebar-label { margin: 0 4px 8px; color: #9a9185; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.courier-nav { display: grid; gap: 6px; }
.courier-nav-btn { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 58px; padding: 8px 10px; border: 1px solid transparent; border-radius: 14px; text-align: left; }
.courier-nav-btn:hover { transform: translateX(2px); }
.courier-nav-btn.active { background: var(--primary-light); border-color: rgba(240, 78, 35, .14); color: var(--text-main); }
.courier-nav-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--primary); font-size: 17px; font-weight: 800; box-shadow: var(--shadow-sm); }
.courier-nav-btn > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.courier-nav-btn b { font-size: 12.5px; line-height: 1.2; }
.courier-nav-btn small { color: var(--text-muted); font-size: 10px; font-weight: 700; line-height: 1.2; }
.courier-sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.courier-shift-btn { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; min-height: 56px; padding: 9px 11px; border-radius: 14px; color: #fff; text-align: left; }
.courier-shift-btn.is-online { background: #237f3a; }
.courier-shift-btn.is-offline { background: #a5281c; }
.courier-shift-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255, 255, 255, .16); }
.courier-shift-btn b, .courier-shift-btn small { display: block; }
.courier-shift-btn b { font-size: 12.5px; line-height: 1.2; }
.courier-shift-btn small { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; }
.courier-shift-arrow { font-size: 17px; opacity: .72; }
.courier-logout-btn { width: 100%; min-height: 44px; border: 1px solid #f3d2cf; border-radius: 13px; background: #fff4f3; color: #a5281c; font-size: 12px; font-weight: 800; }
.courier-content { padding: 26px 28px 30px; background: #fcfbf8; }
.courier-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.courier-eyebrow { margin-bottom: 6px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.courier-page-head h1 { margin: 0; font-family: var(--font-title); font-size: clamp(24px, 3vw, 31px); letter-spacing: -.65px; line-height: 1.1; }
.courier-page-head p { max-width: 520px; margin: 7px 0 0; color: var(--text-muted); font-size: 13px; font-weight: 600; line-height: 1.45; }
.courier-online-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.courier-online-badge span { width: 7px; height: 7px; border-radius: 50%; }
.courier-online-badge.is-online { background: var(--green-light); color: var(--green); }
.courier-online-badge.is-online span { background: var(--green); }
.courier-online-badge.is-offline { background: #fde8e8; color: #a5281c; }
.courier-online-badge.is-offline span { background: #a5281c; }
.courier-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.courier-stat { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 14px 15px; border-radius: 17px; background: #fff; }
.courier-stat-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; font-size: 16px; font-weight: 800; }
.courier-stat-icon.income { background: var(--primary-light); color: var(--primary); }
.courier-stat-icon.orders { background: #edf5ff; color: #2571b8; }
.courier-stat-icon.rating { background: #fff4df; color: #c27a00; }
.courier-stat .stat-box-num { margin-bottom: 2px; font-size: 19px; }
.courier-stat .stat-box-desc { font-size: 10.5px; }
.courier-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.courier-section-head h2 { margin: 0; font-family: var(--font-title); font-size: 19px; letter-spacing: -.3px; }
.courier-section-head span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.courier-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--text-main); font-size: 11px; font-weight: 800; }
.courier-refresh:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.courier-refresh span { margin: 0; font-size: 16px; }
.courier-orders-list { display: grid; gap: 12px; }
.courier-order-card { padding: 16px 17px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 5px 16px rgba(26, 23, 20, .045); }
.courier-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.courier-order-head > div { display: flex; min-width: 0; align-items: center; gap: 8px; }
.courier-order-no { color: var(--primary); font-size: 13px; font-weight: 800; }
.courier-order-restaurant { overflow: hidden; color: var(--text-main); font-family: var(--font-title); font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.courier-route { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 10px; margin: 15px 0; padding: 12px; border-radius: 14px; background: var(--bg); }
.courier-route-point { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.courier-route-point > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.courier-route-point small { color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.courier-route-point b { overflow: hidden; font-size: 11.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.courier-route-dot { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 2px; border-radius: 50%; }
.courier-route-dot.pickup { background: var(--primary); box-shadow: 0 0 0 4px rgba(240, 78, 35, .12); }
.courier-route-dot.dropoff { background: var(--green); box-shadow: 0 0 0 4px rgba(43, 158, 73, .12); }
.courier-route-line { height: 1px; background: #cfc5b7; }
.courier-order-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.courier-order-client, .courier-order-income { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.courier-order-client span, .courier-order-income span { color: var(--text-muted); font-size: 10px; font-weight: 700; }
.courier-order-client b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.courier-order-income b { color: var(--green); font-size: 13px; }
.courier-order-action .form-btn { min-height: 42px; padding: 8px 13px; white-space: nowrap; }
.courier-order-action .courier-deliver-btn { background: var(--green); }
.courier-empty-state { padding: 30px 18px; }
.courier-empty-state .courier-refresh { margin-top: 10px; }
.courier-info-modal, .role-info-modal { max-width: 460px; }
.courier-info-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 13px; border-radius: 14px; background: var(--primary-light); color: var(--primary); font-size: 20px; font-weight: 800; }
.courier-info-rows { display: grid; gap: 8px; margin: 18px 0; }
.courier-info-rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.courier-info-rows span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.courier-info-rows b { font-size: 12px; }
.courier-info-rows em { color: var(--green); font-size: 11px; font-style: normal; font-weight: 800; }
@media (max-width: 768px) {
  .courier-dashboard { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .courier-sidebar, .courier-content { border-radius: 22px; }
  .courier-sidebar { padding: 16px; }
  .courier-sidebar-footer { margin-top: 12px; }
  .courier-content { padding: 18px 16px 22px; }
  .courier-page-head { margin-bottom: 18px; }
  .courier-page-head p { font-size: 12px; }
  .courier-stats { gap: 8px; margin-bottom: 21px; }
  .courier-stat { flex-direction: column; align-items: flex-start; gap: 7px; padding: 11px 10px; }
  .courier-stat .stat-box-num { font-size: 16px; }
  .courier-stat .stat-box-desc { font-size: 9.5px; line-height: 1.2; }
  .courier-section-head { align-items: flex-start; }
  .courier-section-head h2 { font-size: 18px; }
  .courier-refresh { min-height: 36px; }
  .courier-order-card { padding: 14px; }
  .courier-order-head { align-items: flex-start; flex-direction: column; }
  .courier-route { grid-template-columns: 1fr; gap: 9px; margin: 13px 0; }
  .courier-route-line { width: 24px; margin-left: 5px; }
  .courier-order-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .courier-order-action { grid-column: 1 / -1; }
  .courier-order-action .form-btn { width: 100%; }
  .courier-info-rows > div { grid-template-columns: minmax(0, 1fr) auto; }
  .courier-info-rows em { grid-column: 2; grid-row: 1; }
}

/* Order lifecycle and cancellation surfaces */
.status-pill.cancelled { background: #f2eeee; color: #8b5f5f; }
.track-call-btn {
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--text-main); font-size: 13px; font-weight: 800; white-space: nowrap;
}
.track-call-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.track-cancel-btn, .profile-cancel-btn, .table-cancel-btn {
  min-height: 40px; padding: 8px 12px; border: 1px solid #f1c9c3; border-radius: 11px;
  background: #fff7f5; color: #b53622; font-size: 12px; font-weight: 800; transition: all .2s;
}
.track-cancel-btn { flex: 1 1 100%; min-height: 44px; margin: 0; }
.track-cancel-btn:hover, .profile-cancel-btn:hover, .table-cancel-btn:hover { background: #fde8e8; border-color: #e99688; transform: translateY(-1px); }
.track-card { animation: trackCardIn .36s ease both; }
@keyframes trackCardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.track-order-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.track-order-number { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 10px; border-radius: 8px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 800; }
.track-live-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: var(--green-light); color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .45px; }
.track-live-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: liveDot 1.4s ease-in-out infinite; }
.track-live-badge.is-done { background: #edf5ff; color: #2571b8; }
.track-live-badge.is-cancelled { background: #f2eeee; color: #8b5f5f; }
@keyframes liveDot { 0%, 100% { opacity: .45; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.track-steps::after { content: ''; position: absolute; z-index: 1; top: 18px; left: 30px; width: calc((100% - 60px) * var(--track-progress, 0)); height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #ff9b69); transform-origin: left center; animation: progressGrow .65s ease both; }
@keyframes progressGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.track-cancelled-panel {
  display: grid; justify-items: center; gap: 9px; margin: 4px 0 20px; padding: 30px 20px;
  border: 1px solid #f1d9d5; border-radius: 18px; background: #fff8f6; text-align: center;
}
.track-cancelled-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #f7d8d2; color: #b53622; font-size: 29px; font-weight: 500; }
.track-cancelled-panel strong { font-family: var(--font-title); font-size: 18px; }
.track-cancelled-panel p { max-width: 390px; color: var(--text-muted); font-size: 13px; font-weight: 600; line-height: 1.45; }
.profile-order-history { margin: 3px 0 20px; padding-top: 17px; border-top: 1px solid var(--border); }
.profile-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.profile-history-head h3 { font-family: var(--font-title); font-size: 16px; }
.profile-history-head p { margin-top: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.profile-history-count { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 800; }
.profile-order-list { display: grid; gap: 8px; max-height: 250px; overflow: auto; padding-right: 2px; }
.profile-order-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.profile-order-main { display: grid; min-width: 0; gap: 3px; }
.profile-order-main strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.profile-order-main small { color: var(--text-muted); font-size: 10.5px; font-weight: 600; }
.profile-order-no { color: var(--primary); font-size: 11px; font-weight: 800; }
.profile-order-meta { display: grid; justify-items: end; gap: 6px; flex: 0 0 auto; }
.profile-order-meta .status-pill { font-size: 10.5px; padding: 4px 8px; white-space: nowrap; }
.profile-cancel-btn { min-height: 32px; padding: 5px 8px; font-size: 10.5px; }
.profile-history-empty { display: grid; justify-items: center; gap: 6px; padding: 20px 10px; border-radius: 13px; background: var(--bg); color: var(--text-muted); text-align: center; }
.profile-history-empty span { font-size: 26px; color: var(--primary); }
.profile-history-empty b { font-size: 12px; }
.cancel-modal { max-width: 430px; }
.cancel-modal-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; background: #fff0ec; color: #b53622; font-family: var(--font-title); font-size: 25px; font-weight: 800; }
.cancel-reason-group { margin-top: 18px; }
.cancel-reason-input { min-height: 78px; resize: vertical; }
.cancel-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 17px; }
.cancel-modal-actions button { min-height: 46px; padding: 10px 12px; border-radius: 14px; font-size: 13px; font-weight: 800; }
.cancel-keep-btn { border: 1px solid var(--border); background: #fff; color: var(--text-main); }
.cancel-confirm-btn { background: #b53622; color: #fff; box-shadow: 0 7px 16px rgba(181,54,34,.2); }
.cancel-confirm-btn:hover { background: #972b1d; }
.cancel-confirm-btn:disabled { opacity: .65; cursor: wait; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.table-primary-btn, .table-success-btn { min-height: 40px; padding: 8px 12px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 800; }
.table-primary-btn { background: var(--primary); }
.table-success-btn { background: var(--green); }
.table-primary-btn:hover, .table-success-btn:hover { filter: brightness(.95); transform: translateY(-1px); }
.table-muted-action { color: var(--text-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.role-analytics-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: -6px 0 23px; }
.role-analytics-strip > div { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.role-analytics-label { overflow: hidden; color: var(--text-muted); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.role-analytics-strip b { color: var(--text-main); font-size: 13px; }
.admin-analytics-card { margin: -4px 0 24px; padding: 16px 17px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); }
.admin-analytics-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-analytics-head h2 { font-family: var(--font-title); font-size: 16px; }
.admin-analytics-head p { margin-top: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.admin-analytics-total { padding: 5px 8px; border-radius: 8px; background: #fff; color: var(--text-muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.admin-analytics-bars { display: grid; gap: 8px; }
.admin-analytics-bar-row { display: grid; grid-template-columns: 70px minmax(0,1fr) 24px; align-items: center; gap: 8px; }
.admin-analytics-bar-row > span { color: var(--text-muted); font-size: 10.5px; font-weight: 700; }
.admin-analytics-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #e7e1d8; }
.admin-analytics-bar i { display: block; height: 100%; min-width: 0; border-radius: inherit; animation: barGrow .7s ease both; }
.admin-analytics-bar i.orange { background: var(--primary); }
.admin-analytics-bar i.green { background: var(--green); }
.admin-analytics-bar i.cancelled { background: #a98787; }
.admin-analytics-bar-row b { color: var(--text-main); font-size: 11px; text-align: right; }
@keyframes barGrow { from { width: 0 !important; } }
@media (max-width: 768px) {
  .track-actions { gap: 9px !important; }
  .track-actions .form-btn, .track-actions .track-cancel-btn { flex-basis: 100%; min-width: 0 !important; }
  .track-call-btn { width: 100%; }
  .profile-order-row { align-items: flex-start; }
  .profile-order-main strong { max-width: 180px; }
  .cancel-modal-actions { grid-template-columns: 1fr; }
  .cancel-confirm-btn { order: -1; }
  .table-actions { align-items: stretch; flex-direction: column; }
  .table-actions > button { width: 100%; }
  .track-steps::after { left: 18px; width: calc((100% - 36px) * var(--track-progress, 0)); }
  .role-analytics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -4px; }
  .role-analytics-strip > div:last-child { grid-column: 1 / -1; }
  .admin-analytics-card { padding: 14px; }
}
@media (max-width: 600px) {
  .data-table { display: block; overflow: visible; white-space: normal; }
  .data-table thead { display: none; }
  .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { margin-bottom: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: 0 4px 13px rgba(26,23,20,.04); }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table td { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; font-size: 12.5px; line-height: 1.35; text-align: right; white-space: normal; }
  .data-table td::before { content: attr(data-label); flex: 0 0 74px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .2px; text-align: left; text-transform: uppercase; }
  .data-table td > * { max-width: calc(100% - 86px); }
  .data-table td[data-label="Действие"] { display: block; padding-top: 9px; margin-top: 4px; border-top: 1px solid #f0ece4; text-align: left; }
  .data-table td[data-label="Действие"]::before { display: block; margin-bottom: 7px; }
  .data-table td[data-label="Действие"] > .table-actions { width: 100%; }
  .data-table td[colspan] { display: block; padding: 0; text-align: left; }
  .data-table td[colspan]::before { display: none; }
  .data-table td[colspan] > * { max-width: none; }
}

/* Header alignment: keep the brand and utilities on one shared content rail. */
.navbar .nav-container {
  width: min(1280px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* On the welcome screen the language control is the only utility. Pin it to
   the opposite edge while the divider keeps it visually attached to the bar. */
.role-guest .nav-container { justify-content: space-between; }
.role-guest .nav-actions {
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.role-guest .lang-btn {
  min-width: 50px;
  border-radius: 13px;
}

@media (max-width: 768px) {
  .navbar .nav-container { width: 100%; }
  .role-guest .nav-actions {
    margin-left: auto;
    padding-left: 10px;
  }
  .role-guest .lang-btn { min-width: 42px; }
}

@media (max-width: 360px) {
  .role-guest .nav-actions { padding-left: 8px; }
  .role-guest .lang-btn { min-width: 39px; }
}

/* Role-isolated mobile shell: dashboards use their own navigation. */
@media (max-width: 768px) {
  body.role-courier .mobile-nav-bar,
  body.role-resto .mobile-nav-bar,
  body.role-admin .mobile-nav-bar { display: none !important; }
  body.role-courier .main-wrapper,
  body.role-resto .main-wrapper,
  body.role-admin .main-wrapper { padding-bottom: 24px; }
}

/* Profile metrics change meaning with the active role; keep the cards aligned
   while avoiding client-only labels in courier, restaurant and admin panels. */
.profile-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.profile-stat-card { min-width: 0; min-height: 72px; padding: 14px; border-radius: 18px; }
.profile-stat-card-primary { background: var(--text-main); color: #fff; }
.profile-stat-card-soft { border: 1px solid var(--border); background: var(--bg); color: var(--text-main); }
.profile-stat-value { overflow: hidden; font-family: var(--font-title); font-size: 22px; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.profile-stat-label { margin-top: 4px; color: var(--text-muted); font-size: 12px; font-weight: 600; line-height: 1.25; }
.profile-stat-card-primary .profile-stat-label { color: rgba(255,255,255,.72); }
@media (max-width: 400px) {
  .profile-stat-grid { gap: 8px; }
  .profile-stat-card { padding: 12px; border-radius: 15px; }
  .profile-stat-value { font-size: 19px; }
  .profile-stat-label { font-size: 10.5px; }
}

/* Unified SVG icon language. Inline paths inherit the surrounding accent so
   controls remain sharp and colour-consistent on every browser/OS. */
.app-icon { display: block; width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-icon-sm { width: 15px; height: 15px; flex-basis: 15px; stroke-width: 1.9; }
.app-icon-lg { width: 25px; height: 25px; flex-basis: 25px; stroke-width: 1.7; }
.desktop-order-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 13px; background: #fff; color: var(--text-main); font-size: 13px; font-weight: 800; white-space: nowrap; }
.desktop-order-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.desktop-order-btn:active { transform: scale(.97); }
.desktop-order-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.icon-text { align-items: center; gap: 6px; }
.icon-text:not(.dash-nav-btn) { display: inline-flex; }
.role-card-action .app-icon, .admin-portal-login .app-icon, .back-btn .app-icon { width: 15px; height: 15px; flex-basis: 15px; }
.role-switch-icon .app-icon { width: 21px; height: 21px; flex-basis: 21px; }
.role-switch-arrow { display: grid; place-items: center; color: var(--text-muted); }
.role-switch-arrow .app-icon { width: 17px; height: 17px; flex-basis: 17px; }
.cat-pill, .sort-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cat-pill .app-icon, .sort-btn .app-icon { width: 15px; height: 15px; flex-basis: 15px; }
.thumb-tag-rating { display: inline-flex; align-items: center; gap: 4px; }
.thumb-tag-rating .app-icon { width: 13px; height: 13px; flex-basis: 13px; }
.track-courier-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--primary); color: #fff; }
.track-courier-icon .app-icon { width: 24px; height: 24px; flex-basis: 24px; }
.courier-nav-icon .app-icon { width: 18px; height: 18px; flex-basis: 18px; }
.courier-stat-icon .app-icon { width: 18px; height: 18px; flex-basis: 18px; }
.courier-info-icon .app-icon { width: 23px; height: 23px; flex-basis: 23px; }
.empty-state-icon .app-icon { color: var(--primary); }
.profile-history-empty .app-icon { width: 24px; height: 24px; flex-basis: 24px; }
.cancel-modal-icon .app-icon { width: 23px; height: 23px; flex-basis: 23px; }
.courier-refresh .app-icon { width: 15px; height: 15px; flex-basis: 15px; }
.resto-map-icon .app-icon, .courier-pulse-icon .app-icon { width: 20px; height: 20px; flex-basis: 20px; }
.step-circle .app-icon { width: 15px; height: 15px; flex-basis: 15px; }
.table-success-btn .app-icon, .status-pill .app-icon { width: 13px; height: 13px; flex-basis: 13px; }
.auth-role-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; margin-bottom: 10px; padding: 4px 10px; border-radius: 8px; background: var(--primary-light); color: var(--primary); font-size: 11.5px; font-weight: 800; }
.auth-role-badge .app-icon { width: 14px; height: 14px; flex-basis: 14px; }
.profile-avatar-icon { display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 60px; border-radius: 20px; background: var(--primary); color: #fff; }
.profile-avatar-icon .app-icon { width: 29px; height: 29px; flex-basis: 29px; stroke-width: 1.65; }
.modal-close { display: grid; place-items: center; }
.modal-close .app-icon { width: 15px; height: 15px; flex-basis: 15px; }
.form-btn.icon-text, .track-call-btn.icon-text, .dash-logout-btn.icon-text, .profile-logout-btn.icon-text { justify-content: center; }

@media (max-width: 400px) {
  .role-switch-option { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; }
  .role-switch-icon { width: 40px; height: 40px; }
  .role-switch-icon .app-icon { width: 19px; height: 19px; flex-basis: 19px; }
  .cat-pill, .sort-btn { gap: 5px; }
}
@media (max-width: 768px) {
  .desktop-order-btn { display: none !important; }
}

/* Keep the page behind a dialog fixed while allowing the dialog itself to
   scroll on short phones. This prevents accidental background scrolling when
   a cart, profile or cancel card is open. */
body.modal-open { overflow: hidden; }
.modal-overlay { overscroll-behavior: contain; }
.modal-card { overscroll-behavior: contain; }

/* Terminal orders do not show a misleading live courier/map. */
.track-delivered-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 20px 0;
  padding: 28px 20px;
  border: 1px solid #ccebd7;
  border-radius: 20px;
  background: #f2fbf5;
  color: #217a43;
  text-align: center;
}
.track-delivered-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #2fab58;
  color: #fff;
}
.track-delivered-icon .app-icon { width: 28px; height: 28px; flex-basis: 28px; }
.track-delivered-panel strong { font-family: var(--font-title); font-size: 18px; font-weight: 800; }
.track-delivered-panel p { margin: 0; color: #4f8060; font-size: 13px; font-weight: 600; }
