/*
 GreenEco Meetings — Attendance screen layout recovery
 Screen: تحضير الموظفين
 Purpose:
 - stop the title/header section from stretching vertically
 - keep toolbar, summary and register directly below the header
 - isolate the recovery to the attendance screen only
 - CSS only; no app.js / business logic / print changes
 Version: 3.3.16.44.2.511
*/

@media screen {

  /* Scope everything to the real Attendance page. */
  html.greeneco-meetings-route
  .page-container:has(> .meeting-attendance-page-head),
  body.greeneco-meetings-route
  .page-container:has(> .meeting-attendance-page-head){
    display:block!important;

    width:min(1180px,calc(100% - 16px))!important;
    max-width:1180px!important;
    min-width:0!important;

    height:auto!important;
    min-height:0!important;
    max-height:none!important;

    margin:0 auto!important;
    padding:0 0 16px!important;

    overflow:visible!important;
    box-sizing:border-box!important;
  }

  /* Critical recovery:
     the header must be one compact row, never a large flex/grid area. */
  html.greeneco-meetings-route .meeting-attendance-page-head,
  body.greeneco-meetings-route .meeting-attendance-page-head{
    position:relative!important;

    display:flex!important;
    flex:0 0 64px!important;
    align-items:center!important;
    justify-content:center!important;

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

    height:64px!important;
    min-height:64px!important;
    max-height:64px!important;

    margin:0 0 7px!important;
    padding:5px 160px 5px 46px!important;

    overflow:visible!important;
    box-sizing:border-box!important;

    border:1px solid #7f8990!important;
    border-radius:0!important;
    background:#fff!important;
    box-shadow:none!important;
  }

  html.greeneco-meetings-route .meeting-attendance-head-main,
  body.greeneco-meetings-route .meeting-attendance-head-main{
    position:static!important;

    width:100%!important;
    min-width:0!important;
    max-width:760px!important;
    height:auto!important;
    min-height:0!important;

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

    display:grid!important;
    grid-template-columns:auto minmax(280px,1fr)!important;
    align-items:center!important;
    justify-content:center!important;
    gap:14px!important;

    transform:none!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route .meeting-attendance-head-main h1,
  body.greeneco-meetings-route .meeting-attendance-head-main h1{
    margin:0!important;
    padding:0!important;

    font-size:22px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
    text-align:center!important;
  }

  html.greeneco-meetings-route .meeting-attendance-head-subject,
  body.greeneco-meetings-route .meeting-attendance-head-subject{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;

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

  html.greeneco-meetings-route
  .meeting-attendance-head-subject .meeting-toolbar-subject,
  body.greeneco-meetings-route
  .meeting-attendance-head-subject .meeting-toolbar-subject{
    width:100%!important;
    min-width:0!important;

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

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

  html.greeneco-meetings-route
  .meeting-attendance-head-subject .meeting-toolbar-subject > span,
  body.greeneco-meetings-route
  .meeting-attendance-head-subject .meeting-toolbar-subject > span{
    white-space:nowrap!important;
    font-size:10px!important;
    font-weight:800!important;
  }

  html.greeneco-meetings-route
  .meeting-attendance-head-subject select,
  body.greeneco-meetings-route
  .meeting-attendance-head-subject select{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;

    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;

    margin:0!important;
    padding:3px 8px!important;
    box-sizing:border-box!important;
  }

  /* Keep Back / Exit fixed in the title row, never in page flow. */
  html.greeneco-meetings-route .meeting-attendance-head-actions,
  body.greeneco-meetings-route .meeting-attendance-head-actions{
    position:absolute!important;
    left:8px!important;
    right:auto!important;
    top:50%!important;
    bottom:auto!important;

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

    width:auto!important;
    height:34px!important;
    min-height:34px!important;

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

    transform:translateY(-50%)!important;
    translate:none!important;
    scale:none!important;

    z-index:3!important;
  }

  html.greeneco-meetings-route
  .meeting-attendance-head-actions .meeting-attendance-head-back,
  html.greeneco-meetings-route
  .meeting-attendance-head-actions .meeting-attendance-head-exit,
  body.greeneco-meetings-route
  .meeting-attendance-head-actions .meeting-attendance-head-back,
  body.greeneco-meetings-route
  .meeting-attendance-head-actions .meeting-attendance-head-exit{
    position:static!important;

    width:82px!important;
    min-width:82px!important;
    max-width:82px!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;

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

    transform:none!important;
    translate:none!important;
    scale:none!important;
  }

  /* The employee icon stays on the right side of the compact header. */
  html.greeneco-meetings-route .meeting-attendance-page-head > .page-title-icon,
  body.greeneco-meetings-route .meeting-attendance-page-head > .page-title-icon{
    position:absolute!important;
    right:8px!important;
    left:auto!important;
    top:50%!important;

    width:26px!important;
    height:26px!important;

    margin:0!important;
    transform:translateY(-50%)!important;
  }

  /* Toolbar immediately after header. */
  html.greeneco-meetings-route .attendance-one-row-toolbar,
  body.greeneco-meetings-route .attendance-one-row-toolbar{
    position:static!important;
    inset:auto!important;

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

    height:auto!important;
    min-height:42px!important;
    max-height:none!important;

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

    overflow-x:auto!important;
    overflow-y:hidden!important;

    transform:none!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route .attendance-one-row-toolbar > .toolbar,
  body.greeneco-meetings-route .attendance-one-row-toolbar > .toolbar{
    position:static!important;

    width:max-content!important;
    min-width:100%!important;
    max-width:none!important;

    height:auto!important;
    min-height:42px!important;
    max-height:none!important;

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

    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-wrap:nowrap!important;
    gap:6px!important;

    transform:none!important;
    box-sizing:border-box!important;
  }

  /* No selected meeting: empty state follows the toolbar immediately. */
  html.greeneco-meetings-route
  .page-container:has(> .meeting-attendance-page-head) > .empty-state,
  body.greeneco-meetings-route
  .page-container:has(> .meeting-attendance-page-head) > .empty-state{
    position:static!important;

    width:100%!important;
    min-height:90px!important;
    height:auto!important;

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

    transform:none!important;
    box-sizing:border-box!important;
  }

  /* Selected meeting: summary/register stay directly under toolbar. */
  html.greeneco-meetings-route .attendance-independent-screen,
  body.greeneco-meetings-route .attendance-independent-screen{
    position:static!important;

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

    height:auto!important;
    min-height:0!important;
    max-height:none!important;

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

    display:flex!important;
    flex-direction:column!important;
    gap:7px!important;

    transform:none!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route .attendance-independent-summary,
  body.greeneco-meetings-route .attendance-independent-summary{
    position:static!important;

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

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

    display:grid!important;
    grid-template-columns:minmax(0,2fr) repeat(2,minmax(150px,.65fr))!important;
    gap:8px!important;

    transform:none!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route
  .attendance-independent-screen > .table-panel,
  body.greeneco-meetings-route
  .attendance-independent-screen > .table-panel{
    position:static!important;

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

    height:auto!important;
    min-height:0!important;
    max-height:none!important;

    margin:0!important;
    transform:none!important;
    box-sizing:border-box!important;
  }

  html.greeneco-meetings-route
  .attendance-independent-screen .table-scroll,
  body.greeneco-meetings-route
  .attendance-independent-screen .table-scroll{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;

    min-height:220px!important;
    max-height:calc(100vh - 430px)!important;

    margin:0!important;
    overflow:auto!important;
    scrollbar-gutter:stable!important;
    box-sizing:border-box!important;
  }
}

@media screen and (max-width:900px){
  html.greeneco-meetings-route .meeting-attendance-page-head,
  body.greeneco-meetings-route .meeting-attendance-page-head{
    height:auto!important;
    min-height:96px!important;
    max-height:none!important;
    padding:7px 8px 7px 8px!important;
  }

  html.greeneco-meetings-route .meeting-attendance-head-main,
  body.greeneco-meetings-route .meeting-attendance-head-main{
    grid-template-columns:1fr!important;
    gap:5px!important;
    padding-inline:100px 42px!important;
  }

  html.greeneco-meetings-route .meeting-attendance-head-main h1,
  body.greeneco-meetings-route .meeting-attendance-head-main h1{
    text-align:center!important;
  }
}
