/* StayEasy ERP — mobile / small-screen hardening (go-live) */
html{ -webkit-text-size-adjust:100%; }
html, body{ max-width:100%; overflow-x:hidden; }
img, svg, video, canvas{ max-width:100%; height:auto; }
*{ box-sizing:border-box; }

/* Backdrop for admin sidebar drawer */
.se-sidebar-backdrop{
  display:none;
  position:fixed; inset:0;
  background:rgba(8,14,11,.48);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  z-index:90;
}
.se-sidebar-backdrop.is-open{ display:block; }
body.se-nav-open{ overflow:hidden; }

@media (max-width:850px){
  .sidebar{
    z-index:110 !important;
    width:min(288px, 86vw) !important;
    max-width:288px !important;
    min-width:0 !important;
    transform:translateX(-105%);
    transition:transform .28s ease;
    box-shadow:none;
  }
  .sidebar.mobile-open{
    transform:translateX(0) !important;
    box-shadow:18px 0 50px rgba(0,0,0,.28);
  }
  /* Don't let desktop collapse fight the drawer */
  body.sidebar-collapsed .sidebar,
  html.sidebar-collapsed .sidebar,
  .sidebar.is-collapsed{
    width:min(288px, 86vw) !important;
    max-width:288px !important;
    min-width:0 !important;
  }
  body.sidebar-collapsed .main-content,
  html.sidebar-collapsed .main-content,
  .main-content{
    margin-left:0 !important;
    width:100% !important;
  }

  .se-topbar-collapse,
  .se-sidebar-toggle{ display:none !important; }

  .topbar{
    height:58px;
    padding:0 12px 0 10px !important;
    gap:10px;
  }
  .mobile-brand{
    display:flex !important;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
  }
  .mobile-brand img{ width:28px; height:28px; border-radius:8px; object-fit:cover; }
  .mobile-brand b{ font-size:.92rem; }
  .mobile-menu{
    width:40px; height:40px; border-radius:12px;
    border:1px solid rgba(16,40,24,.12);
    background:#fff; font-size:1.15rem; line-height:1;
    display:inline-flex; align-items:center; justify-content:center;
    cursor:pointer; color:#172019;
  }

  .global-search{ width:auto; flex:1; min-width:0; max-width:none; }
  .global-search kbd{ display:none; }

  .top-user-copy, .top-user > span{ display:none !important; }
  .top-actions{ gap:6px; flex:0 0 auto; }

  .content-area{
    padding:16px 12px 40px !important;
    max-width:100%;
  }

  /* Tables: never blow out the page */
  table{ max-width:100%; }
  .fin-table-wrap, .gf-table-wrap, .pv-cards,
  .approve-wrap .fin-table-wrap,
  .table-wrap, .data-table-wrap,
  .join-table-wrap, .notif-list-wrap,
  .inv-table-wrap, .payroll-table-wrap, .people-table-wrap, .doc-table-wrap,
  .se-hscroll, .da-card-body{
    overflow-x:auto; -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    max-width:100%;
    min-width:0;
  }
  .se-hscroll > table,
  .da-card .da-table,
  .se-hscroll > .loans-table{
    min-width:720px;
    width:max-content;
    max-width:none;
  }
  /* Wide admin tables: allow swipe even if ancestors clip page overflow */
  .join-table-wrap{
    display:block;
    width:100%;
    border-radius:16px;
    box-shadow:0 10px 28px rgba(15,23,42,.06);
    overscroll-behavior-x:contain;
  }
  .join-table-wrap .join-table{
    margin:0;
    box-shadow:none;
    border-radius:0;
    min-width:720px; /* force horizontal scroll on ~375px */
  }
  .join-kpis{ grid-template-columns:repeat(2, minmax(0,1fr)) !important; }
  .join-filters{ flex-direction:column; align-items:stretch !important; }
  .join-filters > div{ width:100%; }
  .join-filters input, .join-filters select{ width:100%; min-width:0; }
  .join-hero{ padding:16px !important; }
  .join-hero h1{ font-size:1.35rem !important; }
  .join-hero p{ max-width:none !important; }

  /* Shared premium heroes */
  .fin-hero, .ov-hero, .gf-hero, .pv-hero, .gv-hero{
    flex-direction:column !important;
    align-items:flex-start !important;
    padding:16px 16px !important;
    gap:12px !important;
  }
  .fin-hero h1, .ov-hero h1, .gf-hero h1, .pv-hero h1{ font-size:1.35rem !important; }
  .fin-hero-actions, .ov-hero-actions, .gf-hero-actions, .pv-hero-actions, .gv-actions{
    width:100%;
    display:flex; flex-wrap:wrap; gap:8px;
  }
  .fin-hero-actions .btn, .ov-hero-actions .btn, .gf-hero-actions .btn,
  .pv-hero-actions .btn, .gv-actions .btn{
    flex:0 1 auto; width:auto; max-width:100%;
    min-height:34px; justify-content:center; text-align:center;
  }

  /* KPI / card grids */
  .fin-kpi-grid, .ov-kpi-grid, .accounts-kpis{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }
  .fin-card-grid, .property-performance-grid, .account-cards, .ov-modules{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }
  .accounts-ledger-grid, .pv-layout, .pv-layout.has-form{
    grid-template-columns:1fr !important;
  }
  /* Admin overview: two columns on phones/tablets to cut vertical stack. */
  .ov-grid, .ov-grid.tasks-row, .ov-grid.attn-row{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:10px !important;
  }
  .fin-stat-card{ min-height:0 !important; }
  .accounts-filter-form{ align-items:end; }
  .accounts-filter-form .filter-control{ min-width:0 !important; width:100%; }
  /* Live filters already submit on change. Never stretch a leftover control full width. */
  .accounts-filter-form .btn,
  .accounts-filter-form .af-reset{
    width:auto !important;
    max-width:100%;
    align-self:flex-start;
    flex:0 1 auto;
    min-height:32px;
    height:auto;
    padding:6px 10px;
  }

  .gf-toolbar, .ledger-toolbar, .pv-search{
    flex-direction:column; align-items:stretch !important;
  }
  .gf-toolbar input[type=search], .gf-toolbar select,
  .ledger-toolbar input[type=search], .pv-search input{
    width:100% !important; min-width:0 !important;
  }

  .gv-meta{ grid-template-columns:1fr 1fr !important; }
  .gv-frame, .gv-img-wrap{ height:min(70vh, 560px) !important; min-height:280px !important; }
  .gv-top{ flex-direction:column; align-items:stretch; }
  .gv-actions{ width:100%; }

  .modal-backdrop{ padding:10px !important; align-items:flex-end !important; }
  /* Invoice compose is a full-height sheet. flex-end clips the top of a tall flex child and iOS will not scroll it. */
  .modal-backdrop.ti-compose-backdrop{
    align-items:flex-start !important;
    justify-content:flex-start !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior:contain;
    height:100% !important;
    max-height:100% !important;
  }
  .modal{ max-width:100% !important; margin:0 !important; border-radius:18px 18px 12px 12px !important; }
  .modal .fin-form-grid{ grid-template-columns:1fr !important; padding:0 14px !important; }
  .modal-head, .modal-actions{ padding-left:14px !important; padding-right:14px !important; margin-left:14px !important; margin-right:14px !important; }

  .fin-note{ font-size:.84rem; }
  .page-head, .head-actions, .page-actions{
    display:flex; flex-wrap:wrap; gap:8px;
  }
}

