/*
 GreenEco Meetings — Preparation screen top-toolbar layout
 Scope: meeting preparation screen only.
 - Removes KPI cards above the preparation register.
 - Converts the former right-side command column into two equal horizontal rows.
 - Keeps subject/search directly above the table.
 - Screen-only; printing output is intentionally untouched.
 Version: 3.3.16.44.2.500
*/

@media screen {
  /* Remove the four statistic cards above the preparation table. */
  html.greeneco-meetings-route .meeting-prep-overview,
  body.greeneco-meetings-route .meeting-prep-overview{
    display:none!important;
  }

  /* The preparation screen must read top-to-bottom, not as a side panel layout. */
  html.greeneco-meetings-route .meeting-prep-shell,
  body.greeneco-meetings-route .meeting-prep-shell{
    width:100%!important;
    min-width:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:6px!important;
    align-items:start!important;
    direction:rtl!important;
  }

  /* Former side command column -> 14 commands in 7 equal columns / 2 rows. */
  html.greeneco-meetings-route .meeting-prep-sidebar,
  body.greeneco-meetings-route .meeting-prep-sidebar{
    grid-column:1!important;
    grid-row:1!important;
    position:static!important;
    inset:auto!important;
    z-index:auto!important;

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

    margin:0!important;
    padding:5px!important;

    display:grid!important;
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    grid-auto-rows:minmax(34px,auto)!important;
    gap:5px!important;

    overflow:visible!important;
    scrollbar-gutter:auto!important;

    border:1px solid #8f9da3!important;
    border-radius:0!important;
    background:#eef3f5!important;
    box-shadow:none!important;
  }

  /* The old "command column" caption/dividers are no longer needed. */
  html.greeneco-meetings-route .meeting-prep-sidebar-head,
  html.greeneco-meetings-route .meeting-prep-sidebar-divider,
  body.greeneco-meetings-route .meeting-prep-sidebar-head,
  body.greeneco-meetings-route .meeting-prep-sidebar-divider{
    display:none!important;
  }

  html.greeneco-meetings-route .meeting-prep-side-button,
  body.greeneco-meetings-route .meeting-prep-side-button{
    width:100%!important;
    min-width:0!important;
    min-height:34px!important;
    height:100%!important;

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

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

    border:1px solid #8b989e!important;
    border-radius:0!important;
    background:#fff!important;
    color:#18323d!important;

    text-align:center!important;
    white-space:normal!important;
    line-height:1.25!important;
    font-size:10px!important;
    font-weight:750!important;
    box-shadow:none!important;
  }

  html.greeneco-meetings-route .meeting-prep-side-button:hover:not(:disabled),
  body.greeneco-meetings-route .meeting-prep-side-button:hover:not(:disabled){
    background:#e8f8f8!important;
    border-color:#5f9da8!important;
  }

  html.greeneco-meetings-route .meeting-prep-side-button.active,
  body.greeneco-meetings-route .meeting-prep-side-button.active{
    background:#dff5f6!important;
    border-color:#4d929d!important;
    color:#075f75!important;
    box-shadow:inset 0 -3px #16849b!important;
  }

  html.greeneco-meetings-route .meeting-prep-side-button:disabled,
  body.greeneco-meetings-route .meeting-prep-side-button:disabled{
    opacity:.48!important;
    cursor:not-allowed!important;
  }

  /* Workspace now occupies full screen width under the command rows. */
  html.greeneco-meetings-route .meeting-prep-workspace,
  body.greeneco-meetings-route .meeting-prep-workspace{
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }

  /* Register panel sits immediately under the command toolbar. */
  html.greeneco-meetings-route .meeting-prep-register,
  body.greeneco-meetings-route .meeting-prep-register{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  /* Subject + search become a balanced row immediately above the table. */
  html.greeneco-meetings-route .meeting-prep-subject-search-row,
  body.greeneco-meetings-route .meeting-prep-subject-search-row{
    width:100%!important;
    min-height:42px!important;
    margin:0!important;
    padding:5px 6px!important;

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

    border-bottom:1px solid #9ca7ac!important;
    background:#f5f8f9!important;
  }

  html.greeneco-meetings-route .meeting-prep-register-subject,
  html.greeneco-meetings-route .meeting-prep-register-search,
  body.greeneco-meetings-route .meeting-prep-register-subject,
  body.greeneco-meetings-route .meeting-prep-register-search{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  html.greeneco-meetings-route .meeting-prep-register-subject > *,
  html.greeneco-meetings-route .meeting-prep-register-search > *,
  body.greeneco-meetings-route .meeting-prep-register-subject > *,
  body.greeneco-meetings-route .meeting-prep-register-search > *{
    width:100%!important;
    min-width:0!important;
  }

  /* Remove the obsolete "use the column on the right" hint. */
  html.greeneco-meetings-route .meeting-prep-register-hint,
  body.greeneco-meetings-route .meeting-prep-register-hint{
    display:none!important;
  }

  /* Table gets the newly available full width. */
  html.greeneco-meetings-route .meeting-prep-register .table-scroll,
  body.greeneco-meetings-route .meeting-prep-register .table-scroll{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:auto!important;
    scrollbar-gutter:stable!important;
  }

  html.greeneco-meetings-route .meeting-prep-register table,
  body.greeneco-meetings-route .meeting-prep-register table{
    min-width:100%!important;
  }
}

/* Keep the command area in two rows on normal desktop widths.
   On very narrow windows we retain two rows and allow horizontal scrolling
   instead of returning to a side-column layout. */
@media screen and (max-width:980px){
  html.greeneco-meetings-route .meeting-prep-sidebar,
  body.greeneco-meetings-route .meeting-prep-sidebar{
    grid-template-columns:repeat(7,minmax(120px,1fr))!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }

  html.greeneco-meetings-route .meeting-prep-subject-search-row,
  body.greeneco-meetings-route .meeting-prep-subject-search-row{
    grid-template-columns:minmax(320px,2fr) minmax(180px,1fr)!important;
    overflow-x:auto!important;
  }
}

/* ---------- 500: Center preparation toolbar + register ---------- */
/*
   Screen-only alignment refinement:
   - neutralizes historical full-viewport / translated preparation rules
   - keeps the two command rows and the register on one centered axis
   - leaves comfortable, equal gutters on both sides
   - printing is not affected
*/
@media screen {
  html.greeneco-meetings-route body.greeneco-meetings-route .meeting-prep-shell,
  html.greeneco-meetings-route .meeting-prep-shell,
  body.greeneco-meetings-route .meeting-prep-shell{
    width:min(1120px,calc(100% - 24px))!important;
    max-width:1120px!important;
    min-width:0!important;

    margin-right:auto!important;
    margin-left:auto!important;
    padding:0!important;

    transform:none!important;
    translate:none!important;

    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    column-gap:0!important;
    row-gap:6px!important;

    box-sizing:border-box!important;
  }

  /* Reset the old sidebar translation: this is now the horizontal command bar. */
  html.greeneco-meetings-route body.greeneco-meetings-route .meeting-prep-sidebar,
  html.greeneco-meetings-route .meeting-prep-sidebar,
  body.greeneco-meetings-route .meeting-prep-sidebar{
    grid-column:1!important;
    grid-row:1!important;

    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    margin:0!important;
    transform:none!important;
    translate:none!important;

    justify-self:stretch!important;
    align-self:start!important;
    box-sizing:border-box!important;
  }

  /* Keep the complete work area directly below and on exactly the same center line. */
  html.greeneco-meetings-route body.greeneco-meetings-route .meeting-prep-workspace,
  html.greeneco-meetings-route .meeting-prep-workspace,
  body.greeneco-meetings-route .meeting-prep-workspace{
    grid-column:1!important;
    grid-row:2!important;

    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    margin:0!important;
    padding:0!important;
    transform:none!important;
    translate:none!important;

    justify-self:stretch!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route body.greeneco-meetings-route .meeting-prep-register,
  html.greeneco-meetings-route .meeting-prep-register,
  body.greeneco-meetings-route .meeting-prep-register{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    margin:0!important;
    padding:0!important;
    transform:none!important;

    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route .meeting-prep-subject-search-row,
  body.greeneco-meetings-route .meeting-prep-subject-search-row,
  html.greeneco-meetings-route .meeting-prep-register .table-scroll,
  body.greeneco-meetings-route .meeting-prep-register .table-scroll{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-right:0!important;
    margin-left:0!important;
    box-sizing:border-box!important;
  }

  /* The table may scroll internally when its columns need more width,
     but the panel itself never pushes against the right edge of the screen. */
  html.greeneco-meetings-route .meeting-prep-register .table-scroll,
  body.greeneco-meetings-route .meeting-prep-register .table-scroll{
    overflow-x:auto!important;
    overflow-y:auto!important;
    scrollbar-gutter:stable!important;
  }

  html.greeneco-meetings-route .meeting-prep-register table.data-table,
  body.greeneco-meetings-route .meeting-prep-register table.data-table{
    width:100%!important;
    min-width:1040px!important;
    max-width:none!important;
    margin:0!important;
  }
}

/* Keep balanced gutters on narrower desktop windows without returning to
   the old side-column appearance. */
@media screen and (max-width:1160px){
  html.greeneco-meetings-route .meeting-prep-shell,
  body.greeneco-meetings-route .meeting-prep-shell{
    width:calc(100% - 20px)!important;
    max-width:none!important;
    margin-right:auto!important;
    margin-left:auto!important;
  }
}
