/*
 GreenEco Meetings — Follow-up toolbar layout correction
 Screen: متابعة النتائج
 - Row 1: meeting subject + action buttons
 - Row 2: filters distributed evenly
 - Exit stays as the top-left X supplied by the meetings UI
 - No print rules are changed
 Version: 3.3.16.44.2.503
*/

@media screen {
  /* Convert the native toolbar into a clean two-row grid. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters){
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    margin:0 0 7px!important;
    padding:6px!important;

    display:grid!important;
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    grid-template-rows:34px 48px!important;
    gap:6px!important;

    align-items:stretch!important;
    justify-content:stretch!important;
    direction:rtl!important;

    overflow:visible!important;
    background:#f3f3f3!important;
    border:1px solid #c7c7c7!important;
    box-shadow:none!important;
  }

  /*
    Remove the two wrapper boxes from layout so their children participate
    directly in the toolbar grid.
  */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-extra,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-extra{
    display:contents!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters{
    display:contents!important;
  }

  /* ---------------------------------------------------------
     First row
     Right: subject selector (3/7)
     Left: action buttons (4/7)
     --------------------------------------------------------- */

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-actions,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-actions{
    grid-row:1!important;
    grid-column:4 / 8!important;

    min-width:0!important;
    width:100%!important;
    height:34px!important;

    margin:0!important;
    padding:0!important;

    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:5px!important;
    overflow:visible!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-actions .tool-button,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters)
  > .toolbar-actions .tool-button{
    flex:0 1 105px!important;
    min-width:82px!important;
    max-width:115px!important;
    height:34px!important;
    min-height:34px!important;

    margin:0!important;
    padding:4px 8px!important;

    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;

    white-space:nowrap!important;
    font-size:11px!important;
    transform:none!important;
    box-shadow:none!important;
  }

  /* Meeting subject: right side of the first row. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter{
    grid-row:1!important;
    grid-column:1 / 4!important;

    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:34px!important;

    margin:0!important;
    padding:0!important;

    display:grid!important;
    grid-template-columns:110px minmax(0,1fr)!important;
    align-items:center!important;
    gap:6px!important;

    border:0!important;
    background:transparent!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter > span,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter > span{
    height:34px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    font-size:11px!important;
    font-weight:800!important;
    white-space:nowrap!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter select,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-meeting-filter select{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:34px!important;
    min-height:34px!important;
    margin:0!important;
    padding:3px 8px!important;
    font-size:11px!important;
  }

  /* ---------------------------------------------------------
     Second row: 7 equal cells
     المصدر | الحالة | المسؤول | من | إلى | المتأخرة | مسح
     --------------------------------------------------------- */

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(2),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(2){
    grid-row:2!important;
    grid-column:1!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(3),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(3){
    grid-row:2!important;
    grid-column:2!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(4),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(4){
    grid-row:2!important;
    grid-column:3!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(5),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(5){
    grid-row:2!important;
    grid-column:4!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(6),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(6){
    grid-row:2!important;
    grid-column:5!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(7),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(7){
    grid-row:2!important;
    grid-column:6!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(8),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > :nth-child(8){
    grid-row:2!important;
    grid-column:7!important;
  }

  /* Regular filter cells. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > label:not(.meeting-followup-meeting-filter):not(.meeting-followup-overdue-check),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > label:not(.meeting-followup-meeting-filter):not(.meeting-followup-overdue-check){
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:48px!important;

    margin:0!important;
    padding:0!important;

    display:grid!important;
    grid-template-rows:14px 30px!important;
    align-items:end!important;
    gap:3px!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > label:not(.meeting-followup-meeting-filter) > span,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters > label:not(.meeting-followup-meeting-filter) > span{
    font-size:10px!important;
    line-height:14px!important;
    font-weight:700!important;
    white-space:nowrap!important;
  }

  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters select,
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters input[type="date"],
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters select,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-filters input[type="date"]{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:30px!important;
    min-height:30px!important;
    margin:0!important;
    padding:2px 6px!important;
    font-size:10px!important;
  }

  /* Overdue checkbox becomes a normal equal-width filter cell. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-overdue-check,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-overdue-check{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:48px!important;

    margin:0!important;
    padding:16px 6px 2px!important;

    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;

    border:1px solid #aeb8bd!important;
    background:#fff!important;
    box-sizing:border-box!important;
  }

  /* Clear filters button fills the last cell. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-clear,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-clear{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:34px!important;
    min-height:34px!important;

    align-self:end!important;
    margin:0!important;
    padding:4px 8px!important;

    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;

    white-space:nowrap!important;
    font-size:10px!important;
  }

  /* Any legacy exit button remains hidden; the screen uses the X in the title. */
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-exit,
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  .meeting-followup-inline-exit{
    display:none!important;
  }
}

/* Narrow desktop: keep two logical rows and allow safe internal scroll,
   never revert to a side-column layout. */
@media screen and (max-width:980px){
  html.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters),
  body.greeneco-meetings-route
  .page-container:has(.meeting-followup-inline-filters)
  > .toolbar:has(.meeting-followup-inline-filters){
    grid-template-columns:repeat(7,minmax(125px,1fr))!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
  }
}
