:root {
  --mobile-navy: #172f46;
  --mobile-navy-soft: #29465f;
  --mobile-accent: #16bdb5;
  --mobile-accent-dark: #0c928c;
  --mobile-bg: #f5f7f9;
  --mobile-text: #172b3d;
  --mobile-muted: #6f7f8d;
  --mobile-border: rgba(23, 47, 70, 0.09);
}

.mobile-app-header,
.mobile-bottom-nav,
.mobile-bottom-nav-v2,
.mobile-page,
.mobile-bottom-sheet,
.mobile-sheet-backdrop,
.mobile-icon-sprite {
  display: none;
}

@media (max-width: 767px) {
  html { max-width: 100%; overflow-x: hidden; background: var(--mobile-bg); }
  body.nav-md, body.nav-sm { max-width: 100%; overflow-x: hidden; background: var(--mobile-bg) !important; color: var(--mobile-text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  body.mobile-sheet-visible { overflow: hidden; }
  .container.body, .main_container { width: 100%; min-height: 100%; margin: 0; padding: 0; background: var(--mobile-bg); }
  #sidebarMenu, .top_nav, .desktop-product-content, .desktop-order-content { display: none !important; }
  .desktop-dashboard-content { display: none !important; }
  body.nav-md .container.body .right_col, body.nav-sm .container.body .right_col, .right_col { width: 100%; min-height: 100vh !important; margin: 0 !important; padding: calc(82px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom)) !important; background: var(--mobile-bg) !important; }
  body:has(.is-dashboard-header) .right_col { padding-top: calc(194px + env(safe-area-inset-top)) !important; }

  .mobile-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .mobile-app-header { position: fixed; inset: 0 0 auto; z-index: 1040; height: calc(72px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; color: #fff; background: linear-gradient(125deg, #132e46 0%, #116a72 58%, #16bdb5 100%); border-radius: 0 0 22px 22px; box-shadow: 0 8px 24px rgba(19,46,70,.2); }
  .mobile-app-header::after { position: absolute; inset: 0; z-index: -1; content: ""; opacity: .2; background: radial-gradient(circle at 76% 25%, #fff 0 1px, transparent 2px), radial-gradient(circle at 88% 64%, #fff 0 2px, transparent 3px), linear-gradient(170deg, transparent 58%, rgba(255,255,255,.28) 59%, transparent 60%); background-size: 62px 48px, 94px 72px, 100% 100%; pointer-events: none; }
  .mobile-app-header.is-dashboard-header { height: calc(184px + env(safe-area-inset-top)); padding-bottom: 96px; border-radius: 0 0 32px 32px; }
  .mobile-brand { display: inline-flex; min-width: 0; align-items: center; gap: 9px; color: #fff !important; text-decoration: none !important; }
  .mobile-brand-mark { display: grid; width: 39px; height: 39px; place-items: center; flex: 0 0 39px; color: var(--mobile-navy); background: #fff; border: 3px solid rgba(255,255,255,.42); border-radius: 13px; box-shadow: 0 5px 13px rgba(4,27,38,.2); font-size: 13px; font-weight: 900; transform: rotate(-5deg); }
  .mobile-brand-name { display: flex; color: #dff9f7 !important; flex-direction: column; font-size: 17px; font-weight: 650; line-height: .95; letter-spacing: -.4px; }
  .mobile-brand-name b { display: inline; color: #fff; }
  .mobile-brand-name small { margin-top: 5px; color: #b8e9e5; font-size: 8px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
  .mobile-header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
  .mobile-icon-button, .mobile-avatar, .mobile-filter-button { display: inline-flex; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 5px 12px rgba(3,28,38,.12); transition: background .2s ease, transform .2s ease; }
  .mobile-icon-button:active, .mobile-avatar:active, .mobile-filter-button:active, .mobile-button:active { transform: scale(.96); }
  .mobile-icon-button:focus-visible, .mobile-avatar:focus-visible, .mobile-filter-button:focus-visible, .mobile-button:focus-visible, .filter-chip:focus-visible, .mobile-search:focus-within { outline: 3px solid rgba(22,189,181,.25); outline-offset: 2px; }
  .mobile-icon-button svg, .mobile-filter-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-avatar { width: 40px; height: 40px; color: var(--mobile-navy); background: #fff; border-radius: 13px; font-weight: 800; }
  .mobile-header-welcome { position: absolute; left: 18px; right: 18px; bottom: 24px; display: flex; flex-direction: column; }
  .mobile-header-welcome small { color: #bfe9e6; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-header-welcome strong { margin: 2px 0 4px; color: #fff; font-size: 24px; line-height: 1.1; }
  .mobile-header-welcome span { color: #d8f3f1; font-size: 12px; }

  .mobile-page { display: block; padding: 18px 16px 24px; }
  .mobile-page-intro { display: flex; min-width: 0; margin-bottom: 18px; align-items: center; justify-content: space-between; gap: 16px; }
  .mobile-page-intro h1 { margin: 1px 0 4px; color: var(--mobile-navy); font-size: 23px; line-height: 1.2; font-weight: 750; letter-spacing: -.5px; }
  .mobile-page-intro p { margin: 0; color: var(--mobile-muted); font-size: 13px; }
  .mobile-page-intro .mobile-eyebrow { color: var(--mobile-accent-dark); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-count-badge { display: grid; min-width: 42px; height: 42px; padding: 0 10px; place-items: center; flex: 0 0 auto; color: var(--mobile-accent-dark); background: #e4f8f6; border-radius: 14px; font-size: 14px; font-weight: 750; }

  .mobile-search-row { display: flex; margin-bottom: 12px; gap: 9px; }
  .mobile-search { display: flex; height: 48px; min-width: 0; padding: 0 14px; align-items: center; flex: 1; gap: 10px; background: #fff; border: 1px solid var(--mobile-border); border-radius: 15px; box-shadow: 0 3px 12px rgba(22,43,60,.035); transition: border-color .2s ease, box-shadow .2s ease; }
  .mobile-search:focus-within { border-color: var(--mobile-accent); box-shadow: 0 0 0 3px rgba(22,189,181,.09); outline: none; }
  .mobile-search svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--mobile-muted); stroke-width: 1.9; stroke-linecap: round; }
  .mobile-search input { width: 100%; height: 100%; padding: 0; color: var(--mobile-text); background: transparent; border: 0; outline: 0; font-size: 15px; }
  .mobile-search input::placeholder { color: #96a2ad; }
  .mobile-filter-button { flex: 0 0 48px; height: 48px; color: #fff; background: var(--mobile-navy); }
  .mobile-filter-chips { display: flex; margin: 0 -16px 16px; padding: 0 16px 3px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .mobile-filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip { min-height: 38px; padding: 9px 14px; flex: 0 0 auto; color: var(--mobile-navy-soft); background: #fff; border: 1px solid var(--mobile-border); border-radius: 20px; font-size: 12px; font-weight: 650; text-decoration: none !important; transition: .2s ease; }
  .filter-chip.is-active { color: #fff; background: var(--mobile-accent); border-color: var(--mobile-accent); box-shadow: 0 4px 12px rgba(22,189,181,.2); }

  .mobile-card-list { display: grid; gap: 12px; }
  .mobile-product-card, .mobile-order-card, .mobile-empty-state { min-width: 0; padding: 15px; background: #fff; border: 1px solid var(--mobile-border); border-radius: 17px; box-shadow: 0 3px 14px rgba(17,39,57,.045); }
  .mobile-product-card[hidden], .mobile-empty-state[hidden] { display: none; }
  .product-card-heading { display: flex; min-width: 0; align-items: flex-start; gap: 13px; }
  .product-card-heading > img, .product-image-fallback { width: 76px; height: 76px; flex: 0 0 76px; object-fit: cover; border-radius: 13px; background: #eef2f4; }
  .product-image-fallback { display: grid; place-items: center; color: #9aa8b3; }
  .product-image-fallback[hidden] { display: none; }
  .product-image-fallback svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
  .product-card-title { min-width: 0; flex: 1; }
  .product-card-title h2, .mobile-order-card h2 { display: -webkit-box; margin: 2px 0 5px; overflow: hidden; color: var(--mobile-navy); font-size: 16px; line-height: 1.35; font-weight: 700; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .product-card-title p, .order-reference { margin: 0 0 7px; color: var(--mobile-muted); font-size: 12px; }
  .status-badge { display: inline-flex; min-height: 24px; padding: 4px 8px; align-items: center; gap: 5px; border-radius: 8px; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
  .status-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .status-active, .status-completed { color: #17805d; background: #e6f7f0; }
  .status-upcoming { color: #9b6300; background: #fff4dc; }
  .product-price-grid { display: grid; margin: 14px 0; padding: 13px 0; grid-template-columns: 1fr 1fr; gap: 13px; border-top: 1px solid var(--mobile-border); border-bottom: 1px solid var(--mobile-border); }
  .product-price-grid > * { min-width: 0; margin: 0; }
  .product-price-grid span { display: block; margin-bottom: 4px; color: var(--mobile-muted); font-size: 11px; font-weight: 600; }
  .product-price-grid strong { color: var(--mobile-navy); font-size: 17px; }
  .mobile-price-input { display: flex !important; height: 32px; margin: 0 !important; align-items: center; overflow: hidden; color: var(--mobile-navy) !important; background: var(--mobile-bg); border: 1px solid var(--mobile-border); border-radius: 9px; }
  .mobile-price-input b { padding-left: 9px; font-size: 15px; }
  .mobile-price-input input { width: 100%; min-width: 0; padding: 5px 8px 5px 3px; background: transparent; border: 0; outline: 0; font-size: 15px; font-weight: 700; }
  .mobile-card-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; }
  .mobile-button { display: inline-flex; min-height: 44px; padding: 10px 12px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; font-size: 12px; font-weight: 700; text-align: center; text-decoration: none !important; transition: transform .2s ease, background .2s ease; }
  .mobile-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-button.primary { color: #fff; background: var(--mobile-accent); }
  .mobile-button.primary:hover, .mobile-button.primary:focus { color: #fff; background: var(--mobile-accent-dark); }
  .mobile-button.secondary { color: var(--mobile-navy); background: #eff3f5; }

  .mobile-order-card { padding: 16px; }
  .order-card-top { display: flex; margin-bottom: 13px; align-items: center; justify-content: space-between; gap: 12px; }
  .order-card-top > strong { color: var(--mobile-navy); font-size: 18px; }
  .mobile-order-card h2 { margin-bottom: 13px; }
  .order-info-list { margin-bottom: 15px; padding: 12px; background: var(--mobile-bg); border-radius: 12px; }
  .order-info-list p { display: flex; margin: 0 0 9px; align-items: flex-start; gap: 9px; color: #536675; font-size: 12px; line-height: 1.45; }
  .order-info-list p:last-child { margin-bottom: 0; }
  .order-info-list svg { width: 16px; height: 16px; margin-top: 1px; flex: 0 0 16px; fill: none; stroke: var(--mobile-accent-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .order-info-list span { min-width: 0; overflow-wrap: anywhere; }

  .mobile-empty-state { padding: 40px 24px; text-align: center; }
  .mobile-empty-state > svg { width: 48px; height: 48px; margin-bottom: 10px; fill: none; stroke: #9aabb7; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-empty-state h2 { margin: 0 0 6px; color: var(--mobile-navy); font-size: 17px; }
  .mobile-empty-state p { margin: 0 auto 17px; color: var(--mobile-muted); font-size: 13px; line-height: 1.5; }

  .mobile-dashboard-heading { margin-bottom: 20px; }
  .mobile-dashboard-heading p { margin: 0 0 2px; color: var(--mobile-accent-dark); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-dashboard-heading h1 { margin: 0; color: var(--mobile-navy); font-size: 20px; line-height: 1.3; font-weight: 750; }
  .mobile-section-title { margin: 0 0 13px; color: var(--mobile-navy); font-size: 17px; font-weight: 750; }
  .mobile-dashboard-grid { display: grid; margin: 0 -5px 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .mobile-dashboard-grid > a { display: flex; min-width: 0; min-height: 118px; padding: 8px 2px; align-items: center; flex-direction: column; justify-content: flex-start; gap: 6px; color: var(--mobile-navy) !important; border-radius: 17px; text-decoration: none !important; transition: transform .2s ease, background .2s ease; }
  .mobile-dashboard-grid > a:active { background: #e9f5f5; transform: scale(.97); }
  .dashboard-icon { display: grid; width: 72px; height: 72px; place-items: center; background: radial-gradient(circle, #fff 35%, #edf7f7 100%); border: 1px solid rgba(22,189,181,.08); border-radius: 22px; box-shadow: 0 8px 18px rgba(23,47,70,.08); }
  .dashboard-icon img { width: 82px; height: 82px; max-width: none; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(19,46,70,.1)); }
  .mobile-dashboard-grid strong { max-width: 100%; color: var(--mobile-navy); font-size: 11px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
  .mobile-dashboard-note { display: flex; padding: 16px; align-items: center; gap: 12px; background: linear-gradient(135deg, #eef9f8, #fff); border: 1px solid rgba(22,189,181,.12); border-radius: 17px; }
  .mobile-dashboard-note > span { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 42px; color: #fff; background: var(--mobile-accent); border-radius: 14px; }
  .mobile-dashboard-note svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mobile-dashboard-note strong { color: var(--mobile-navy); font-size: 13px; }
  .mobile-dashboard-note p { margin: 2px 0 0; color: var(--mobile-muted); font-size: 11px; line-height: 1.4; }

  .mobile-sheet-backdrop { position: fixed; inset: 0; z-index: 1050; display: block; visibility: hidden; opacity: 0; background: rgba(10,25,38,.48); transition: opacity .2s ease, visibility .2s ease; }
  .mobile-bottom-sheet { position: fixed; inset: auto 0 0; z-index: 1055; display: block; visibility: hidden; max-height: 82vh; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; opacity: 0; background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -15px 40px rgba(10,28,42,.2); transform: translateY(102%); transition: transform .22s ease, opacity .2s ease, visibility .22s; }
  .mobile-sheet-visible .mobile-sheet-backdrop { visibility: visible; opacity: 1; }
  .mobile-bottom-sheet.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
  .mobile-sheet-handle { width: 40px; height: 4px; margin: 0 auto 14px; background: #d5dce1; border-radius: 4px; }
  .mobile-sheet-heading { display: flex; margin-bottom: 15px; align-items: center; justify-content: space-between; gap: 15px; }
  .mobile-sheet-heading small { color: var(--mobile-muted); font-size: 11px; }
  .mobile-sheet-heading h2 { margin: 2px 0 0; color: var(--mobile-navy); font-size: 19px; font-weight: 750; }
  .mobile-sheet-link, .mobile-filter-option { display: flex; min-height: 50px; padding: 0 13px; align-items: center; justify-content: space-between; color: var(--mobile-navy) !important; background: var(--mobile-bg); border-radius: 12px; font-size: 14px; font-weight: 650; text-decoration: none !important; }
  .mobile-sheet-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .mobile-sheet-options { display: grid; gap: 8px; }
  .mobile-filter-option.is-active { color: var(--mobile-accent-dark) !important; background: #e9f9f7; }
  .filter-radio { width: 18px; height: 18px; border: 2px solid #b2bec6; border-radius: 50%; }
  .mobile-filter-option.is-active .filter-radio { border: 5px solid var(--mobile-accent); }

  .modal { padding: 0 !important; }
  .modal-dialog { width: auto; margin: 74px 12px 82px; }
  .modal-content { overflow: hidden; border: 0; border-radius: 17px; box-shadow: 0 15px 40px rgba(10,28,42,.22); }
  .modal-header, .modal-body, .modal-footer { padding: 16px; }
  .modal-title { color: var(--mobile-navy); font-weight: 700; }
  .modal .form-control { border-radius: 10px; }
  .modal .btn { min-height: 42px; padding: 9px 15px; border-radius: 10px; }
}

@media (max-width: 350px) {
  .mobile-app-header { padding-left: 12px; padding-right: 12px; }
  .mobile-page { padding-left: 12px; padding-right: 12px; }
  .mobile-app-header { grid-template-columns: 1fr auto; }
  .mobile-filter-chips { margin-left: -12px; margin-right: -12px; padding-left: 12px; }
  .product-card-heading > img, .product-image-fallback { width: 66px; height: 66px; flex-basis: 66px; }
  .mobile-card-actions { grid-template-columns: 1fr; }
  .dashboard-icon { width: 64px; height: 64px; }
  .dashboard-icon img { width: 74px; height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-sheet, .mobile-sheet-backdrop, .mobile-button, .mobile-icon-button, .mobile-avatar, .mobile-filter-button { transition: none !important; }
}