@media (max-width:600px){
  .global-search{ display:flex !important; height:34px !important; min-height:34px !important; border-radius:999px !important; }
  .fin-kpi-grid, .accounts-kpis,
  .fin-card-grid, .property-performance-grid, .account-cards{
    grid-template-columns:1fr !important;
  }
  .ov-kpi-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
  .gv-meta{ grid-template-columns:1fr !important; }
  .content-area{ padding:12px 10px 36px !important; }
  .join-kpis{ grid-template-columns:1fr 1fr !important; }
  .fin-table, .gf-table, .ov-table, .approve-table{ font-size:.82rem; }
  .gf-row-actions{
    flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:6px;
  }
  .gf-row-actions .btn, .gf-row-actions form, .gf-row-actions form .btn{
    width:auto; max-width:100%; flex:0 1 auto;
  }
  .gf-row-actions .btn{
    min-height:32px; padding:6px 10px; font-size:.78rem; line-height:1.2;
  }

  /* Keep notification bell visible (older rule hid it) */
  .top-icon-button{ display:inline-flex !important; }

  /* Beat .topbar .se-notif-panel absolute/right rules so panel stays on-screen */
  .topbar .se-notif-panel,
  .se-notif-panel{
    position:fixed !important;
    left:10px !important; right:10px !important; top:62px !important;
    width:auto !important; max-width:none !important;
    max-height:min(72vh, 560px) !important;
    z-index:220 !important;
    overflow:hidden !important;
    display:flex !important;
    flex-direction:column !important;
  }
  .topbar .se-notif-panel[hidden],
  .se-notif-panel[hidden]{
    display:none !important;
  }
  .topbar .se-notif-head,
  .se-notif-head{
    flex-wrap:wrap !important;
    gap:8px !important;
    flex:0 0 auto !important;
  }
  .se-notif-list{
    flex:1 1 auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  .se-notif-item button{
    padding:14px 16px !important;
  }
  .se-notif-item b{
    font-size:14px !important;
    word-break:break-word !important;
  }
  .se-notif-item span{
    font-size:13px !important;
    word-break:break-word !important;
  }

  /* Join StayEasy portal — same full-width fixed tray as admin (.join-notif != .se-notif) */
  .join-notif-panel{
    position:fixed !important;
    left:10px !important; right:10px !important; top:62px !important;
    width:auto !important; max-width:none !important;
    max-height:min(72vh, 560px) !important;
    z-index:220 !important;
    overflow:hidden !important;
    display:flex !important;
    flex-direction:column !important;
  }
  .join-notif-panel[hidden]{
    display:none !important;
  }
  .join-notif-head{
    flex-wrap:wrap !important;
    gap:8px !important;
    flex:0 0 auto !important;
  }
  .join-notif-list{
    flex:1 1 auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  .join-notif-item button{
    padding:14px 16px !important;
  }
  .join-notif-item b{
    font-size:14px !important;
    word-break:break-word !important;
  }
  .join-notif-item span{
    font-size:13px !important;
    word-break:break-word !important;
  }
  .join-top, .join-nav, .join-notif{
    overflow:visible !important;
  }
  .topbar .se-user-panel,
  .se-user-panel{
    position:fixed !important;
    left:10px !important; right:10px !important; top:62px !important;
    width:auto !important; max-width:none !important;
    z-index:220 !important;
  }
}

@media (max-width:420px){
  .mobile-brand b{ display:none; }
  .fin-hero h1, .ov-hero h1, .gf-hero h1{ font-size:1.22rem !important; }
}
@media (max-width:340px){
  .ov-kpi-grid, .ov-grid, .ov-grid.tasks-row, .ov-grid.attn-row{
    grid-template-columns:1fr !important;
  }
}

/* Safe areas (notched phones) */
@supports (padding: max(0px)){
  @media (max-width:850px){
    .topbar{ padding-left:max(10px, env(safe-area-inset-left)) !important; padding-right:max(12px, env(safe-area-inset-right)) !important; }
    .content-area{ padding-bottom:max(40px, env(safe-area-inset-bottom)) !important; }
    .sidebar{ padding-bottom:max(15px, env(safe-area-inset-bottom)); }
  }
}


/* Employee portal drawer */
@media (max-width:900px){
  .employee-sidebar{
    position:fixed !important;
    inset:0 auto 0 0;
    height:100vh;
    z-index:110;
  }
  .employee-shell,
  .employee-shell .employee-main,
  .employee-main-content,
  .employee-content-wrap{
    margin-left:0 !important;
    width:100% !important;
  }
  .ep-sidebar-toggle{ display:none !important; }
  .employee-topbar{ padding-left:10px; padding-right:10px; }
  .employee-top-sub{ display:none; }
}
@media (max-width:600px){
  .employee-top-title{ font-size:.95rem; }
}

/* Generic admin list/toolbars */
@media (max-width:850px){
  .head-actions .btn, .page-actions .btn, .panel-actions .btn{
    min-height:40px;
  }
  .form-grid, .fin-form-grid, .pv-grid, .gf-grid{
    grid-template-columns:1fr !important;
  }
  /* iOS Safari zooms inputs with computed font-size < 16px and often stays zoomed after blur */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]),
  select,
  textarea{
    font-size:16px !important;
  }
  .btn, button.btn, button:not([type]), button[type="button"], button[type="submit"]{
    font-size:.88rem;
  }
}

