/* Page basics, as the App and Platform hosts have them. */
/* The page itself never scrolls (as the App's): the shell fills the viewport and its panes scroll inside. Divided by
   --gnt-zoom because the footer tray's text size zooms the root and vh does not shrink with it. */
html, body { height: calc(100vh / var(--gnt-zoom)); overflow: hidden; margin: 0; font-family: Segoe UI, Arial, sans-serif; color: var(--gnt-text-color); background: var(--gnt-surface-2); }
#app { height: 100%; min-height: 100%; min-width: 0; }
/* Portal-plane chrome. The shell grid and tab chrome come from _content/Sabre.Shared.Web; this file
   holds only what the portal's own top bar, nav and sign-in page need. */
.portal-shell { max-width: 720px; margin: 3rem auto; padding: 0 var(--gnt-space-4); }
/* The portal's top bar (Shared/PortalTopBar.razor), laid out as the App's: the sword and title, the context
   selectors, then Tools, the assistant and the User menu. Single line, on the dark chrome. */
/* The header row grows when the selectors wrap, as the App's does (the shared shell fixes it at 50px). */
.gnt-portal-layout { grid-template-rows: auto minmax(0, 1fr); }
.gnt-portal-layout--with-footer { grid-template-rows: auto minmax(0, 1fr) auto; }
.portal-topbar { display: flex; align-items: center; gap: 1rem; min-height: 50px; box-sizing: border-box; padding: 4px .75rem; color: var(--sabre-chrome-fg); white-space: nowrap; }
.portal-topbar__brand { display: flex; align-items: center; gap: .65rem; flex: 0 1 auto; min-width: 0; }
.portal-topbar__home { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 2px 4px; border: 1px solid transparent; border-radius: var(--gnt-radius); background: transparent; cursor: pointer; }
.portal-topbar__home:hover, .portal-topbar__home:focus-visible { border-color: var(--sabre-chrome-border); background: var(--sabre-chrome-border); outline: none; }
.portal-topbar__home-icon { display: block; height: 32px; width: auto; max-width: 96px; object-fit: contain; }
.portal-topbar__portal { font-size: 1.05rem; font-weight: 700; }
.portal-topbar__subtitle { color: var(--sabre-chrome-fg-muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
/* The middle section wraps onto a second line rather than pushing the page wider. */
.portal-topbar__selectors { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: .9rem; row-gap: .35rem; flex: 1 1 0; min-width: 0; }
.portal-topbar__selector { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.portal-topbar__selector label { color: var(--sabre-chrome-fg-muted); font-size: .82rem; font-weight: 600; margin: 0; }
.portal-topbar__staff-chip { font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border: 1px solid var(--sabre-chrome-border); border-radius: 999px; color: var(--sabre-chrome-fg); }
.portal-topbar__user { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex: 0 0 auto; }

/* The User menu (Shared/PortalUserMenu.razor), top right like the App's: the name, then a "User" menu that reads on the dark chrome. */
.portal-user-menu { display: flex; align-items: center; gap: .35rem; }
.portal-user-menu__name { max-width: min(420px, 40vw); overflow: hidden; text-overflow: ellipsis; font-size: .9rem; font-weight: 600; }
.portal-user-menu .e-menu-wrapper, .portal-user-menu .e-menu-wrapper ul.e-menu, .portal-user-menu .e-menu-container { background: transparent; border: none; }
.portal-user-menu .e-menu-wrapper ul .e-menu-item.e-menu-caret-icon, .portal-user-menu .e-menu-wrapper ul .e-menu-item { color: var(--sabre-chrome-fg); }
.portal-user-menu .e-menu-wrapper ul .e-menu-item .e-caret { color: var(--sabre-chrome-fg-muted); }
.portal-user-menu .e-menu-wrapper ul .e-menu-item.e-focused, .portal-user-menu .e-menu-wrapper ul .e-menu-item.e-selected { background: var(--sabre-chrome-border); color: var(--sabre-chrome-fg); }

/* The landing page's Staff / Guest switch (staff of their own tenant who are also guests elsewhere). */
.portal-landing__view-switch { display: inline-flex; align-items: center; gap: .6rem; margin-top: .75rem; color: var(--gnt-text-tertiary); font-weight: 600; }
.portal-landing__view-switch .is-on { color: var(--gnt-text-color); }
.portal-landing__view-note { margin-top: .35rem; font-size: .9rem; }

/* The App link beside Tools (Shared/PortalAppLink.razor), as Platform's header has it. */
.portal-app-link.e-btn { display: inline-flex; align-items: center; gap: .4rem; color: var(--sabre-chrome-fg); text-decoration: none; }
.portal-app-link__icon { display: block; height: 22px; width: 22px; object-fit: contain; }

/* The help button beside Tools (Shared/PortalHelpButton.razor): the App header's ?, opening the App's help reader. */
.portal-help-link.e-btn { display: inline-flex; align-items: center; color: var(--sabre-chrome-fg); text-decoration: none; }
.portal-help-link .gnt-icon { display: flex; }

/* New activity count (PNA-7): landing tiles, the Worklist nav link. */
.portal-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--gnt-danger-color); color: var(--gnt-text-inverse); font-size: .75rem; font-weight: 700; line-height: 1; }
.portal-left-nav__badge { margin-left: .4rem; }

/* Footer (Shared/PortalFooter.razor): copyright centred by the shell, the tool tray pinned right as in the App and Platform. */
.gnt-portal-layout__footer .portal-footer__right,
.portal-landing__footer .portal-footer__right { position: absolute; right: 16px; top: 0; bottom: 0; display: flex; align-items: center; gap: 14px; }

/* The no-access screen (PortalShell): the same chrome, a centred panel and the way back. */
.portal-denied__panel { max-width: 560px; padding: 2rem 2.25rem; text-align: center; background: var(--gnt-surface-color); border: 1px solid var(--gnt-border-soft); border-radius: var(--gnt-radius-md); }
.portal-denied__panel h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.portal-denied__panel p { margin: 0 0 1.25rem; color: var(--gnt-text-tertiary); line-height: 1.5; }
.portal-denied__warrior { width: 88px; height: 88px; object-fit: contain; margin-bottom: .75rem; }
.portal-denied__actions { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }
/* The User menu (Shared/PortalUserMenu.razor), top right like the App's and Tenant Admin's. */
.portal-landing__topbar-user { margin-left: auto; }
.portal-landing__unlicensed { max-width: 560px; margin: var(--gnt-space-4) auto 0; text-align: left; }
.portal-landing__unlicensed ul { margin: .25rem 0 .5rem 1.25rem; }
.portal-topbar__signout { background: none; border: 1px solid var(--gnt-border-color); border-radius: var(--gnt-radius-sm); padding: .25rem .6rem; cursor: pointer; }
.portal-topbar__link { margin-right: var(--gnt-space-3); }
.portal-left-nav { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: var(--gnt-space-2); }
.portal-left-nav__title { font-size: .95rem; font-weight: 700; margin-bottom: .35rem; }
.portal-left-nav__link { display: block; padding: .5rem .65rem; border-radius: var(--gnt-radius-sm); color: inherit; text-decoration: none; }
.portal-left-nav__link.active { background: var(--gnt-selected-bg); font-weight: 600; }

/* The landing page (Pages/Landing.razor): the same chrome as the App and Platform landing pages. */
.portal-landing {
    position: relative;
    display: flex;
    flex-direction: column;
    /* The viewport, not 100%: the landing page's parents have no height of their own, so the footer would float up. */
    height: calc(100vh / var(--gnt-zoom));
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--gnt-surface-color);
}

