/* YJG CRM Mobile — mobile-only improvements, no modifications to 2.4 desktop styling */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
button, select, input, textarea { touch-action: manipulation; }
button { min-height: 38px; }
.tablewrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.file { min-width: 0; }
.file span { min-width: 0; }
@media (max-width: 860px) {
  .shell { display: block; min-height: 100dvh; }
  aside { position: fixed !important; z-index: 1002; inset: 0 auto 0 0; width: min(310px, 86vw) !important; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 12px 22px !important; background: #102c4c; transform: translateX(-106%); transition: transform .23s ease; box-shadow: 5px 0 25px #00152d20; }
  aside .nav { display: block !important; width: 100% !important; min-height: 42px; padding: 11px 13px !important; margin: 2px 0 !important; font-size: 14px !important; }
  aside .navgroup { display: block !important; margin-top: 18px; }
  aside .brand { font-size: 16px !important; padding: 12px; }
  body.yjg-nav-open aside { transform: translateX(0); }
  .yjg-nav-backdrop { position: fixed; inset: 0; z-index: 1001; background: #081a2c99; display: none; border: 0; padding: 0; width: 100vw; height: 100dvh; }
  body.yjg-nav-open .yjg-nav-backdrop { display: block; }
  body.yjg-nav-open { overflow: hidden; }
  .main { width: 100%; min-width: 0; }
  .main > header { position: sticky; top: 0; z-index: 50; padding: 10px 12px; gap: 8px; flex-wrap: wrap; background: white; }
  .yjg-mobile-menu { display: inline-flex !important; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border: 1px solid #d4deea; border-radius: 9px; background: #edf3fa; color: #163d5d; font-size: 20px; cursor: pointer; }
  .main > header > div:first-of-type { flex: 1 1 125px; min-width: 0; }
  .main > header > div:first-of-type .muted { display: none; }
  #headTitle { font-size: 15px; }
  .main > header .actions { gap: 5px; flex: 1 0 100%; justify-content: flex-end; }
  .main > header .actions button { padding: 7px 10px; min-height: 36px; }
  #cloudIdentity { overflow: hidden; text-overflow: ellipsis; max-width: 46vw; white-space: nowrap; }
  .content { padding: 12px !important; max-width: 100vw; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px; }
  .card, .panel { padding: 13px; min-width: 0; overflow-wrap: anywhere; }
  .metric { font-size: 21px; }
  .detail, .grid2, .compare { grid-template-columns: 1fr !important; }
  .formgrid { grid-template-columns: 1fr !important; }
  .topline { align-items: flex-start; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .field { max-width: 100%; }
  .modalback { align-items: end; padding: 0; z-index: 1200; }
  .modal { width: 100%; max-height: 94dvh; border-radius: 17px 17px 0 0; padding: 18px 14px max(18px,env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .modal .formgrid label { min-width: 0; }
  .modal input, .modal select, .modal textarea { font-size: 16px; max-width: 100%; }
  .actions { gap: 7px; }
  .file { align-items: start; flex-wrap: wrap; }
}
@media(max-width: 390px) {
  .cards { grid-template-columns: 1fr 1fr !important; }
  .main > header .actions { justify-content: space-between; }
  .main > header .actions button { font-size: 12px; }
}
@media(min-width: 861px) { .yjg-mobile-menu, .yjg-nav-backdrop { display: none !important; } }
@media(prefers-reduced-motion:reduce) { aside { transition: none !important; } }
