/* Mobile shell — Bản 5 UX; active when body.is-mobile-layout (width < 768px) */
#mShell { display: none; }
body.is-mobile-layout { overflow: hidden; -webkit-tap-highlight-color: transparent; }
body.is-mobile-layout .top-nav,
body.is-mobile-layout .app-shell { display: none !important; }
/* Overlay desktop settings/account forms when needed on mobile (e.g. thêm công ty) */
body.is-mobile-layout.app-shell-overlay-open .app-shell {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 260;
  background: #f3f6f4;
  overflow: auto;
}
body.is-mobile-layout.app-shell-overlay-open .app-shell .sidebar,
body.is-mobile-layout.app-shell-overlay-open #mainToolbar,
body.is-mobile-layout.app-shell-overlay-open #loginPanel,
body.is-mobile-layout.app-shell-overlay-open #lookupSearchPanel,
body.is-mobile-layout.app-shell-overlay-open #resultsPanel,
body.is-mobile-layout.app-shell-overlay-open #detailListPanel,
body.is-mobile-layout.app-shell-overlay-open #detailPanel,
body.is-mobile-layout.app-shell-overlay-open #emptyResultsState,
body.is-mobile-layout.app-shell-overlay-open #listPageToolbar,
body.is-mobile-layout.app-shell-overlay-open #searchStatus,
body.is-mobile-layout.app-shell-overlay-open #tctSessionBanner {
  display: none !important;
}
body.is-mobile-layout.app-shell-overlay-open #mShell {
  display: none !important;
}
body.is-mobile-layout #mShell {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  position: relative;
  overflow: hidden;
  --shadow: 0 6px 18px rgba(26, 43, 36, 0.06);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
}
body.is-mobile-layout .modal { z-index: 400; }
body.is-mobile-layout .modal.features-modal:not(.hidden) {
  display: grid !important;
  place-items: end center;
  align-items: end;
  padding: 0;
  z-index: 420;
}
body.is-mobile-layout .modal.features-modal .modal-panel {
  width: 100%;
  max-width: 480px;
  max-height: min(90dvh, 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px 18px 0 0;
  margin: 0 auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 28px rgba(26, 43, 36, 0.18);
}
body.is-mobile-layout .modal.features-modal .modal-head {
  flex-wrap: wrap;
  gap: 0.5rem;
}
body.is-mobile-layout .modal.features-modal .modal-head .secondary {
  min-height: 40px;
  padding: 0.4rem 0.75rem;
}
body.is-mobile-layout .modal.features-modal .actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
body.is-mobile-layout .modal.features-modal .actions button {
  width: 100%;
  min-height: 48px;
  border-radius: 11px;
}
#mShell .m-login-links {
  display: none;
  margin-top: 0.75rem;
  gap: 0.45rem;
}
#mShell .m-login-links.show {
  display: grid;
}
#mShell .m-login-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: #e8f5ef;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}
#mShell .m-login-links a.muted {
  background: #eef2f0;
  color: var(--muted);
  font-weight: 650;
}
#mShell .login-card.is-pending-signup {
  border-color: #c5e4d4;
}
#mShell.is-login .bottom-nav,
    #mShell.is-detail .bottom-nav { display: none; }

    
    

    #mShell .screen-scroll {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 0 0.85rem 0.85rem;
    }

    #mShell .screen { display: none; animation: fadeIn 0.22s ease; }
    #mShell .screen.active { display: block; }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: none; }
    }

    #mShell .top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.75rem 0 0.35rem;
    }
    #mShell .top-bar h1 {
      margin: 0;
      font-size: 1.12rem;
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    #mShell .top-bar.with-back { justify-content: flex-start; gap: 0.55rem; }
    #mShell .top-bar.with-back h1 { flex: 1; font-size: 1.05rem; }
    #mShell .btn-back {
      flex: 0 0 auto;
      border: 0;
      background: #e8efeb;
      color: var(--ink);
      font: inherit;
      font-weight: 700;
      font-size: 0.82rem;
      padding: 0.45rem 0.7rem;
      border-radius: 10px;
      cursor: pointer;
    }
    #mShell .count-pill {
      flex: 0 0 auto;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--accent);
      background: #e8f5ef;
      padding: 0.35rem 0.65rem;
      border-radius: 999px;
    }

    #mShell .search-card, .panel-card, .login-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 0.85rem 0.95rem;
      margin-bottom: 0.75rem;
    }
    #mShell .search-card .row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.55rem;
    }
    #mShell .field { margin-bottom: 0.65rem; }
    #mShell .field:last-child { margin-bottom: 0; }
    #mShell .field label {
      display: block;
      font-size: 0.75rem;
      font-weight: 650;
      color: var(--muted);
      margin-bottom: 0.28rem;
    }
    #mShell .field input,
    #mShell .field select {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 0.62rem 0.75rem;
      font: inherit;
      font-size: 0.92rem;
      color: var(--ink);
      background: #fff;
    }
    #mShell .field input:focus,
    #mShell .field select:focus {
      outline: 2px solid rgba(15, 107, 76, 0.25);
      border-color: var(--accent);
    }
    #mShell .btn-primary,
    #mShell .btn-secondary,
    #mShell .btn-danger {
      border: 0;
      border-radius: 11px;
      font: inherit;
      font-weight: 700;
      font-size: 0.92rem;
      padding: 0.72rem 1rem;
      cursor: pointer;
      width: 100%;
    }
    #mShell .btn-primary { background: var(--accent); color: #fff; }
    #mShell .btn-primary:active { background: var(--accent-2); }
    #mShell .btn-secondary { background: #e8efeb; color: var(--ink); }
    #mShell .btn-danger { background: #fdecea; color: var(--danger); }
    #mShell .btn-row {
      display: grid;
      grid-template-columns: 1fr 1.2fr;
      gap: 0.5rem;
      margin-top: 0.15rem;
    }
    #mShell .btn-row-equal { grid-template-columns: 1fr 1fr; }

    #mShell .dir-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.35rem;
      background: #e8efeb;
      padding: 0.28rem;
      border-radius: 12px;
      margin-bottom: 0.75rem;
    }
    #mShell .dir-tabs button {
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--muted);
      padding: 0.55rem 0.4rem;
      border-radius: 9px;
      cursor: pointer;
    }
    #mShell .dir-tabs button.active {
      background: #fff;
      color: var(--accent);
      box-shadow: 0 1px 4px rgba(26, 43, 36, 0.08);
    }

    #mShell .filter-row {
      display: flex;
      gap: 0.4rem;
      padding: 0 0 0.7rem;
      overflow-x: auto;
      scrollbar-width: none;
    }
    #mShell .filter-row::-webkit-scrollbar { display: none; }
    #mShell .chip {
      flex: 0 0 auto;
      border: 1px solid var(--line);
      background: var(--panel);
      color: var(--muted);
      font: inherit;
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.4rem 0.75rem;
      border-radius: 999px;
      cursor: pointer;
    }
    #mShell .chip.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }

    #mShell .list { display: flex; flex-direction: column; gap: 0.65rem; }
    #mShell .inv-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 0.85rem 0.95rem;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 0.28rem 0.7rem;
      cursor: pointer;
      text-align: left;
      font: inherit;
      color: inherit;
      width: 100%;
    }
    #mShell .inv-card:active { transform: scale(0.985); border-color: #b7d0c4; }
    #mShell .inv-no { font-size: 1.02rem; font-weight: 760; line-height: 1.25; }
    #mShell .inv-no span { color: var(--muted); font-weight: 600; font-size: 0.8rem; margin-right: 0.2rem; }
    #mShell .inv-status { align-self: start; max-width: 9.2rem; text-align: right; }
    #mShell .inv-meta {
      grid-column: 1 / -1;
      font-size: 0.78rem;
      color: var(--muted);
      font-weight: 500;
      line-height: 1.4;
    }
    #mShell .inv-meta strong { color: var(--ink); font-weight: 650; }
    #mShell .inv-partner {
      grid-column: 1 / -1;
      font-size: 0.84rem;
      font-weight: 650;
      line-height: 1.35;
      margin-top: 0.1rem;
    }
    #mShell .inv-cqt {
      grid-column: 1 / -1;
      margin-top: 0.15rem;
    }
    #mShell .inv-cqt .lab {
      display: block;
      font-size: 0.7rem;
      color: var(--muted);
      font-weight: 650;
      margin-bottom: 0.22rem;
    }
    #mShell .inv-amount {
      grid-column: 1 / -1;
      margin-top: 0.35rem;
      padding-top: 0.5rem;
      border-top: 1px dashed var(--line);
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.5rem;
    }
    #mShell .inv-amount .label { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
    #mShell .inv-amount .value {
      font-size: 1.05rem;
      font-weight: 780;
      color: var(--accent);
      font-variant-numeric: tabular-nums;
    }

    #mShell .invoice-status-badge {
      display: inline-block;
      padding: 0.2rem 0.5rem;
      border-radius: 999px;
      font-size: 0.68rem;
      font-weight: 700;
      line-height: 1.3;
      text-align: center;
    }
    #mShell .invoice-status-badge.s1 { background: #dcfce7; color: #166534; }
    #mShell .invoice-status-badge.s2 { background: #dbeafe; color: #1e40af; }
    #mShell .invoice-status-badge.s3 { background: #f3e8ff; color: #6b21a8; }
    #mShell .invoice-status-badge.s4 { background: #fee2e2; color: #991b1b; }
    #mShell .invoice-status-badge.s5 { background: #e5e7eb; color: #374151; }
    #mShell .invoice-status-badge.s6 { background: #fef3c7; color: #92400e; }

    #mShell .cqt-status-badge {
      display: inline-block;
      padding: 0.22rem 0.55rem;
      border-radius: 10px;
      font-size: 0.7rem;
      font-weight: 700;
      line-height: 1.3;
      text-align: left;
      max-width: 100%;
    }
    #mShell .cqt-status-badge.cqt0 { background: #dbeafe; color: #1d4ed8; }
    #mShell .cqt-status-badge.cqt1 { background: #fef3c7; color: #92400e; }
    #mShell .cqt-status-badge.cqt2 { background: #fee2e2; color: #b91c1c; }
    #mShell .cqt-status-badge.cqt3 { background: #dcfce7; color: #166534; }
    #mShell .cqt-status-badge.cqt4 { background: #ffedd5; color: #9a3412; }
    #mShell .cqt-status-badge.cqt5 { background: #dcfce7; color: #15803d; }
    #mShell .cqt-status-badge.cqt6 { background: #e0e7ff; color: #3730a3; }
    #mShell .cqt-status-badge.cqt7 { background: #e5e7eb; color: #374151; }
    #mShell .cqt-status-badge.cqt8 { background: #ccfbf1; color: #0f766e; }
    #mShell .cqt-status-badge.cqt-other { background: #f3f4f6; color: #4b5563; }

    #mShell .empty {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--muted);
      font-size: 0.88rem;
    }
    #mShell .toast {
      margin-top: 0.55rem;
      padding: 0.55rem 0.7rem;
      border-radius: 10px;
      background: #e8f5ef;
      color: var(--accent);
      font-size: 0.8rem;
      font-weight: 650;
      display: none;
    }
    #mShell .toast.show { display: block; }
    #mShell .toast.warn { background: #fff7ed; color: #9a3412; }

    #mShell .panel-card h2 {
      margin: 0 0 0.25rem;
      font-size: 0.95rem;
      font-weight: 750;
    }
    #mShell .panel-card .note {
      margin: 0 0 0.75rem;
      font-size: 0.78rem;
      color: var(--muted);
      line-height: 1.4;
    }

    #mShell .company-chip {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.7rem 0.75rem;
      border: 1px solid var(--line);
      border-radius: 12px;
      margin-bottom: 0.5rem;
      background: #f8fbf9;
      width: 100%;
      text-align: left;
      font: inherit;
      cursor: pointer;
    }
    #mShell .company-chip.active { border-color: var(--accent); background: #e8f5ef; }
    #mShell .company-avatar {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: var(--accent);
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 800;
      font-size: 0.85rem;
      flex: 0 0 auto;
    }
    #mShell .company-meta { min-width: 0; flex: 1; }
    #mShell .company-meta .name {
      font-weight: 700;
      font-size: 0.88rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #mShell .company-meta .mst { font-size: 0.75rem; color: var(--muted); margin-top: 0.1rem; }
    #mShell .company-check { color: var(--accent); font-weight: 800; font-size: 1rem; opacity: 0; }
    #mShell .company-chip.active .company-check { opacity: 1; }

    #mShell .quota-box {
      background: linear-gradient(135deg, #e8f5ef, #f4faf7);
      border: 1px solid #c5e4d4;
      border-radius: 12px;
      padding: 0.85rem 0.95rem;
      margin-bottom: 0.85rem;
    }
    #mShell .quota-box .label { font-size: 0.75rem; color: var(--muted); font-weight: 650; }
    #mShell .quota-box .value {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--accent);
      margin: 0.2rem 0;
    }
    #mShell .quota-box .detail { font-size: 0.75rem; color: var(--muted); }
    #mShell .user-head {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 0.85rem;
    }
    #mShell .user-avatar {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: var(--accent);
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 800;
      font-size: 1.1rem;
    }
    #mShell .user-head .name { font-weight: 750; font-size: 1rem; }
    #mShell .user-head .sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

    #mShell .role-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.35rem;
      margin-top: 0.65rem;
    }
    #mShell .role-tabs button {
      border: 1px solid var(--line);
      background: #fff;
      border-radius: 10px;
      padding: 0.55rem 0.4rem;
      font: inherit;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
    }
    #mShell .role-tabs button.active {
      border-color: var(--accent);
      background: #e8f5ef;
      color: var(--accent);
    }

    #mShell .logout-hero { text-align: center; padding: 1.5rem 0.5rem 0.5rem; }
    #mShell .logout-icon {
      width: 64px;
      height: 64px;
      margin: 0 auto 0.85rem;
      border-radius: 18px;
      background: #fdecea;
      color: var(--danger);
      display: grid;
      place-items: center;
    }
    #mShell .logout-hero h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
    #mShell .logout-hero p {
      margin: 0;
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.45;
    }
    #mShell .logout-actions { display: grid; gap: 0.55rem; margin-top: 1.25rem; }

    #mShell .login-brand { text-align: center; padding: 1.1rem 0 0.35rem; }
    #mShell .login-brand .logo {
      width: 56px;
      height: 56px;
      margin: 0 auto 0.65rem;
      border-radius: 16px;
      background: var(--accent);
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 900;
      font-size: 1.15rem;
    }
    #mShell .login-brand h1 { margin: 0; font-size: 1.2rem; font-weight: 780; }
    #mShell .login-brand p {
      margin: 0.35rem 0 0;
      font-size: 0.82rem;
      color: var(--muted);
      line-height: 1.4;
    }
    #mShell .captcha-row {
      display: grid;
      grid-template-columns: 110px 1fr;
      gap: 0.55rem;
      align-items: end;
    }
    #mShell .captcha-box {
      height: 44px;
      border-radius: 10px;
      border: 1px dashed #b7d0c4;
      background:
        repeating-linear-gradient(-45deg, #e8f5ef, #e8f5ef 6px, #f4faf7 6px, #f4faf7 12px);
      display: grid;
      place-items: center;
      font-weight: 800;
      font-size: 1.05rem;
      letter-spacing: 0.18em;
      color: var(--accent);
      user-select: none;
      cursor: pointer;
    }
    #mShell .hint-list {
      margin: 0 0 0.85rem;
      padding-left: 1.1rem;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.45;
    }

    /* Detail */
    #mShell .kv-grid {
      display: grid;
      gap: 0.45rem 0.75rem;
    }
    #mShell .kv-row {
      display: grid;
      grid-template-columns: 38% 1fr;
      gap: 0.4rem;
      font-size: 0.84rem;
      line-height: 1.35;
    }
    #mShell .kv-row .k { color: var(--muted); font-weight: 600; }
    #mShell .kv-row .v { font-weight: 650; word-break: break-word; }

    #mShell .sum-tags {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
    }
    #mShell .sum-tag {
      border-radius: 12px;
      padding: 0.7rem 0.85rem;
      border: 1px solid var(--line);
      background: var(--panel);
      box-shadow: var(--shadow);
    }
    #mShell .sum-tag .lab {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.02em;
    }
    #mShell .sum-tag .val {
      margin-top: 0.2rem;
      font-size: 1.12rem;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
    }
    #mShell .sum-tag.pay { border-color: #c5e4d4; background: linear-gradient(135deg, #e8f5ef, #f4faf7); }
    #mShell .sum-tag.pay .val { color: var(--accent); }
    #mShell .sum-tag.tax { border-color: #bfdbfe; background: #eff6ff; }
    #mShell .sum-tag.tax .val { color: #1d4ed8; }
    #mShell .sum-tag.disc { border-color: #fcd34d; background: #fffbeb; }
    #mShell .sum-tag.disc .val { color: #92400e; }

    #mShell .section-label {
      margin: 0.35rem 0 0.55rem;
      font-size: 0.8rem;
      font-weight: 750;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    #mShell .line-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 0.75rem 0.85rem;
      margin-bottom: 0.55rem;
    }
    #mShell .line-card .line-top {
      display: flex;
      justify-content: space-between;
      gap: 0.5rem;
      align-items: flex-start;
    }
    #mShell .line-card .line-name {
      font-weight: 720;
      font-size: 0.9rem;
      line-height: 1.35;
      flex: 1;
    }
    #mShell .line-card .line-stt {
      flex: 0 0 auto;
      font-size: 0.7rem;
      font-weight: 800;
      color: var(--accent);
      background: #e8f5ef;
      padding: 0.18rem 0.45rem;
      border-radius: 999px;
    }
    #mShell .line-card .line-grid {
      margin-top: 0.55rem;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.35rem 0.65rem;
      padding-top: 0.5rem;
      border-top: 1px dashed var(--line);
    }
    #mShell .line-card .cell .lab {
      display: block;
      font-size: 0.68rem;
      color: var(--muted);
      font-weight: 600;
    }
    #mShell .line-card .cell .val {
      font-size: 0.86rem;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      margin-top: 0.08rem;
    }
    #mShell .line-card .cell.full { grid-column: 1 / -1; }

    #mShell .modal {
      position: absolute;
      inset: 0;
      z-index: 80;
      display: none;
      align-items: flex-end;
      justify-content: center;
    }
    #mShell .modal.open { display: flex; }
    #mShell .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(26, 43, 36, 0.45);
    }
    #mShell .modal-sheet {
      position: relative;
      width: 100%;
      max-height: 88%;
      overflow-y: auto;
      background: #fff;
      border-radius: 18px 18px 0 0;
      padding: 1rem 1rem calc(1rem + var(--safe-b));
      box-shadow: 0 -8px 28px rgba(26, 43, 36, 0.18);
      animation: sheetUp 0.22s ease;
    }
    @keyframes sheetUp {
      from { transform: translateY(24px); opacity: 0.6; }
      to { transform: none; opacity: 1; }
    }
    #mShell .modal-sheet h3 { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 780; }
    #mShell .modal-sheet .modal-note {
      margin: 0 0 0.85rem;
      font-size: 0.82rem;
      color: var(--muted);
      line-height: 1.45;
    }
    #mShell .modal-actions { display: grid; gap: 0.5rem; margin-top: 0.85rem; }

    #mShell .bottom-nav {
      position: relative;
      flex: 0 0 auto;
      height: calc(var(--nav-h) + var(--safe-b));
      padding: 0.35rem 0.35rem calc(0.35rem + var(--safe-b));
      background: rgba(255, 255, 255, 0.98);
      backdrop-filter: blur(10px);
      border-top: 1px solid var(--line);
      box-shadow: 0 -4px 16px rgba(26, 43, 36, 0.06);
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.15rem;
      z-index: 50;
    }
    #mShell .nav-item {
      border: 0;
      background: transparent;
      color: var(--muted);
      font: inherit;
      font-size: 0.68rem;
      font-weight: 650;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.18rem;
      padding: 0.25rem 0.15rem;
      border-radius: 10px;
      cursor: pointer;
      min-width: 0;
    }
    #mShell .nav-item svg {
      width: 22px;
      height: 22px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    #mShell .nav-item.active { color: var(--accent); background: #e8f5ef; }
    #mShell .nav-item.nav-logout:not(.active) { color: #a35a5a; }
    #mShell .nav-item span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    @media (min-width: 520px) {
      
      #mShell .modal-sheet { border-radius: 18px; margin: 0 0.75rem 0.75rem; max-height: 80%; }
      #mShell .modal { align-items: center; }
      #mShell .sum-tags { grid-template-columns: 1fr 1fr 1fr; }
    }
