/* ZeroPulp Employee Portal redesign - Account Management follow-ups (Users, Profiles, Locations,
   Company Info, Portals, Data Imports, Audit Logs). See zpPortal.css for the shared tokens. */

/* ------------------------------------------------------------------------------------------
   1. One header bar for every sub-page: 84px (Users' height) with the label pill and the buttons
      centred on it. It was padding-sized, so it came out 81px (Audit Logs' pills), 100px (Profiles /
      Portals: their action bar is a second .list-actions-buttons py-2 nested inside the first) and
      58px (Company Info: no buttons). Overrides the padding of zpPortal.css's
      "#users > .widget-tabs ..." and "#org-hierarchy > .widget-tabs ..." rules.
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme main .account-management-item-detail > #users > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #profiles > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #portals > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #dataImport > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #allDataImport > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #auditLogs > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #org-hierarchy > .widget-tabs,
.zp-portal-theme main .account-management-item-detail > #company-information > .widget-tabs
{
	display: flex;
	align-items: center;
	height: 84px !important;
	min-height: 84px;
	padding: 0 20px !important;
	box-sizing: border-box;
}

.zp-portal-theme main .account-management-item-detail > div > .widget-tabs > .view-tabs
{
	flex: 1 1 auto;
	min-width: 0;
	align-items: center;
}

.zp-portal-theme main .account-management-item-detail > div > .widget-tabs .list-actions-buttons
{
	align-items: center;
}

/* Profiles / Portals / Locations nest their own py-2 action bar inside the template's one */
.zp-portal-theme main .account-management-item-detail > div > .widget-tabs .list-actions-buttons .list-actions-buttons
{
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* the single-view sub-pages (Profiles, Portals, Locations, Company Info) print their label as a
   non-tab <li> - plain grey text. Show it as the same lavender pill as Users' active "All Users". */
.zp-portal-theme main .account-management-item-detail > div > .widget-tabs .nav.nav-tabs li.non-tab > a,
.zp-portal-theme main .account-management-item-detail > div > .widget-tabs .nav.nav-tabs li.non-tab > a:hover
{
	display: flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--zp-accent-tint-2) !important;
	color: var(--zp-accent-strong) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	cursor: default;
	white-space: nowrap;
}

/* the label's ul is a fixed 41/50px strip; centre the pill in it rather than top-aligning it (only
   the non-tab uls - the scrollTabs ones float their arrow buttons, which flex would break) */
.zp-portal-theme main .account-management-item-detail > div > .widget-tabs ul.nav-tabs:has(> li.non-tab)
{
	display: flex;
	align-items: center;
}