.portal-landing__topbar {
    display: flex;
    align-items: center;
    gap: var(--gnt-space-3);
    flex: 0 0 auto;
    min-height: 50px;
    padding: 4px 16px;
    background: var(--sabre-chrome-bg);
    color: var(--sabre-chrome-fg);
    border-bottom: 1px solid var(--sabre-chrome-border);
}

.portal-landing__logo {
    display: block;
    height: 36px;
    width: auto;
}

.portal-landing__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 0;
    padding: 24px;
    box-sizing: border-box;
}

.portal-landing__footer {
    /* The build watermark and the tray pin themselves to the ends (absolute), as in the portal shell's footer. */
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 2px 12px;
    font-size: var(--gnt-font-size-md);
    background: var(--sabre-chrome-bg);
    color: var(--sabre-chrome-fg-muted);
    border-top: 1px solid var(--sabre-chrome-border);
}

.portal-landing__header {
    width: min(960px, 100%);
    margin: 0 auto;
}

.portal-landing__header--signin {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 520px;
    padding: 0;
    text-align: center;
}

.portal-landing__brand {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 156px;
    height: auto;
}


.portal-landing__eyebrow,
.portal-landing__option-kicker {
    margin: 0 0 8px;
    font-size: var(--gnt-font-size-md);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--gnt-muted-color);
}

