/* xag-side-actions.css  SIDE ACTIONS: one shared component for the actions of a page.
   A right-hand column of equal-width pill buttons, stacked, level with the top of the content; on phones the column
   moves above the content as a full-width stack. Any page can use it:

     <div class="xag-side-layout">
       <div class="xag-side-main"> ...the page content... </div>
       <aside class="xag-side-actions" aria-label="...">
         <a class="btn btn-gold" href="...">Main action</a>        (one primary at most, first)
         <a class="btn btn-outline" href="...">Another action</a>   (secondary: outlined pill)
       </aside>
     </div>

   A button that belongs to one panel of the page only: data-side-for="teachers" (a list is allowed); the panel in the
   main column carries data-side-panel="teachers" and the class "active" while it is open.
   Buttons use the shared button families (xag-ui.css); this file only lays them out. Spacing tokens: xag-space.css. */
:root { --xag-header-h: 64px; }
@media (max-width: 560px) { :root { --xag-header-h: 56px; } }
.xag-side-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--xag-sp-5);
  align-items: start;
}
.xag-side-main { grid-column: 1; grid-row: 1; min-width: 0; }
.xag-side-actions {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; gap: var(--xag-sp-2);
  position: sticky; top: calc(var(--xag-header-h, 64px) + var(--xag-sp-4));
  align-self: start;
  max-height: calc(100dvh - var(--xag-header-h, 64px) - 2 * var(--xag-sp-4)); overflow-y: auto; overscroll-behavior: contain; padding: 6px; margin: -6px;
  scrollbar-width: none; -ms-overflow-style: none;   /* no native scrollbar in a themed panel: still scrolls by wheel, touch and keyboard */
}
.xag-side-actions::-webkit-scrollbar { display: none; }
/* shared utility: no visible native scrollbar on a themed panel (side menus, filters, dialogs, lists) */
.xag-noscrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.xag-noscrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.xag-side-actions > .btn,
.xag-side-actions > a.btn,
.xag-side-actions > button.btn {
  width: 100%; min-height: 44px; justify-content: center; text-align: center; white-space: normal;
  padding: var(--xag-sp-2) var(--xag-sp-4); font-size: .95rem;
}
.xag-side-actions > .xsa-big { min-height: 52px; font-size: 1rem; }
.xag-side-actions > .xsa-gap { margin-top: var(--xag-sp-2); }
.xag-side-actions[hidden], .xag-side-actions > [hidden] { display: none; }

/* buttons that belong to one panel of the page: shown only while that panel is open */
.xag-side-actions > [data-side-for] { display: none; }
.xag-side-layout:has([data-side-panel="teachers"].active) .xag-side-actions > [data-side-for~="teachers"],
.xag-side-layout:has([data-side-panel="schools"].active) .xag-side-actions > [data-side-for~="schools"],
.xag-side-layout:has([data-side-panel="role"].active) .xag-side-actions > [data-side-for~="role"] { display: inline-flex; }
@supports not selector(:has(*)) { .xag-side-actions > [data-side-for] { display: inline-flex; } }

/* phones and narrow windows: the column moves above the content, full width */
@media (max-width: 860px) {
  .xag-side-layout { grid-template-columns: minmax(0, 1fr); gap: var(--xag-sp-4); }
  .xag-side-actions { grid-column: 1; grid-row: 1; position: static; }
  .xag-side-main { grid-row: 2; }
}
@media print { .xag-side-actions { display: none; } }
/* content column rule: every box in the main column starts at the column's left edge and uses its full width (never a narrow or centred box beside the actions) */
.xag-side-main > :is(.form-card, .xbox, .info-block, .xag-disclaimer-box, .step-panel > .form-card) { margin-left: 0; margin-right: 0; max-width: none; }
.xag-side-main .form-card { max-width: none; width: 100%; box-sizing: border-box; }

/* HERO + ACTIONS ROW (owner 2026-11-04, Recruitment): the top box of the active panel and the right-hand info buttons share ONE grid row, so their tops and bottoms are level
   and the buttons are equal width and evenly spaced. Everything else (chips row, the one advert, the content) goes full width below.
   Panels and the main column use display:contents so all items sit on the layout grid. Class on the layout: xrec-layout. Same on phone (stacked: box, buttons, rest). */
.xrec-layout { row-gap: var(--xag-sp-4); }
.xrec-layout > .xag-side-main, .xrec-layout .step-panel.active { display: contents; }
.xrec-layout .step-panel.active > * { grid-column: 1 / -1; min-width: 0; }
.xrec-layout :is(#recruit-step-role > .opt-grid, .xc-aid.xc-teacher, .xrec-hero) { grid-column: 1; grid-row: 1; margin: 0; max-width: none; }
.xrec-layout > .xag-side-actions {
  grid-column: 2; grid-row: 1; align-self: stretch; position: static; max-height: none; overflow: visible; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: var(--xag-sp-2);
}
.xrec-layout > .xag-side-actions > .btn { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-start; gap: var(--xag-sp-3); text-align: left; min-height: 44px; padding: var(--xag-sp-2) var(--xag-sp-4); }
.xrec-layout > .xag-side-actions > .btn .xi { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.xrec-layout > .xag-side-actions > .btn > span { flex: 1 1 auto; min-width: 0; text-align: center; padding-right: 24px; }
/* schools: heading, intro and the three big step cards; step 3 (Manage school profile) is the purple standard button */
.xrec-hero-schools #schoolTabRow { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.xrec-hero-schools #schoolTabRow .opt-btn { min-height: 120px; }
@media (max-width: 860px) {
  .xrec-layout > .xag-side-actions { grid-column: 1; grid-row: 2; }
  .xrec-layout > .xag-side-actions > .btn { flex: 0 0 auto; min-height: 52px; }
  .xrec-hero-schools #schoolTabRow { grid-template-columns: 1fr !important; }
}
.xrec-hero-schools { display: flex; flex-direction: column; min-height: 272px; }
.xrec-hero-schools #schoolTabRow { flex: 1 1 auto; }
.xrec-hero-schools #schoolTabRow .opt-btn { min-height: 0; }
.xrec-layout > .xag-side-actions > .btn { min-height: 40px; }