#mShell .m-captcha-view {
  height: 44px; border-radius: 10px; border: 1px dashed #b7d0c4; background: #f4faf7;
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
}
#mShell .m-captcha-view svg, #mShell .m-captcha-view img { max-width: 100%; max-height: 42px; display: block; }
#mShell .m-status { margin-top: 0.55rem; padding: 0.55rem 0.7rem; border-radius: 10px; font-size: 0.8rem; font-weight: 650; display: none; }
#mShell .m-status.show { display: block; }
#mShell .m-status.ok { background: #e8f5ef; color: var(--accent); }
#mShell .m-status.err, #mShell .m-status.warn { background: #fff7ed; color: #9a3412; }
#mShell .invoice-status-badge.unknown, #mShell .cqt-status-badge.cqt-other { background: #f3f4f6; color: #4b5563; }
#mShell .m-detail-full { margin-top: 0.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#mShell .hidden { display: none !important; }
#mShell .m-login-agency { margin-bottom: 0.65rem; }
#mShell .m-ov-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.15rem 0 0.65rem;
}
#mShell .m-ov-kpis .m-ov-kpi:nth-child(5) {
  grid-column: 1 / -1;
}
#mShell .m-ov-kpi {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 1px 2px rgba(26, 43, 36, 0.04);
}
#mShell .m-ov-kpi span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 0.15rem;
}
#mShell .m-ov-kpi strong {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 750;
}
#mShell .m-ov-recent {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#mShell .m-ov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid #e2ebe5;
  border-radius: 10px;
  background: #f7faf8;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}
#mShell .m-ov-row strong { display: block; font-size: 0.84rem; color: var(--text); }
#mShell .m-ov-row span { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 0.1rem; }
#mShell .m-ov-row em { font-style: normal; font-weight: 700; font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
@media (min-width: 520px) and (max-width: 767px) {
  body.is-mobile-layout #mShell {
    margin-top: 1rem; margin-bottom: 1rem; height: calc(100dvh - 2rem);
    border: 1px solid var(--line); border-radius: 18px;
    background: rgba(255, 255, 255, 0.35); box-shadow: 0 12px 40px rgba(26, 43, 36, 0.08);
  }
}
