/* AquaFlow V34.2.151 — compact enterprise driver quick actions.
   Overrides the tall V34.2.150 tile styling; staff dashboard only.
   Preserve the six existing action handlers and RBAC permissions. */

/* Hidden must beat older display:flex!important on .staff-command.
   The trip-close controller determines when the trip finish action is actionable. */
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar.is-hidden,
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command.is-hidden,
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command[hidden],
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command[aria-hidden="true"] {
  display:none!important;
}

@media (max-width:760px) {
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-rows:auto!important;
    align-items:stretch!important;
    gap:7px!important;
    margin:0 0 12px!important;
    padding:0!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command:not(.staff-command-finish) {
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    min-width:0!important;
    min-height:0!important;
    height:94px!important;
    max-height:94px!important;
    padding:8px 8px 7px!important;
    gap:4px!important;
    border-radius:13px!important;
    box-shadow:0 3px 9px rgba(15,67,118,.08)!important;
    overflow:hidden!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-icon {
    width:27px!important;height:27px!important;
    min-width:27px!important;min-height:27px!important;
    border-radius:8px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-icon::before {
    width:17px!important;height:17px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command > span:last-child {
    display:flex!important;
    flex-direction:column!important;
    gap:2px!important;
    flex:1 1 auto!important;
    min-height:0!important;
    min-width:0!important;
    width:100%!important;
    overflow:hidden!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command strong {
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    line-clamp:2;
    overflow:hidden!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:clamp(11.5px,3.1vw,13px)!important;
    line-height:1.16!important;
    font-weight:800!important;
    letter-spacing:-.015em!important;
    white-space:normal!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command small {
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 1 auto!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:10px!important;
    line-height:1.2!important;
    font-weight:550!important;
  }
  /* The oversized decorative arrow costs valuable room on narrow tiles. */
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command::after {
    display:none!important;
    content:none!important;
  }
  /* Finish-trip is a contextual action, never an empty disabled block. */
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-finish:not(.is-hidden):not([hidden]) {
    grid-column:1/-1!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    min-height:42px!important;
    height:42px!important;
    max-height:42px!important;
    padding:7px 10px!important;
    border-radius:12px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-finish:not(.is-hidden):not([hidden]) > span:last-child {
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    min-width:0!important;
    gap:7px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-finish strong {
    flex-shrink:0!important;
    font-size:12px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command-finish small {
    min-width:0!important;
    white-space:nowrap!important;
  }
}
@media (max-width:350px) {
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:auto!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command:not(.staff-command-finish) {
    flex-direction:row!important;
    align-items:center!important;
    height:74px!important;
    max-height:74px!important;
    gap:7px!important;
  }
  body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command strong {font-size:12px!important}
}

/* Always win against older per-tile display rules, including !important. */
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command.staff-command.is-hidden,
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command.staff-command[hidden],
body:is(.staff-mode,[data-role="staff"]) #overview .staff-command-bar .staff-command.staff-command[aria-hidden="true"] {
  display:none!important;
}
