/* ============================================================
   Storm Appliance CRM — mobile app layer
   Applies only ≤768px. Desktop styles are untouched.
   Visual language: iOS grouped lists, system type, brand tint.
   ============================================================ */
.m-topbar, .m-tabbar, .m-sheet, .m-sheet-backdrop, .m-search-slot,
.mp-chips, .mp-count, .mp-locate, .mp-sheet, .mp-fsheet, .mp-backdrop, .of-active { display: none; }

@media (max-width: 768px) {
  :root {
    --app-bg: #F2F2F7;
    --app-card: #FFFFFF;
    --app-label: #1C1C1E;
    --app-secondary: #6E6E73;
    --app-tertiary: #8E8E93;
    --app-sep: rgba(60, 60, 67, .18);
    --app-tint: #F8A809;
    --app-tint-ink: #A86600;
    --app-danger: #FF3B30;
    --app-tab-h: 50px;
    --app-top-h: 50px;
  }

  html { -webkit-text-size-adjust: 100%; background: var(--app-bg); }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
    background: var(--app-bg) !important;
    color: var(--app-label);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--app-tab-h) + env(safe-area-inset-bottom));
  }

  /* ---- retire the desktop chrome ---- */
  .dashboard-header, .dashboard-body .sidebar, .dashboard-footer, .new-order-mobile-btn { display: none !important; }
  .dashboard { display: block !important; gap: 0 !important; }
  .dashboard-body { display: block !important; padding: 0 !important; gap: 0 !important; }
  .dashboard-body > *:not(.sidebar) { background: transparent !important; padding: 12px 16px 28px !important; }
  .right-content { gap: 24px !important; }

  /* ---- top bar ---- */
  .m-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    height: calc(var(--app-top-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0 12px;
    background: rgba(242, 242, 247, .86);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid var(--app-sep);
  }
  .m-topbar .m-mark { width: 32px; height: 32px; border-radius: 8px; display: block; }
  .m-topbar .m-title {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 17px; font-weight: 600; letter-spacing: -.2px; color: var(--app-label);
    max-width: 58%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-topbar .m-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: block; background: #E5E5EA; }
  .m-topbar .m-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* ---- global search, relocated under the top bar ---- */
  .m-search-slot { display: block; padding: 10px 16px 0; }
  body.m-page-orders .m-search-slot, body.m-page-new-order .m-search-slot, body.m-page-order-detail .m-search-slot { display: none; }
  .m-search-slot .header-search { display: block !important; position: relative; margin: 0; max-width: none; flex: none; }
  .m-search-slot .header-search input {
    height: 38px; border: 0; border-radius: 10px; background: rgba(118, 118, 128, .12);
    padding: 0 12px 0 36px; font-size: 17px; color: var(--app-label);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>");
    background-repeat: no-repeat; background-size: 18px; background-position: 11px center;
  }
  .m-search-slot .header-search input::placeholder { color: var(--app-tertiary); }
  .m-search-slot .header-search .hs-results { border-radius: 12px; }

  /* ---- tab bar ---- */
  .m-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; align-items: stretch;
    height: calc(var(--app-tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(249, 249, 249, .94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid var(--app-sep);
  }
  .m-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--app-tertiary); font-size: 10px; font-weight: 500; letter-spacing: .1px;
    text-decoration: none !important; background: none; border: 0; padding: 0; font-family: inherit;
  }
  .m-tab ion-icon { font-size: 25px; }
  .m-tab.active { color: var(--app-tint-ink); }
  .m-tab.active ion-icon { color: var(--app-tint); }
  .m-tab:active { opacity: .6; }
  .m-tab-new .m-plus {
    width: 54px; height: 54px; border-radius: 50%; margin-top: -24px;
    background: var(--app-tint); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(248, 168, 9, .45), 0 0 0 4px var(--app-bg);
  }
  .m-tab-new .m-plus ion-icon { font-size: 30px; color: #fff; }
  .m-tab-new span { color: var(--app-tint-ink); margin-top: 3px; }

  /* ---- "More" sheet ---- */
  .m-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .38); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .m-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
    background: var(--app-bg); border-radius: 16px 16px 0 0;
    transform: translateY(100%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
    max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
  }
  body.m-sheet-open .m-sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.m-sheet-open .m-sheet { transform: none; }
  body.m-sheet-open { overflow: hidden; }
  .m-grab { width: 36px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 6px auto 12px; }
  .m-sheet-user { display: flex; align-items: center; gap: 12px; padding: 6px 4px 16px; }
  .m-sheet-user img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #E5E5EA; }
  .m-sheet-user b { display: block; font-size: 17px; font-weight: 600; }
  .m-sheet-user small { color: var(--app-secondary); font-size: 14px; }
  .m-group { background: var(--app-card); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
  .m-row {
    position: relative; display: flex; align-items: center; gap: 14px;
    min-height: 50px; padding: 0 16px; color: var(--app-label); font-size: 17px;
    text-decoration: none !important; background: none; border: 0; width: 100%; text-align: left; font-family: inherit;
  }
  .m-row + .m-row::before { content: ""; position: absolute; left: 58px; right: 0; top: 0; height: .5px; background: var(--app-sep); }
  .m-row:active { background: #E5E5EA; }
  .m-row ion-icon { font-size: 22px; color: var(--app-tint-ink); width: 28px; flex: none; }
  .m-row .m-chev { margin-left: auto; color: #C7C7CC; font-size: 18px; width: auto; }
  .m-row.danger, .m-row.danger ion-icon { color: var(--app-danger); }

  /* ---- controls: 44pt targets, 16px+ text (no iOS zoom) ---- */
  .dashboard-body input[type="text"], .dashboard-body input[type="search"], .dashboard-body input[type="tel"],
  .dashboard-body input[type="email"], .dashboard-body input[type="number"], .dashboard-body input[type="date"],
  .dashboard-body input[type="time"], .dashboard-body select, .dashboard-body textarea {
    font-size: 16px !important; min-height: 44px; border-radius: 10px;
  }
  .dashboard-body .btn, .dashboard-body .apply, .dashboard-body button[type="submit"] { min-height: 44px; border-radius: 10px; }
  .dashboard-body .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 12px; }
  .dashboard-body .tittle h1, .dashboard-body h1.page-title, .Orders .tittle h1 { font-size: 28px !important; font-weight: 700 !important; letter-spacing: -.4px; }

  /* ---- Home: overview tiles + chart cards ---- */
  .overview-container { grid-template-columns: 1fr 1fr !important; gap: 12px !important; background: transparent !important; }
  .overview-container .overview-box { border-radius: 14px !important; height: auto !important; min-height: 118px; padding: 16px !important; gap: 12px !important; }
  .overview-container .overview-box h1 { font-size: 30px !important; font-weight: 700 !important; letter-spacing: -.6px; }
  .overview-container .overview-box .top p { font-size: 15px !important; }
  .overview-box .more-info p { display: none !important; }
  .overview-box .more-info::after { display: none !important; }
  .overview-box .more-info::before {
    content: ""; display: block; width: 10px; height: 10px; margin: 4px 0 6px 2px;
    border-right: 2.2px solid rgba(255, 255, 255, .9); border-bottom: 2.2px solid rgba(255, 255, 255, .9);
    transform: rotate(-45deg);
  }
  .charts-section { padding: 0 !important; gap: 16px !important; }
  .income-container, .Orderproses-container { background: #fff; border-radius: 14px; padding: 16px; gap: 16px; }
  .Orderproses-container .left { border-top: 0 !important; }

  /* ---- Orders: filters, job cards ---- */
  body.m-large-title .m-topbar .m-title { display: none; }
  .Orders .tittle h1 { margin-top: 4px; }
  .Orders .search-and-details { gap: 10px; }
  .Orders .search input { height: 44px; border-radius: 10px; background: rgba(118, 118, 128, .12); border: 0; font-size: 17px; }
  .Orders .details-info { display: flex; flex-wrap: wrap; gap: 8px; }
  .Orders .details-info .dropdown[data-role="status-filter"], .Orders .quick-range { flex: 1 1 calc(50% - 4px) !important; min-width: 0; max-width: none !important; }
  .Orders .quick-range select { height: 44px; border-radius: 10px; }
  .date-range-inline { gap: 8px !important; }
  .date-range-inline input[type="date"] { flex: 1 1 calc(50% - 4px) !important; min-width: 0 !important; height: 44px; }
  .date-range-inline .apply { flex: 1 1 100% !important; background: var(--app-tint) !important; color: #3A2A00 !important; font-weight: 700; font-size: 16px; }
  .orders-cards { gap: 12px !important; }
  .order-card {
    background: var(--app-card) !important; border: 0 !important; border-radius: 14px !important;
    padding: 0 !important; box-shadow: none !important; text-align: left !important; overflow: hidden;
  }
  .order-card .oc-main { display: block; padding: 14px 16px 12px; color: var(--app-label); text-decoration: none !important; }
  .order-card .oc-main:active { background: #F2F2F7; }
  .order-card .oc-time { font-size: 20px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; }
  .order-card .oc-time.unset { color: var(--app-tertiary); font-weight: 500; font-size: 17px; }
  .order-card .oc-sub { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; font-size: 13px; color: var(--app-secondary); }
  .order-card .oc-sub b { font-weight: 500; color: var(--app-tertiary); }
  .order-card .oc-name-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
  .order-card .oc-name { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .order-card .oc-addr { margin-top: 4px; font-size: 15px; color: var(--app-secondary); line-height: 1.35; }
  .order-card .oc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--app-secondary); }
  .order-card .oc-meta span { display: inline-flex; align-items: center; gap: 5px; }
  .order-card .oc-meta ion-icon { font-size: 15px; color: var(--app-tertiary); }
  .order-card .oc-meta .oc-type { color: var(--app-tint-ink); font-weight: 600; }
  .order-card .oc-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; border-top: .5px solid var(--app-sep); margin: 0 !important; justify-content: stretch !important; }
  .order-card .oc-act {
    flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 40px; padding: 0 4px !important; border: 0; border-radius: 10px !important;
    background: #F2F2F7; color: var(--app-tint-ink); font-size: 14px; font-weight: 600; font-family: inherit;
    text-decoration: none !important; cursor: pointer; white-space: nowrap;
  }
  .order-card .oc-act ion-icon { font-size: 18px; flex: none; }
  .order-card .oc-act:active { background: #E5E5EA; }
  .order-card .oc-act.is-icon { flex: 0 0 40px; padding: 0 !important; color: var(--app-secondary); }
  .order-card .oc-act.is-icon.danger { color: var(--app-danger); }
  .order-card .oc-act.is-icon.recall { color: #7c3aed; }
  .order-card .oc-act.disabled { color: var(--app-tertiary); pointer-events: none; }
  .orders-cards .card-empty { background: #fff; border: 0; border-radius: 14px; padding: 28px 16px; color: var(--app-secondary); font-size: 15px; }
  .pagination-container { padding: 8px 0 !important; }

  /* ---- WhatsApp page cards ---- */
  .wa-card { border: 0 !important; border-radius: 14px !important; }

  @media (prefers-reduced-motion: reduce) {
    .m-sheet, .m-sheet-backdrop { transition: none; }
  }
}

/* ---- Pass 2: list pages & calendar (≤768px) ---- */
@media (max-width: 768px) {
  .table-and-search { background: transparent !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  .technicians-section, .invoices-section, .invoices-section > .invoices, .estimates-section, .statements-section { padding: 0 !important; background: transparent !important; }
  .dashboard-body .search input, .dashboard-body .search-box input { height: 44px; border-radius: 10px; background: rgba(118, 118, 128, .12); border: 0; font-size: 17px; }
}
@media (max-width: 768px) {
  .technicians-section .table-container, .invoices-section .table-container { background: transparent !important; padding: 0 !important; }
}

/* ---- Map app chooser (all widths) ---- */
.mapc-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.38); opacity: 0; pointer-events: none; transition: opacity .2s; }
.mapc { position: fixed; left: 50%; bottom: 0; z-index: 91; width: 100%; max-width: 480px; transform: translate(-50%, 100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; }
body.mapc-open .mapc-backdrop { opacity: 1; pointer-events: auto; }
body.mapc-open .mapc { transform: translate(-50%, 0); }
.mapc-group { background: rgba(255,255,255,.96); border-radius: 14px; overflow: hidden; }
.mapc-title { padding: 12px 16px 8px; font-size: 13px; color: #6E6E73; text-align: center; border-bottom: .5px solid rgba(60,60,67,.18); }
.mapc-title b { display: block; color: #1C1C1E; font-size: 15px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapc-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px; border: 0; background: none;
  font: inherit; font-size: 19px; color: #0A66C2; cursor: pointer; text-decoration: none !important; }
.mapc-row + .mapc-row { border-top: .5px solid rgba(60,60,67,.18); }
.mapc-row:active { background: #E5E5EA; }
.mapc-row ion-icon { font-size: 22px; }
.mapc-cancel { margin-top: 8px; font-weight: 600; border-radius: 14px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .mapc, .mapc-backdrop { transition: none; } }

/* ---- Push permission prompt (all widths) ---- */
.pushp { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: 12px; max-width: 440px; margin: 0 auto;
  background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 14px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; display: none; }
.pushp.show { display: block; }
.pushp-head { display: flex; align-items: flex-start; gap: 12px; }
.pushp-icon { width: 40px; height: 40px; border-radius: 10px; background: #FFF3D6; color: #A86600; display: flex; align-items: center; justify-content: center; flex: none; }
.pushp-icon ion-icon { font-size: 22px; }
.pushp b { display: block; font-size: 15px; font-weight: 600; color: #1C1C1E; }
.pushp p { margin: 2px 0 0; font-size: 13px; color: #6E6E73; line-height: 1.35; }
.pushp-btns { display: flex; gap: 8px; margin-top: 12px; }
.pushp-btn { flex: 1; min-height: 40px; border: 0; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; }
.pushp-btn.primary { background: #F8A809; color: #3A2A00; }
.pushp-btn.secondary { background: #F2F2F7; color: #1C1C1E; }
.pushp.ok .pushp-icon { background: #E8F8EE; color: #16a34a; }
@media (max-width: 768px) { .pushp { bottom: calc(var(--app-tab-h) + env(safe-area-inset-bottom) + 10px); } }
@media (min-width: 769px) { .pushp { left: auto; right: 24px; bottom: 24px; } }

/* ---------- mobile: full-bleed map with floating controls ---------- */
@media (max-width: 768px) {
  body.m-page-map .dashboard-body > *:not(.sidebar) { padding: 0 !important; }
  body.m-page-map .m-search-slot { display: none; }

  .map-section .tittle,
  .map-section .filters,
  .map-section .map-summary { display: none !important; }

  .map-section, .map-section .map-container { padding: 0 !important; margin: 0 !important; }

  #leafletMap {
    height: calc(100vh - var(--app-top-h) - var(--app-tab-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    border: 0 !important; border-radius: 0 !important;
  }

  /* filter chips floating over the map */
  .mp-chips {
    position: fixed; top: calc(var(--app-top-h) + env(safe-area-inset-top) + 8px); left: 0; right: 0; z-index: 20;
    display: flex; gap: 8px; padding: 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mp-chips::-webkit-scrollbar { display: none; }
  .mp-chip {
    flex: none; border: 0; border-radius: 999px; padding: 0 14px; min-height: 34px;
    background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(0,0,0,.14);
    font: inherit; font-size: 14px; font-weight: 600; color: #1C1C1E; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  .mp-chip.on { background: #F8A809; color: #3A2A00; }
  .mp-chip ion-icon { font-size: 16px; }
  .mp-count {
    position: fixed; left: 12px; bottom: calc(var(--app-tab-h) + env(safe-area-inset-bottom) + 12px); z-index: 20;
    background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(0,0,0,.14);
    border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: #1C1C1E;
  }
  .mp-locate {
    position: fixed; right: 12px; bottom: calc(var(--app-tab-h) + env(safe-area-inset-bottom) + 12px); z-index: 20;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(0,0,0,.14);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #A86600;
  }
  .mp-locate ion-icon { font-size: 22px; }

  /* job sheet */
  .mp-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 75;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18);
    transform: translateY(105%); transition: transform .3s cubic-bezier(.32,.72,0,1);
    padding: 6px 16px calc(14px + var(--app-tab-h) + env(safe-area-inset-bottom));
  }
  body.mp-sheet-open .mp-sheet { transform: none; }
  .mp-grab { width: 36px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 6px auto 12px; }
  .mp-top { display: flex; align-items: center; gap: 10px; }
  .mp-name { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mp-pill { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
  .mp-meta { margin-top: 6px; font-size: 15px; color: #6E6E73; line-height: 1.4; }
  .mp-meta .row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
  .mp-meta ion-icon { font-size: 16px; color: #8E8E93; flex: none; }
  .mp-acts { display: flex; gap: 8px; margin-top: 14px; }
  .mp-act {
    flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: #F2F2F7; color: #A86600;
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .mp-act ion-icon { font-size: 19px; }
  .mp-act:active { background: #E5E5EA; }
  .mp-act.primary { background: #F8A809; color: #3A2A00; }

  /* filter sheet */
  .mp-fsheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 76;
    background: #F2F2F7; border-radius: 16px 16px 0 0;
    transform: translateY(105%); transition: transform .3s cubic-bezier(.32,.72,0,1);
    padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
  }
  body.mp-filters-open .mp-fsheet { transform: none; }
  .mp-fsheet h3 { margin: 4px 0 12px; font-size: 17px; font-weight: 700; text-align: center; }
  .mp-field { background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
  .mp-field label { display: block; font-size: 12px; color: #8E8E93; margin-bottom: 4px; font-weight: 600; }
  .mp-field select, .mp-field input[type=date] { width: 100%; border: 0; background: none; font: inherit; font-size: 16px; min-height: 30px; padding: 0; }
  .mp-frow { display: flex; gap: 10px; }
  .mp-frow .mp-field { flex: 1; }
  .mp-backdrop { position: fixed; inset: 0; z-index: 74; background: rgba(0,0,0,.34); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.mp-sheet-open .mp-backdrop, body.mp-filters-open .mp-backdrop { opacity: 1; pointer-events: auto; }

  @media (prefers-reduced-motion: reduce) { .mp-sheet, .mp-fsheet, .mp-backdrop { transition: none; } }
}
@media (max-width: 768px) {
  /* the map page owns its bottom edge (count pill, locate, job sheet) */
  body.m-page-map .pushp { display: none !important; }
}

/* ---------- Orders: compact filter chips instead of 5 stacked controls ---------- */
@media (max-width: 768px) {
  body.m-page-orders .details-info { display: none !important; }
  body.m-page-orders .search-and-details { gap: 8px !important; }

  .mp-chips.inline {
    position: static; padding: 0; margin: 0 0 2px; gap: 8px;
  }
  .mp-chips.inline .mp-chip {
    background: #fff; box-shadow: none; border: 1px solid rgba(60,60,67,.12);
    min-height: 36px;
  }
  .mp-chips.inline .mp-chip.on { background: #F8A809; color: #3A2A00; border-color: #F8A809; }
  .of-active { font-size: 13px; color: var(--app-secondary); padding: 2px 2px 0; }
}

@media (max-width: 768px) {
  .mp-chips { display: flex; }
  .mp-count, .mp-sheet, .mp-fsheet, .mp-backdrop, .of-active { display: block; }
  .mp-locate { display: inline-flex; }
}

/* ---------- Estimates: cards instead of a 9-column table ---------- */
.est-cards { display: none; }
@media (max-width: 768px) {
  body.m-page-estimate .table-container { display: none !important; }
  body.m-page-estimate .details-info { display: none !important; }
  body.m-page-estimate .search-and-details { gap: 8px !important; }
  body.m-page-estimate .title h1 { font-size: 28px !important; font-weight: 700 !important; letter-spacing: -.4px; }

  .est-cards { display: flex; flex-direction: column; gap: 10px; }
  .est-card {
    display: block; background: #fff; border-radius: 14px; padding: 14px 16px;
    color: #1C1C1E; text-decoration: none !important;
  }
  .est-card:active { background: #F2F2F7; }
  .ec-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .ec-id { font-size: 15px; font-weight: 700; color: #A86600; }
  .ec-svc { margin-top: 6px; font-size: 16px; font-weight: 600; line-height: 1.3; }
  .ec-total { margin-top: 8px; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
  .ec-sub { margin-top: 4px; font-size: 13px; color: #6E6E73; }
  .ec-date { margin-top: 6px; font-size: 12px; color: #8E8E93; }
  .est-empty { background: #fff; border-radius: 14px; padding: 30px 16px; text-align: center; color: #8E8E93; }
  .est-card .badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #E5E7EB; color: #374151; }
  .est-card .badge.paid, .est-card .badge.approved { background: #ECFCCB; color: #365314; }
  .est-card .badge.pending, .est-card .badge.draft { background: #FEF3C7; color: #92400E; }
  .est-card .badge.declined, .est-card .badge.void, .est-card .badge.canceled { background: #FEE2E2; color: #991B1B; }
  .est-card .badge.sent, .est-card .badge.partial { background: #DBEAFE; color: #1E3A8A; }
}

/* ---------- Login (phones) ---------- */
@media (max-width: 768px) {
  body.login-page {
    padding-bottom: 0 !important;
    background: var(--app-bg) !important;
    min-height: 100dvh;
  }
  body.login-page .login-section {
    padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px) !important;
    min-height: 100dvh;
    align-items: center !important;
  }
  body.login-page .login-container { max-width: 420px !important; gap: 0 !important; }

  body.login-page .image-container { width: 100% !important; text-align: center; }
  body.login-page .image-div-mobile { display: block !important; margin: 0 auto 22px; }
  body.login-page .image-div-mobile img { width: 190px; height: auto; display: block; margin: 0 auto; }

  /* the page had no heading on phones — give it one */
  body.login-page .form-container .tittle { display: flex !important; margin-bottom: 22px; }
  body.login-page .form-container .tittle h1 { font-size: 30px !important; font-weight: 700 !important; letter-spacing: -.5px; color: var(--app-label) !important; }
  body.login-page .form-container .tittle p { font-size: 15px !important; color: var(--app-secondary) !important; }

  body.login-page .form-container { gap: 0 !important; }
  body.login-page .input-container { gap: 14px !important; }
  body.login-page .input-div input {
    width: 100%; height: 52px; font-size: 16px !important;
    border: 1px solid rgba(60,60,67,.14) !important; border-radius: 12px !important;
    background: #fff !important; padding: 0 16px !important; color: var(--app-label);
  }
  body.login-page .input-div.password input { padding-right: 52px !important; }
  body.login-page .input-div input:focus { outline: none; border-color: var(--app-tint) !important; box-shadow: 0 0 0 4px rgba(248,168,9,.18); }

  body.login-page .form-options { align-items: center; }
  body.login-page .form-options .remember label,
  body.login-page .form-options .forgot a { font-size: 14px; }

  body.login-page .input-container button {
    width: 100%; min-height: 52px; border: 0; border-radius: 12px;
    background: var(--app-tint) !important; color: #3A2A00 !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 17px; font-weight: 700; cursor: pointer;
  }
  body.login-page .input-container button p { color: #3A2A00 !important; font-weight: 700; margin: 0; }
  body.login-page .input-container button svg path { stroke: #3A2A00 !important; }
  body.login-page .input-container button:disabled { opacity: .6; }

  .login-error {
    background: #FFE5E5; color: #991B1B; border-radius: 12px;
    padding: 12px 14px; font-size: 14px; line-height: 1.35; margin-bottom: 14px;
  }
}
.login-error { background:#FFE5E5; color:#991B1B; border-radius:10px; padding:10px 14px; font-size:14px; margin-bottom:12px; }