.portal-landing h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
}

.portal-landing h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.portal-landing p {
    margin: 10px 0 0;
    color: var(--gnt-text-tertiary);
    line-height: 1.5;
}

.portal-landing__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(960px, 100%);
    margin: 0 auto;
}

.portal-landing__option {
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: 18px;
    min-height: 250px;
    padding: 20px;
    border: 1px solid var(--gnt-border-soft);
    border-radius: var(--gnt-radius-md);
    background: var(--gnt-surface-color);
    box-shadow: var(--gnt-shadow-md);
}

.portal-landing__option--disabled {
    background: var(--gnt-surface-2);
    color: var(--gnt-muted-color);
}

.portal-landing__option small {
    color: var(--gnt-muted-color);
    line-height: 1.4;
}

.portal-landing__signin-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 760px) {
    .portal-landing {
        padding: 20px;
    }

    .portal-landing__options {
        grid-template-columns: 1fr;
    }

    .portal-landing h1 {
        font-size: 1.7rem;
    }
}

/* The signed-in list: one card per organisation, one button per portal it may open. */
.portal-landing__who { margin: 0; }

.portal-landing__orgs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(960px, 100%);
}

.portal-landing__org {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--gnt-border-soft);
    border-radius: var(--gnt-radius-md);
    background: var(--gnt-surface-color);
    box-shadow: var(--gnt-shadow-md);
    text-align: left;
}

.portal-landing__org p { margin: 0; }

.portal-landing__portals {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-landing__tag {
    display: block;
    font-size: var(--gnt-font-size-sm);
    opacity: 0.85;
}

.portal-landing__problem { font-weight: 600; }

@media (max-width: 760px) {
    .portal-landing__orgs { grid-template-columns: 1fr; }
}

/* PortalGrid: every portal list's GNTGridSelector. It fills its container; a failed load shows above it. */
.portal-grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

.portal-grid__error {
    flex: 0 0 auto;
    margin: 0 0 var(--gnt-space-2);
    color: var(--gnt-danger-text);
    font-weight: 600;
}

.portal-grid__body {
    flex: 1 1 auto;
    min-height: 0;
}

/* Record list (PortalRecordSetList): a heading over a PortalGrid that takes the rest of the tab pane. */
.portal-record-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.portal-record-list__title {
    flex: 0 0 auto;
}

.portal-record-list__grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    /* A usable height even where the pane does not bound the page's height. */
    min-height: 22rem;
}

.portal-record-list__empty {
    padding: var(--gnt-space-3) var(--gnt-space-4);
    color: var(--gnt-muted-color);
}

/* In the grid's detail pane the pane is the frame. */
.portal-record-list .portal-record-detail {
    margin-top: 0;
    border: 0;
    border-radius: 0;
}

/* Record detail (form-templates design note FT-P1): a read-only record under its list. */
.portal-record-detail {
    margin-top: var(--gnt-space-4);
    padding: var(--gnt-space-3) var(--gnt-space-4) var(--gnt-space-4);
    border: 1px solid var(--gnt-border);
    border-radius: var(--gnt-radius-lg);
    background: var(--gnt-surface-color);
}

.portal-record-detail__bar {
    display: flex;
    align-items: center;
    gap: var(--gnt-space-2);
    flex-wrap: wrap;
    margin-bottom: var(--gnt-space-2);
}

.portal-record-detail__title {
    margin: 0;
    margin-right: auto;
    font-size: 1.05rem;
}

.portal-record-detail__picker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--gnt-font-size-base);
}

.portal-record-detail__empty {
    color: var(--gnt-muted-color);
}

/* --- Contractor timesheets (ContractorTimesheetsPage + ContractorTimesheetEditorPage) ---
   Shared by both pages, scoped by their .portal-ts root. Every class sits on a plain element in
   the page markup, except .gnt-combobox (a GNTComboBox wrapper, the former ::deep rule). */
