/* CasinoLab v25.26, focused corrections to the admin mobile layout. */
/* The former mobile action rule was more specific than the universal .hidden rule.
   Respect permissions and page-specific visibility first at every viewport size. */
#dashboard .main-head .head-actions > button.hidden,
#dashboard .main-head .head-actions > .btn.hidden,
#dashboard .main-head .head-actions > [hidden],
#dashboard .main-head #mobile-head-actions-toggle.hidden { display:none!important; }

/* Trade filtering must use left-aligned labels, never the old two-column label grid. */
#dashboard #trades-view .trade-filter-controls > .trade-user-field {
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  text-align:left!important;justify-content:flex-end!important;gap:7px!important;
  grid-template-columns:none!important;
}
#dashboard #trades-view .trade-filter-controls > .trade-user-field input,
#dashboard #trades-view .trade-filter-controls > .trade-user-field select{
  display:block!important;width:100%!important;margin:0!important;min-width:0!important;
}

/* Desktop editing remains a light, compact row inside the horizontal table. */
#dashboard .trade-edit-form{gap:7px!important;padding:9px!important;}
#dashboard .trade-edit-form label{font-size:10px!important;line-height:1.25!important;gap:4px!important;}
#dashboard .trade-edit-form .trade-edit-actions button{min-height:33px!important;font-size:11px!important;}
#dashboard .trade-edit-form>p{font-size:10px!important;}

@media(max-width:900px){
  /* Header stays one row. Its compact menu is only available where page actions exist. */
  #dashboard .main-head:not(.only-language){
    display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;
    align-items:center!important;gap:8px!important;position:relative!important;overflow:visible!important;
  }
  #dashboard .main-head .mobile-nav-toggle{grid-column:1!important;grid-row:1!important;}
  #dashboard .main-head > div:nth-child(3){grid-column:2!important;grid-row:1!important;min-width:0!important;}
  #dashboard #mobile-head-actions-toggle:not(.hidden){
    grid-column:3!important;grid-row:1!important;min-height:38px!important;
    padding:7px 10px!important;border:1px solid #ccdaee!important;
    background:#fff!important;color:#245381!important;box-shadow:none!important;
  }
  #dashboard .main-head .head-actions{
    grid-column:auto!important;grid-row:auto!important;
    display:none!important;position:absolute!important;top:calc(100% + 4px)!important;
    right:0!important;left:auto!important;z-index:400!important;
    width:min(250px,calc(100vw - 26px))!important;max-height:min(70dvh,420px)!important;
    overflow:auto!important;flex-direction:column!important;align-items:stretch!important;
    padding:8px!important;gap:5px!important;border:1px solid #dce7f5!important;
    background:#fff!important;border-radius:12px!important;
    box-shadow:0 16px 42px rgba(32,69,112,.18)!important;
  }
  #dashboard .main-head.head-actions-open .head-actions{display:flex!important;}
  #dashboard .main-head .head-actions > button.btn:not(.hidden){
    display:flex!important;align-items:center!important;justify-content:flex-start!important;
    width:100%!important;min-height:38px!important;margin:0!important;
    padding:9px 12px!important;border-radius:8px!important;
    font-size:12px!important;line-height:1.25!important;white-space:normal!important;
    background:#f8fbff!important;border:1px solid #e3ebf6!important;color:#24486f!important;
  }
  #dashboard .main-head .head-actions > button.btn.primary:not(.hidden){
    color:#fff!important;background:#1d61ad!important;border-color:#1d61ad!important;
  }
  #dashboard .main-head .head-actions .admin-head-language{
    display:flex!important;order:-1!important;width:100%!important;min-height:39px!important;
    background:#fff!important;border:1px solid #dbe6f4!important;
    padding:0 10px!important;margin-bottom:3px!important;flex:none!important;
  }
  /* On pages with no page actions, show only the language picker in the top bar. */
  #dashboard .main-head.only-language{
    grid-template-columns:42px minmax(0,1fr) 74px!important;
    position:relative!important;overflow:visible!important;
  }
  #dashboard .main-head.only-language .head-actions{
    display:flex!important;position:static!important;grid-column:3!important;grid-row:1!important;
    box-shadow:none!important;border:0!important;padding:0!important;
    width:74px!important;min-width:0!important;height:39px!important;max-height:none!important;overflow:visible!important;
  }
  #dashboard .main-head.only-language .head-actions .admin-head-language{
    width:74px!important;margin:0!important;min-height:39px!important;padding:0 6px!important;
  }
  #dashboard .main-head.only-language #mobile-head-actions-toggle{display:none!important;}
  /* Small text in the hint, but keep input font at 16px to avoid Safari focusing zoom. */
  #dashboard input:not([type=checkbox]):not([type=radio])::placeholder,
  #dashboard textarea::placeholder,
  #dialog-backdrop input::placeholder,
  #fake-trade-dialog input::placeholder{
    font-size:12px!important;letter-spacing:-.025em!important;font-weight:500!important;
    opacity:1!important;color:#7286a1!important;
  }
  #dashboard .trade-edit-form{
    min-width:0!important;width:max-content!important;max-width:none!important;
    display:grid!important;grid-template-columns:repeat(5,103px)!important;
    gap:6px!important;padding:7px!important;border-radius:8px!important;
  }
  #dashboard .trade-edit-form label{font-size:10px!important;gap:4px!important;min-width:0!important;}
  #dashboard .trade-edit-form input{
    font-size:16px!important;min-width:0!important;width:100%!important;
    min-height:36px!important;height:36px!important;padding:5px 6px!important;
    border-radius:7px!important;letter-spacing:-.035em!important;
  }
  #dashboard .trade-edit-form .trade-edit-actions{grid-column:1/-1!important;gap:6px!important;}
  #dashboard .trade-edit-form .trade-edit-actions button{font-size:10px!important;min-height:32px!important;padding:6px 9px!important;}
  #dashboard .trade-edit-form>p{font-size:9px!important;line-height:1.35!important;}
  #dashboard .trade-edit-row>td{padding:6px!important;}
}
@media(max-width:390px){
  #dashboard #mobile-head-actions-toggle:not(.hidden){padding:6px 8px!important;font-size:10px!important;}
  #dashboard .main-head h1{font-size:18px!important;}
  #dashboard input:not([type=checkbox]):not([type=radio])::placeholder,
  #dashboard textarea::placeholder,#dialog-backdrop input::placeholder,#fake-trade-dialog input::placeholder{
    font-size:11px!important;
  }
  #dashboard #trades-view .trade-filter-controls>.trade-user-field{grid-column:1/-1!important;}
}