/* Also cover 768 breakpoint used by many phones in landscape / large phones */
@media (max-width:768px){
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]),
  select,
  textarea{
    font-size:16px !important;
  }
}

/* Full-page notifications inbox — stack cleanly on phones */
@media (max-width:768px){
  .notif-page{ max-width:100% !important; margin:0 !important; }
  .notif-page .panel-head{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  .notif-page .panel-head form .btn{ width:100%; }
  .notif-item-btn{
    padding:14px 12px !important;
  }
  .notif-item-row{
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:6px !important;
  }
  .notif-item-row small{
    white-space:normal !important;
  }
  .notif-item-title{ font-size:15px !important; word-break:break-word !important; }
  .notif-item-body{ font-size:14px !important; word-break:break-word !important; }
}

/* Employee portal: premium drawer sizing and touch targets */
@media (max-width:900px){
  .employee-sidebar{
    width:min(300px,88vw) !important;
    max-width:300px !important;
    padding-top:max(16px,env(safe-area-inset-top)) !important;
    padding-bottom:max(14px,env(safe-area-inset-bottom)) !important;
    box-shadow:18px 0 50px rgba(10,55,36,.2) !important;
  }
  .employee-page{ padding:22px 16px 36px !important; }
}
@media (max-width:600px){
  .employee-sidebar{ width:min(310px,90vw) !important; max-width:310px !important; }
  .employee-nav a{ min-height:48px; }
  .attendance-submenu .employee-nav-sub{ min-height:42px !important; }
  .employee-page{ padding:18px 13px 32px !important; }
}



/* se_premium_ui companion — ensure base layout no horizontal overflow on key admin pages */
@media (max-width:900px){
  .main-content .content-area,
  .content-area{
    overflow-x:hidden !important;
    max-width:100vw !important;
  }
  table.ti-table, .ti-table, .property-table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    max-width:100%;
  }
}


