/*
  BMC Mobile Styles - Consolidated
*/
.mobile-appbar{
  display:none;
}
@media(max-width:900px){
  .mobile-appbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    position:sticky;
    top:0;
    z-index:70;
    min-height:58px;
    padding:10px 14px;
    background:#0b3d2b;
    color:#fff;
  }
  .mobile-menu-btn{
    border:0;
    background:rgba(255,255,255,.12);
    border-radius:12px;
    padding:8px;
  }
  .mobile-menu-btn span{
    display:block;
    width:22px;
    height:3px;
    margin:4px 0;
    border-radius:999px;
    background:#fff;
  }
}

/* BMC Mobile App Experience */
.mobile-appbar,
.mobile-bottom-nav,
.mobile-drawer-backdrop{
  display:none;
}

@media(max-width: 820px){
  html,body{
    min-height:100%;
    overscroll-behavior-y:contain;
    -webkit-tap-highlight-color:transparent;
  }

  body.app-body{
    background:#eef8f2;
    padding-top:calc(66px + env(safe-area-inset-top));
    padding-bottom:calc(76px + env(safe-area-inset-bottom));
  }

  .mobile-appbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:2100;
    display:flex;
    align-items:center;
    gap:12px;
    height:calc(66px + env(safe-area-inset-top));
    padding:calc(10px + env(safe-area-inset-top)) 14px 10px;
    background:linear-gradient(135deg,#0f5132,#0b3524);
    color:#fff;
    box-shadow:0 12px 30px rgba(4,34,22,.18);
  }

  .mobile-menu-btn{
    width:44px;
    height:44px;
    flex:0 0 auto;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    border:0;
    border-radius:15px;
    background:rgba(255,255,255,.14);
    padding:11px;
  }

  .mobile-menu-btn span{
    display:block;
    height:2px;
    background:#fff;
    border-radius:999px;
  }

  .mobile-app-title{
    min-width:0;
    flex:1;
  }

  .mobile-app-title strong{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:15px;
    line-height:1.2;
  }

  .mobile-app-title small{
    display:block;
    opacity:.75;
    font-size:11px;
    margin-top:2px;
  }

  .mobile-avatar{
    width:40px;
    height:40px;
    border-radius:15px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.18);
    color:#fff;
    font-weight:900;
  }

  .mobile-drawer-backdrop{
    position:fixed;
    inset:0;
    z-index:2190;
    display:block;
    background:rgba(8,28,20,.45);
    backdrop-filter:blur(3px);
  }

  .mobile-drawer-backdrop[hidden]{
    display:none !important;
  }

  .app-shell{
    display:block !important;
    min-height:auto;
  }

  .app-sidebar{
    position:fixed !important;
    top:0;
    bottom:0;
    left:0;
    width:min(82vw,320px) !important;
    max-width:320px;
    z-index:2200;
    overflow-y:auto;
    transform:translateX(-105%);
    transition:transform .25s ease;
    padding-top:calc(18px + env(safe-area-inset-top));
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
    box-shadow:18px 0 40px rgba(0,0,0,.22);
  }

  body.mobile-drawer-open .app-sidebar{
    transform:translateX(0);
  }

  .app-brand{
    padding-bottom:16px;
  }

  .app-nav{
    grid-template-columns:1fr !important;
  }

  .app-nav a{
    min-height:46px;
    display:flex;
    align-items:center;
    font-size:15px;
  }

  .app-nav a:before{
    content:attr(data-nav-icon);
    width:28px;
    height:28px;
    margin-right:10px;
    border-radius:10px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.12);
    color:#fff;
    font-size:12px;
    text-transform:uppercase;
  }

  .app-main{
    padding:14px !important;
    min-width:0;
  }

  .app-topbar{
    display:none !important;
  }

  .card{
    border-radius:22px !important;
    padding:17px !important;
    margin-bottom:14px !important;
    box-shadow:0 8px 24px rgba(12,70,48,.07) !important;
  }

  .dashboard-hero,
  .workspace-hero,
  .uc-hero.embedded{
    display:block !important;
  }

  .dashboard-hero h2,
  .workspace-hero h2,
  .uc-hero-copy h2{
    font-size:26px !important;
    line-height:1.15;
  }

  .stats-grid,
  .admin-card-grid,
  .profile-grid,
  .feature-grid,
  .plan-row,
  .uc-hero-metrics,
  .uc-mini-grid,
  .uc-grid-2{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }

  .stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .stat,
  .uc-stat-card,
  .uc-mini-card,
  .workspace-summary article{
    border-radius:18px !important;
    padding:15px !important;
  }

  .stat strong,
  .uc-stat-card strong,
  .uc-mini-card strong{
    font-size:24px !important;
  }

  .module-card,
  .profile-card,
  .feature-card,
  .plan-card{
    border-radius:20px !important;
    padding:18px !important;
  }

  .profile-grid,
  .admin-card-grid,
  .plan-row{
    display:flex !important;
    gap:12px !important;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    padding:3px 2px 12px;
    margin-left:-2px;
    -webkit-overflow-scrolling:touch;
  }

  .profile-grid > *,
  .admin-card-grid > *,
  .plan-row > *{
    min-width:82%;
    scroll-snap-align:start;
  }

  .workspace-summary{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px;
    width:100%;
    margin-top:12px;
  }

  .section-head,
  .uc-panel-head,
  .uc-panel-head.slim{
    display:block !important;
  }

  .section-head .btn,
  .uc-panel-head .btn{
    margin-top:10px;
  }

  .action-row,
  .uc-filter-actions,
  .form-actions{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    width:100%;
    gap:8px;
  }

  .action-row .btn,
  .action-row form,
  .action-row button,
  .form-actions .btn,
  .form-actions button,
  .uc-filter-actions .btn{
    width:100%;
  }

  .form-grid,
  .form-grid.two,
  .form-grid.four,
  .filter-grid,
  .uc-filter-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }

  .form-grid input,
  .form-grid select,
  .filter-grid input,
  .filter-grid select,
  .uc-filter-grid input,
  .uc-filter-grid select{
    min-height:46px;
    font-size:16px;
  }

  .table-wrap,
  .uc-table-wrap{
    border-radius:18px !important;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  table,
  .uc-table{
    min-width:760px;
  }

  th,td{
    padding:12px 10px !important;
  }

  .modal-card,
  .confirm-modal-card{
    width:calc(100vw - 24px) !important;
    max-height:calc(100vh - 40px);
    border-radius:24px !important;
  }

  .modal-backdrop,
  .confirm-modal-backdrop{
    padding:12px;
    align-items:end;
  }

  .confirm-modal-card,
  .modal-card{
    animation:mobileSheetIn .22s ease both;
  }

  @keyframes mobileSheetIn{
    from{transform:translateY(24px);opacity:.75}
    to{transform:translateY(0);opacity:1}
  }

  .mobile-bottom-nav{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:2050;
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:0;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(16px);
    border-top:1px solid var(--line,#d8ebe0);
    box-shadow:0 -12px 30px rgba(4,34,22,.10);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button{
    min-width:0;
    border:0;
    background:transparent;
    color:var(--muted,#5e7469);
    display:grid;
    place-items:center;
    gap:2px;
    padding:6px 2px;
    border-radius:14px;
    font-weight:800;
  }

  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav button:hover{
    background:var(--primary-soft,#e8f7ef);
    color:var(--primary,#147a52);
  }

  .mobile-bottom-nav span{
    font-size:19px;
    line-height:1;
  }

  .mobile-bottom-nav small{
    font-size:10px;
    line-height:1;
  }

  .uc-file-drop{
    min-height:150px;
  }

  .sidebar-user-card{
    margin-bottom:14px;
  }
}

@media(max-width: 420px){
  .stats-grid{
    grid-template-columns:1fr !important;
  }

  .profile-grid > *,
  .admin-card-grid > *,
  .plan-row > *{
    min-width:88%;
  }

  .mobile-app-title strong{
    max-width:210px;
  }
}