.portal-ts {
    display: flex;
    flex-direction: column;
    gap: var(--gnt-space-3);
    padding: var(--gnt-space-2) 0 var(--gnt-space-4);
}

.portal-ts__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.portal-ts__subtitle {
    margin: 0.5rem 0 0.35rem;
    font-size: var(--gnt-font-size-xl);
    font-weight: 600;
}

.portal-ts__back {
    font-size: 0.9em;
}

.portal-ts__header,
.portal-ts__toolbar,
.portal-ts__opener,
.portal-ts__new-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gnt-space-2) var(--gnt-space-3);
}

.portal-ts__open {
    display: flex;
    flex-direction: column;
    gap: var(--gnt-space-2);
    padding: var(--gnt-space-3);
    border: 1px solid var(--gnt-border-soft);
    border-radius: var(--gnt-radius-md);
    background: var(--gnt-surface-2);
}

.portal-ts__opener strong {
    min-width: 7.5rem;
}

.portal-ts__opener .gnt-combobox,
.portal-ts__toolbar .gnt-combobox {
    max-width: 18rem;
}

.portal-ts__spacer {
    flex: 1 1 auto;
}

.portal-ts__total {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.portal-ts__muted {
    color: var(--gnt-text-tertiary);
    font-size: 0.9em;
    margin: 0;
}

.portal-ts__message {
    padding: var(--gnt-space-2) var(--gnt-space-3);
    border-radius: var(--gnt-radius-md);
    background: var(--gnt-surface-2);
    color: var(--gnt-text-secondary);
}

.portal-ts__message--error { background: var(--gnt-danger-tint); color: var(--gnt-danger-text); }
.portal-ts__message--warning { background: var(--gnt-primary-tint); color: var(--gnt-text-strong); }

.portal-ts__state {
    display: inline-block;
    padding: 0 var(--gnt-space-2);
    border-radius: var(--gnt-radius-pill);
    font-size: 0.82em;
    font-weight: 600;
}

.portal-ts__state--draft { background: var(--gnt-info-tint); color: var(--gnt-info-text); }
.portal-ts__state--submitted { background: var(--gnt-primary-tint); color: var(--gnt-primary-strong); }
.portal-ts__state--accepted { background: var(--gnt-success-tint); color: var(--gnt-success-text); }
.portal-ts__state--sentback { background: var(--gnt-danger-tint); color: var(--gnt-danger-text); }

/* The timesheet list (a PortalGrid) takes what the openers leave, never less than a usable height. */
.portal-ts__list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 22rem;
}

.portal-ts__summary {
    padding: var(--gnt-space-3) var(--gnt-space-4);
}

.portal-ts__summary-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gnt-space-2);
    margin-bottom: var(--gnt-space-2);
}

.portal-ts__summary-head h3 {
    margin: 0;
    margin-right: auto;
    font-size: 1.05rem;
}

.portal-ts__summary dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--gnt-space-1) var(--gnt-space-3);
    margin: 0;
}

.portal-ts__summary dt { font-weight: 600; color: var(--gnt-text-secondary); }
.portal-ts__summary dd { margin: 0; }

/* Signed in: the warrior and title sit at the top, and the environment grid takes the rest of the page. */
.portal-landing__body--top { justify-content: flex-start; gap: 12px; padding-top: 12px; }
.portal-landing__body--top h1 { margin: 0 0 4px; }

.portal-landing__grid {
    flex: 1 1 auto;
    min-height: 240px;
    width: min(1200px, 100%);
}

.portal-landing__open { display: inline-flex; align-items: center; gap: 8px; }
.portal-landing__open-btn.e-btn { min-width: 0; padding: 1px 10px; text-decoration: none; }
.portal-landing__open-new { display: inline-flex; color: var(--gnt-text-tertiary); text-decoration: none; }
.portal-landing__open-new:hover { color: var(--gnt-text-color); }
.portal-landing__none { color: var(--gnt-text-tertiary); }

/* The wordmark sits inline in the welcome heading, in place of the word SabrePM. */
.welcome-wordmark {
    height: 1.55em;
    width: auto;
    vertical-align: -0.42em;
}