/* Phone header actions + doc tables + invoice sheet (2026-10-03).
   Loaded from base after page <style> as well, so these beat page !important. */
@media (max-width:850px){
  .fin-hero-actions, .ti-hero-actions, .da-hero-actions, .ov-hero-actions,
  .gf-hero-actions, .pv-hero-actions, .gv-actions, .fd-hero-actions,
  .inv-actions, .inv-hero-actions, .page-actions, .head-actions,
  .people-hero-actions, .payroll-hero-actions, .leave-hero-actions,
  .loans-hero-actions, .ss-hero-actions, .tk-hero-actions, .jp-hero-actions,
  .eh-hero-actions, .cm-hero-actions, .lux-hero-actions, .ac-hero-controls,
  .employee-form-actions, .ti-m__actions, .ti-m__row-actions, .gf-row-actions, .ti-filters,
  .em-actions, .fin-lux-actions, .modal-actions, .ti-actions, .da-actions{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:6px !important;
    width:100% !important;
    max-width:100% !important;
  }
  .fin-hero-actions .btn, .fin-hero-actions a.btn,
  .ti-hero-actions .btn, .ti-hero-actions a.btn,
  .ov-hero-actions .btn, .gf-hero-actions .btn, .pv-hero-actions .btn,
  .gv-actions .btn, .fd-hero-actions .btn, .fd-hero-actions a,
  .fd-hero-actions .fd-export-btn, .fd-hero-actions .fd-theme-toggle,
  .inv-actions .btn, .inv-actions .inv-btn, .inv-actions a,
  .page-actions .btn, .head-actions .btn,
  .people-hero-actions .btn, .people-hero-actions a,
  .payroll-hero-actions .btn, .payroll-hero-actions a,
  .leave-hero-actions .btn, .leave-hero-actions a,
  .loans-hero-actions .btn, .loans-hero-actions a,
  .ss-hero-actions .btn, .tk-hero-actions .btn, .tk-hero-actions a,
  .jp-hero-actions .btn, .jp-hero-actions a,
  .eh-hero-actions .btn, .eh-hero-actions .eh-btn,
  .employee-form-actions .btn, .employee-form-actions a,
  .ti-m__actions .btn, .ti-m__row-actions .btn, .ti-m__row-actions a,
  .gf-row-actions .btn, .gf-row-actions form, .ti-filters .btn,
  .da-hero-actions .da-btn, .da-hero-actions a,
  .em-actions .em-btn, .em-actions button, .em-actions a,
  .fin-lux-actions .btn, .modal-actions .btn, .ti-actions .btn, .ti-actions a.btn,
  .da-card-head .da-btn, .da-actions .da-btn{
    flex:0 1 auto !important;
    width:auto !important;
    max-width:100% !important;
    min-height:32px !important;
    height:auto !important;
    padding:6px 10px !important;
    font-size:.78rem !important;
    line-height:1.25 !important;
    white-space:normal !important;
    box-shadow:none !important;
  }
  .ti-compose-backdrop.modal-backdrop{
    align-items:flex-start !important;
    justify-content:flex-start !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    padding:8px 8px 28px !important;
  }
  .ti-compose-modal{
    width:100% !important;
    max-width:100% !important;
    max-height:none !important;
    height:auto !important;
    overflow:visible !important;
    flex:0 0 auto !important;
  }
  .ti-compose-modal .ti-compose-body,
  .ti-compose-modal .ti-compose-body > form{
    overflow:visible !important;
    display:block !important;
    max-height:none !important;
  }
  .ti-grid{
    display:flex !important;
    flex-direction:column !important;
    grid-template-columns:1fr !important;
    overflow:visible !important;
    gap:12px !important;
  }
  .ti-grid-main{ order:1 !important; overflow:visible !important; max-height:none !important; }
  .ti-grid-side{
    order:2 !important;
    position:static !important;
    width:100% !important;
    overflow:visible !important;
  }
  .ti-grid-side > .ti-card{
    position:static !important;
    top:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }
  .da-shell, .doc-auto, .admin-doc{ overflow-x:visible !important; }
  .da-card{ max-width:100%; }
  .da-card-body, .se-hscroll{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior-x:contain !important;
    touch-action:pan-x pan-y !important;
  }
  .da-card .da-table, .se-hscroll > table, .se-hscroll > .da-table, .se-hscroll > .loans-table{
    min-width:720px !important;
    width:max-content !important;
    max-width:none !important;
  }
}