/* ------------------------------------------------------------------------------------------
   2. List card body (Users, Profiles, Portals, Data Imports, Audit Logs): the frame moves from
      .jspPane (which jScrollPane MOVES to scroll - the card shrink-wrapped the rows, ended
      mid-screen, and Data Imports' horizontal bar hung at the viewport bottom, outside it) to the
      fixed-height scroll element, sized by zpCardHeight to end 8px above the content area's
      bottom. The rows scroll inside it under the header bar. The border is an ::after overlay so it
      adds no width (a pane/element border made the content 2px wider than the pane, which is what
      put a horizontal scrollbar under these lists). Same pattern as the record lists'
      .right-content-area-scroll.smart-object-list-view in zpPortal.css.
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme main #users #recordListContainer .right-content-area-scroll,
.zp-portal-theme main #profiles #recordListContainer .right-content-area-scroll,
.zp-portal-theme main #portals #recordListContainer .right-content-area-scroll,
.zp-portal-theme main #dataImport #recordListContainer .right-content-area-scroll,
.zp-portal-theme main #allDataImport #recordListContainer .right-content-area-scroll,
.zp-portal-theme main #auditLogs #recordListContainer .right-content-area-scroll
{
	position: relative;
	background: var(--zp-surface) !important;
	border: 0 !important;
	border-radius: 0 0 var(--zp-radius-card) var(--zp-radius-card);
	box-shadow: var(--zp-shadow-card);
	overflow: hidden;
}

.zp-portal-theme main #users #recordListContainer .right-content-area-scroll::after,
.zp-portal-theme main #profiles #recordListContainer .right-content-area-scroll::after,
.zp-portal-theme main #portals #recordListContainer .right-content-area-scroll::after,
.zp-portal-theme main #dataImport #recordListContainer .right-content-area-scroll::after,
.zp-portal-theme main #allDataImport #recordListContainer .right-content-area-scroll::after,
.zp-portal-theme main #auditLogs #recordListContainer .right-content-area-scroll::after
{
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	border: 1px solid var(--zp-line);
	border-top: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 3;
}

/* the pane itself is unframed now (was: border / radius / shadow in zpPortal.css) */
.zp-portal-theme main #users #recordListContainer .jspPane,
.zp-portal-theme main #profiles #recordListContainer .jspPane,
.zp-portal-theme main #portals #recordListContainer .jspPane,
.zp-portal-theme main #dataImport #recordListContainer .jspPane,
.zp-portal-theme main #allDataImport #recordListContainer .jspPane,
.zp-portal-theme main #auditLogs #recordListContainer .jspPane
{
	background: var(--zp-surface);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

/* ------------------------------------------------------------------------------------------
   3. Locations / Company Info: the header stays a standalone card (now 84px, section 1); the
      panels under it are sized by zpCardHeight (groups.js / CompanyInfo.js setHeight) to end 8px
      above the bottom - they ran to it. Company Info's form card was .content-right-medium inside
      the scrolling #recordDetail, so the whole card (frame included) scrolled and ran past the
      bottom; the frame now sits on the fixed-height #recordDetail and only the form scrolls in it.
      Locations' detail panel gets the same treatment, its 16px gutter becoming a margin.
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme main #org-hierarchy .object-detail #recordDetail,
.zp-portal-theme main #company-information .object-detail #recordDetail
{
	background: var(--zp-surface) !important;
	border: 1px solid var(--zp-line);
	border-top: 3px solid var(--zp-accent);
	box-shadow: 0 1px 3px rgba(28,27,34,0.05);
	box-sizing: border-box;
}

.zp-portal-theme main #org-hierarchy .object-detail #recordDetail
{
	padding-left: 0 !important;
	margin-left: 16px;
}

.zp-portal-theme main #org-hierarchy #recordDetail .content-right-medium,
.zp-portal-theme main #company-information #recordDetail .content-right-medium
{
	border: 0 !important;
	box-shadow: none !important;
}

/* ------------------------------------------------------------------------------------------
   Your settings: on the same terms as every other portal page - the canvas behind, cards on it.
   - legacy pulpstream.css paints <section id='content'> #f7f6fa (a shade off the #F4F3F8 canvas) and
     .tab-block white, which put a lighter band behind the title and a white slab behind the tabs
     and both cards;
   - the Delegations pane is tagged .account-management-item-detail (pulpstream.js), so it took
     Account Management's 24px padding and its card sat inset from the Profile card's edges;
   - with the slab gone the tab row needs no inner padding (zpPortalShell.css gave it 16px).
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme main #profileManagement,
.zp-portal-theme main #profileManagement #content,
.zp-portal-theme main #profileManagement .tab-block,
.zp-portal-theme main #profileManagement .page-content
{
	background: transparent !important;
}

.zp-portal-theme main #profileManagement .main-tab-navigation
{
	padding: 0 !important;
	margin-bottom: 20px !important;
}

.zp-portal-theme main #profileManagement #delegations.account-management-item-detail
{
	padding: 0 !important;
}

.zp-portal-theme main #profileManagement #delegations .delegation-help-text
{
	margin: 0 0 16px !important;
}

/* ------------------------------------------------------------------------------------------
   Locations / Company Info: the whole page scrolls. accountManagement.js marks the Account Management
   root .zp-am-page-scroll on those two tabs; every height the setHeight code pins (main, the tab
   pane, the columns, the tree and detail cards) is released here, and groups.js / CompanyInfo.js keep
   the screen-filling height as a min-height. The class lives on the page root, so it goes when the
   page is replaced and never touches another screen's <main>.
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme main:has(> .zp-am-page-scroll)
{
	height: auto !important;
}

.zp-portal-theme main .zp-am-page-scroll .account-management-item-detail
{
	height: auto !important;
	padding-bottom: 24px !important;
}

.zp-portal-theme main .zp-am-page-scroll #org-hierarchy .object-column,
.zp-portal-theme main .zp-am-page-scroll #company-information .object-column,
.zp-portal-theme main .zp-am-page-scroll #org-hierarchy .tab-content-outer,
.zp-portal-theme main .zp-am-page-scroll #company-information .tab-content-outer,
.zp-portal-theme main .zp-am-page-scroll #org-hierarchy .right-content-area-scroll,
.zp-portal-theme main .zp-am-page-scroll #company-information .right-content-area-scroll,
.zp-portal-theme main .zp-am-page-scroll #org-hierarchy #recordDetail,
.zp-portal-theme main .zp-am-page-scroll #company-information #recordDetail
{
	height: auto !important;
	overflow: visible !important;
}

/* Your settings: the cards end 20px above the bottom (portal.js zpFitYourSettings / Delegation.js), so the
   page's own bottom padding matches - it was 64px (zpPortal.css), which scrolled the page that far past
   a card already sized to the screen */
.zp-portal-theme main #profileManagement .wrapper > .container
{
	padding-bottom: 20px;
}

/* ...and the wrappers around the Delegations card keep pulpstream.js's estimated heights (the pane:
   main - head - tabs - 43; the columns: that minus the tab bar), which clipped the card short of the
   20px line Delegation.js sizes it to. Let them follow the card. */
.zp-portal-theme main #profileManagement #delegations.account-management-item-detail,
.zp-portal-theme main #profileManagement #delegations .object-column
{
	height: auto !important;
	overflow: visible !important;
}

/* Account Management (portal and Designer): the list cards are sized to end 20px above the bottom (portal.js
   zpCardHeight), past the heights the setHeight code pins on the wrappers around them (the tab pane, the
   list / detail columns), which would clip them. Let the wrappers follow the card. Scoped to the Account
   Management page (its tab bar's sibling) - Schedules / Automations put the same class on <main>. */
.zp-portal-theme main .account-management-tab-bar ~ .account-management-item-detail,
.zp-portal-theme main .account-management-tab-bar ~ .account-management-item-detail > div > .object-column,
.zp-portal-theme main .account-management-tab-bar ~ .account-management-item-detail > div > div > .object-column
{
	height: auto !important;
	overflow: visible !important;
}

/* Company Info: no separate "Company Information" header card above the form - the name moves into the
   form card as a small heading over its General / Password Policy tabs. A ::before, because
   printCompanyInformationForm (pulpstream.js) re-renders the card's contents on Edit / Save. Hidden, not
   removed: CompanyInfo.js still builds and measures the header. */
.zp-portal-theme main #company-information > .widget-tabs
{
	display: none !important;
}

.zp-portal-theme main #company-information .object-detail #recordDetail::before
{
	content: "Company Information";
	display: block;
	/* padding, not margin: #recordDetail has no top border/padding here (zpPortalV2.css), so a top
	   margin collapsed through it and pushed the whole card down instead of the title */
	margin: 0 0 0 23px;   /* lines up with the General tab under it (the form's own inset) */
	padding-top: 20px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: var(--zp-ink);
}

/* ------------------------------------------------------------------------------------------
   User dialog (New/Edit User) + a user's detail page: the yes/no fields - Single Sign-On User and
   Give access to production - as the checkbox inline with its title, in the ordinary label style.
   Was the title with a 39px line-height and a bare checkbox dropped on the line below it. The row
   is an input's height, offset by half the neighbour's label so it sits vertically centred on that
   neighbour's label + input. The label has for=, so clicking the title toggles the box too.
   ------------------------------------------------------------------------------------------ */
.zp-portal-theme .form-input-column:has(> input#singleSignOnUser),
.zp-portal-theme .form-input-column:has(> input#productionAccess),
.zp-portal-theme .form-input-column:has(> input#productionAccessSummary)
{
	display: flex !important;
	flex-direction: row-reverse;     /* checkbox is after the label in the markup - draw it first */
	justify-content: flex-end;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	margin-top: 12px;                /* centred on the neighbour's label + input, not just its input */
}

.zp-portal-theme .form-input-column > label[for="singleSignOnUser"],
.zp-portal-theme .form-input-column > label[for="productionAccess"],
.zp-portal-theme .form-input-column > label[for="productionAccessSummary"]
{
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
	margin: 0 !important;
	line-height: normal !important;  /* the markup's inline 39px */
	cursor: pointer;
	white-space: nowrap;
}

.zp-portal-theme .form-input-column > input#singleSignOnUser,
.zp-portal-theme .form-input-column > input#productionAccess,
.zp-portal-theme .form-input-column > input#productionAccessSummary
{
	flex: none;
	width: 16px !important;
	height: 16px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	accent-color: var(--zp-accent);
	cursor: pointer;
}

.zp-portal-theme .form-input-column > input#singleSignOnUser:disabled,
.zp-portal-theme .form-input-column > input#productionAccess:disabled,
.zp-portal-theme .form-input-column > input#productionAccessSummary
{
	cursor: default;
}

/* Company Information: no Company Logo / Guest Form Header Image upload (hidden, not removed - pulpstreamTemplate.js).
   A guest form's logo is set on the form itself, from the Designer's start-form preview (designerGuestLogo.js). */
.zp-portal-theme #company-information .form-input-column:has(#companyLogo),
.zp-portal-theme #company-information .form-input-column:has(#guestFormLogo)
{
	display: none !important;
}