/* Finance dashboard filter strip — phone pills, desktop untouched (2026-10-03). */
@media (max-width:850px){
  .fd-filters{ padding:10px 10px !important; }
  .fd-filters form{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:flex-end !important;
    justify-content:flex-start !important;
    gap:6px !important;
  }
  .fd-filters label{
    flex:0 1 auto !important;
    width:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    gap:2px !important;
  }
  .fd-filters select,
  .fd-filters input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
  .fd-select-trigger,
  .fd-filters a.btn,
  .fd-filters .btn,
  .fd-filters .btn-ghost{
    width:auto !important;
    min-width:0 !important;
    max-width:100% !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 10px !important;
    border-radius:999px !important;
    flex:0 1 auto !important;
  }
  .fd-property-dropdown{
    display:inline-block !important;
    min-width:0 !important;
    width:auto !important;
    max-width:100% !important;
  }
  .fd-select-trigger{ max-width:12.5rem !important; }
  .fd-hero-actions .fd-export-btn,
  .fd-hero-actions .fd-theme-toggle{
    height:32px !important;
    min-height:32px !important;
    width:auto !important;
    flex:0 1 auto !important;
    padding:0 10px !important;
    border-radius:999px !important;
    font-size:.78rem !important;
  }
}

/* Phone search boxes — short pills in the filter row, not tall full-width bars (2026-10-03). */
@media (max-width:850px){
  .global-search{
    display:flex !important;
    align-items:center !important;
    width:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    flex:1 1 7.5rem !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 10px !important;
    border-radius:999px !important;
    box-sizing:border-box !important;
  }
  .global-search input{
    height:auto !important;
    min-height:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    flex:1 1 auto !important;
    width:auto !important;
  }
  .global-search kbd{ display:none !important; }

  .ti-filters,
  .gf-toolbar,
  .ledger-toolbar,
  .pv-toolbar,
  .pv-search,
  .join-filters,
  .people-toolbar,
  .people-toolbar-left,
  .cm-filters,
  .fin-filters,
  .crm-filters,
  .am-filters,
  .rbac-tools,
  .se-search-form{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:6px !important;
    width:auto !important;
    max-width:100% !important;
  }
  .join-filters > div,
  .cm-filters > label,
  .inv-filter-search,
  .people-toolbar-left{
    width:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    flex:0 1 auto !important;
  }
  .inv-filter-panel{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:flex-end !important;
    gap:6px !important;
  }
  .inv-filter-heading{ flex:1 1 100% !important; width:100% !important; }
  .inv-filter-panel > label{
    width:auto !important;
    max-width:100% !important;
    flex:0 1 auto !important;
    min-width:0 !important;
  }

  input[type="search"],
  .people-search,
  .payroll-search,
  .doc-search,
  .tk-search,
  .rbac-search,
  .se-search-form input[name="q"],
  #expenseSearch,
  #incomeSearch,
  #taskSearch,
  #claimSearch,
  .cm-search-wrap input,
  .inv-filter-search input,
  .ti-filters input[type="search"],
  .fin-filters input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  .crm-filters input[type="search"],
  .gf-toolbar input[type="search"],
  .ledger-toolbar input[type="search"],
  .pv-search input,
  .join-filters input[type="search"],
  .am-filters input[type="search"]{
    width:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    flex:0 1 auto !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 12px !important;
    border-radius:999px !important;
    box-sizing:border-box !important;
    line-height:1.2 !important;
  }
  .ti-filters select,
  .gf-toolbar select,
  .people-filter,
  .join-filters select,
  .fin-filters select,
  .crm-filters select,
  .am-filters select,
  .cm-filters select,
  .pv-search select,
  .inv-filter-panel > label select{
    width:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    flex:0 1 auto !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 28px 0 12px !important;
    border-radius:999px !important;
    box-sizing:border-box !important;
  }
  .gf-toolbar .btn,
  .gf-toolbar a.btn,
  .se-search-form .btn,
  .rbac-tools .btn,
  .rbac-tools .btn-secondary,
  .rbac-tools button{
    width:auto !important;
    min-height:34px !important;
    height:34px !important;
    border-radius:999px !important;
    flex:0 1 auto !important;
    padding:0 12px !important;
  }

  /* Search inside an open picker stays the width of that panel, but short. */
  #daEmpFilter,
  #docEmpFilter,
  .fd-ss-q,
  .inv-ss-q,
  #cmEmpSearch{
    width:100% !important;
    max-width:100% !important;
    flex:1 1 auto !important;
    height:34px !important;
    min-height:34px !important;
    margin-bottom:6px !important;
    padding:0 12px !important;
    border-radius:999px !important;
    box-sizing:border-box !important;
  }
}

/* Inventory add-asset popup: above the page, scroll the sheet, don't pin it under the bottom (2026-10-03). */
@media (max-width:850px){
  #invAssetModal.modal-backdrop{
    position:fixed !important;
    inset:0 !important;
    z-index:4000 !important;
    align-items:flex-start !important;
    justify-content:center !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior:contain !important;
    height:100% !important;
    max-height:100% !important;
    padding:12px 10px max(20px, env(safe-area-inset-bottom)) !important;
  }
  #invAssetModal .modal{
    width:min(720px, 100%) !important;
    max-width:100% !important;
    max-height:none !important;
    margin:0 auto 16px !important;
    border-radius:18px !important;
  }
}
