﻿/*
    Styles for the redesigned site, a part at a time.
    - :root holds the colour and shape tokens. On their own they change nothing.
    - .ui-shell* is the site frame (header, menu, footer) used by the CMS master pages.
    - .ui is put on a redesigned page's content wrapper; older pages' content is not affected.
    Reusable parts: page header, toolbar (search, segmented filters), cards, status badges, empty state.
*/

:root {
    --ui-text: #101828;
    --ui-text-secondary: #475467;
    --ui-text-muted: #667085;
    --ui-border: #e4e7ec;
    --ui-border-subtle: #eaecf0;
    --ui-border-strong: #d0d5dd;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f9fafb;
    --ui-canvas: #f3f5f8;
    --ui-accent: #1d4ed8;
    --ui-accent-soft: #eff4ff;
    --ui-focus: 0 0 0 3px rgba(29, 78, 216, 0.25);
    --ui-brand: #0b2a4a;
    --ui-brand-deep: #081f38;

    --ui-success: #067647;
    --ui-success-soft: #ecfdf3;
    --ui-success-dot: #17b26a;
    --ui-progress: #175cd3;
    --ui-progress-soft: #eff8ff;
    --ui-progress-dot: #2e90fa;
    --ui-warning: #b54708;
    --ui-warning-soft: #fffaeb;
    --ui-warning-dot: #f79009;
    --ui-danger: #b42318;
    --ui-danger-soft: #fef3f2;
    --ui-danger-dot: #f04438;

    --ui-emphasis: #2563eb;
    --ui-emphasis-hover: #1d4ed8;

    --ui-radius: 12px;
    --ui-radius-sm: 8px;
    --ui-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

.ui {
    color: var(--ui-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ui *,
.ui *::before,
.ui *::after {
    box-sizing: border-box;
}

.ui a {
    color: var(--ui-accent);
    text-decoration: none;
}

.ui a:hover {
    text-decoration: underline;
}

.ui [hidden] {
    display: none !important;
}

/* Page header */

.ui-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ui .ui-page-title {
    margin: 0;
    padding: 0;
    color: var(--ui-text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
}

.ui-page-subtitle {
    margin: 4px 0 0;
    color: var(--ui-text-muted);
    font-size: 14px;
}

/* Toolbar: search and segmented filters */

.ui-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ui-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 200px;
}

.ui-search svg {
    position: absolute;
    top: 50%;
    left: 11px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: var(--ui-text-muted);
    pointer-events: none;
}

.ui .ui-search input {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 12px 0 34px;
    border: 1px solid var(--ui-border-subtle);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text);
    font: inherit;
    font-size: 14px;
}

.ui .ui-search input:focus {
    outline: none;
    border-color: var(--ui-accent);
    box-shadow: var(--ui-focus);
}

.ui-segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: #f2f4f7;
}

/* A filter is a button (filters the page in place) or a link (opens the filtered page) */
.ui .ui-segmented button,
.ui .ui-segmented a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    margin: 0;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ui-text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.ui .ui-segmented button:hover,
.ui .ui-segmented a:hover {
    color: var(--ui-text);
    text-decoration: none;
}

.ui .ui-segmented button:focus-visible,
.ui .ui-segmented a:focus-visible {
    outline: 2px solid var(--ui-accent);
    outline-offset: -2px;
    box-shadow: none;
}

.ui .ui-segmented button[aria-pressed="true"],
.ui .ui-segmented a[aria-current="page"] {
    background: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

/* Starts a new toolbar row */
.ui-toolbar-break {
    flex-basis: 100%;
    height: 0;
}

.ui-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.06);
    color: var(--ui-text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
}

.ui-count-attention {
    background: var(--ui-danger-soft);
    color: var(--ui-danger);
}

/* Card */

.ui-card {
    overflow: hidden;
    border: 1px solid var(--ui-border-subtle);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
}

/* Status badge: a dot and a label, coloured by kind */

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
}

.ui-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ui-badge-success { background: var(--ui-success-soft); color: var(--ui-success); }
.ui-badge-success::before { background: var(--ui-success-dot); }
.ui-badge-progress { background: var(--ui-progress-soft); color: var(--ui-progress); }
.ui-badge-progress::before { background: var(--ui-progress-dot); }
.ui-badge-warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.ui-badge-warning::before { background: var(--ui-warning-dot); }
.ui-badge-danger { background: var(--ui-danger-soft); color: var(--ui-danger); }
.ui-badge-danger::before { background: var(--ui-danger-dot); }
.ui-badge-muted { background: #f2f4f7; color: var(--ui-text-muted); }
.ui-badge-muted::before { background: #98a2b3; }

/* Empty state */

.ui-empty {
    padding: 48px 24px;
    text-align: center;
}

.ui-empty-title {
    margin: 0 0 4px;
    color: var(--ui-text);
    font-size: 15px;
    font-weight: 600;
}

.ui-empty-text {
    margin: 0;
    color: var(--ui-text-muted);
}

/* Portal uploads: one section per listing, its latest upload to each portal, the earlier ones folded underneath */

.ui-upload-listing + .ui-upload-listing {
    border-top: 1px solid var(--ui-border-subtle);
}

.ui-upload-listing-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 4px;
}

.ui-upload-listing .ui-log-item {
    padding: 10px 20px;
}

.ui-upload-earlier {
    padding: 0 20px 12px 66px;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.ui-upload-earlier summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.ui-upload-earlier summary::-webkit-details-marker {
    display: none;
}

.ui-upload-earlier summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.ui-upload-earlier[open] summary::before {
    transform: rotate(45deg);
}

.ui-upload-earlier .ui-log-list {
    margin-top: 6px;
    border-left: 2px solid var(--ui-border);
}

.ui-upload-listing .ui-upload-earlier .ui-log-item {
    padding: 8px 0 8px 12px;
}

.ui-upload-capped {
    margin: 4px 0 0;
    color: var(--ui-text-muted);
}

.ui-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid #fedf89;
    border-radius: var(--ui-radius);
    background: var(--ui-warning-soft);
    color: var(--ui-warning);
}

.ui-notice p {
    margin: 0;
}

.ui a.ui-notice-action {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text);
    font-weight: 600;
    white-space: nowrap;
}

.ui a.ui-notice-action:hover {
    background: var(--ui-surface-muted);
    text-decoration: none;
}

.ui-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 12px;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.ui-pager-range {
    margin-right: auto;
    color: var(--ui-text-muted);
}

.ui-pager a {
    font-weight: 500;
}

.ui-log-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-log-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    column-gap: 14px;
    padding: 14px 20px;
}

.ui-log-item + .ui-log-item {
    border-top: 1px solid #f2f4f7;
}

.ui-log-item:hover {
    background: #fcfcfd;
}

.ui-log-portal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
}

.ui-log-portal img {
    display: block;
    width: 16px;
    height: 16px;
}

.ui-log-main {
    min-width: 0;
}

.ui-log-address {
    color: var(--ui-text);
    font-weight: 600;
}

.ui a.ui-log-address {
    color: var(--ui-text);
}

.ui a.ui-log-address:hover {
    color: var(--ui-accent);
}

.ui-log-meta {
    margin-top: 1px;
    color: var(--ui-text-muted);
    font-size: 13px;
}

.ui-log-meta-sep {
    margin: 0 6px;
    color: var(--ui-border-strong);
}

.ui-log-details {
    grid-column: 2 / -1;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface-muted);
    color: var(--ui-text-secondary);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.ui-log-details-danger {
    background: var(--ui-danger-soft);
    color: var(--ui-danger);
}

.ui-log-details-warning {
    background: var(--ui-warning-soft);
    color: var(--ui-warning);
}

.ui-log-details-quiet {
    margin-top: 2px;
    padding: 0;
    background: none;
    color: var(--ui-text-muted);
}

.ui-log-side {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 22px;
}

.ui-log-when {
    color: var(--ui-text);
    font-weight: 500;
}

/* "Fixed by the upload of ...": the reason at the time follows, quietly */
.ui-log-details-fixed {
    margin-top: 4px;
    padding: 0;
    background: none;
    color: var(--ui-text-secondary);
}

.ui-log-details-fixed + .ui-log-details-quiet {
    margin-top: 0;
}

.ui-log-meta .ui-log-portal-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--ui-accent);
    font-weight: 500;
}

.ui-log-portal-link svg {
    width: 12px;
    height: 12px;
}

.ui-log-action {
    color: var(--ui-text-secondary);
    font-weight: 500;
}

.ui-log-warnings {
    grid-column: 2 / -1;
    margin-top: 8px;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.ui-log-warnings summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ui-warning);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.ui-log-warnings summary::-webkit-details-marker {
    display: none;
}

.ui-log-warnings summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.ui-log-warnings[open] summary::before {
    transform: rotate(45deg);
}

.ui-log-warnings ul {
    margin: 6px 0 0;
    padding: 8px 10px 8px 26px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-warning-soft);
    overflow-wrap: anywhere;
}

.ui-log-warnings li + li {
    margin-top: 4px;
}

.ui-guide {
    margin-top: 20px;
    padding: 16px 20px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface-muted);
}

.ui-guide-title {
    margin: 0 0 10px;
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 600;
}

.ui-guide dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 14px;
    align-items: baseline;
    margin: 0;
}

.ui-guide dt {
    margin: 0;
}

.ui-guide dd {
    margin: 0;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.ui-footnote {
    margin: 12px 2px 0;
    color: var(--ui-text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Site frame: header, menu, footer (the CMS master pages and Site.Master)
   The content column stays 850px wide with 20px padding, the size every content page was laid out for.
   ========================================================================== */

body.ui-shell-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--ui-canvas);
    -webkit-font-smoothing: antialiased;
}

body.ui-shell-body > form {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
}

.ui-shell-header,
.ui-shell-header *,
.ui-shell-nav,
.ui-shell-nav *,
.ui-shell-footer,
.ui-shell-footer * {
    box-sizing: border-box;
}

/* Header */

.ui-shell-header {
    background: linear-gradient(180deg, var(--ui-brand) 0%, var(--ui-brand-deep) 100%);
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 2px 8px rgba(8, 31, 56, 0.18);
}

.ui-shell-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 1094px;
    max-width: calc(100% - 32px);
    height: 64px;
    margin: 0 auto;
}

.ui-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

a.ui-shell-brand:hover {
    text-decoration: none;
}

/* The logo: the solid mark itself at 24px, white on the navy header, with no tile behind it */
.ui-shell-brand-mark {
    display: flex;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.ui-shell-brand-mark svg, .ui-shell-brand-mark img {
    display: block;
    width: 24px;
    height: 24px;
}

.ui-shell-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.ui-shell-brand-name {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.ui-shell-brand-sub {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 500;
}

.ui-shell-badge {
    padding: 3px 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.ui-shell-user {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 13px;
}

.ui-shell-user-who {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-right: 8px;
}

.ui-shell-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.ui-shell-user-name {
    color: #ffffff;
    font-weight: 500;
}

.ui-shell-header .ui-shell-user-link {
    padding: 6px 10px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    text-decoration: none;
}

/* Log out is a button (a POST): no button chrome, the same look as the links beside it */
.ui-shell-header button.ui-shell-user-link {
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.ui-shell-header .ui-shell-user-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.ui-shell-header .ui-shell-user-link:focus-visible,
.ui-shell-nav a:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus);
}

/* Body: menu and content */

.ui-shell {
    display: flex;
    flex: 1 0 auto;
    align-items: flex-start;
    gap: 24px;
    width: 1094px;
    margin: 0 auto;
    padding: 24px 0 32px;
}

.ui-shell-nav {
    position: sticky;
    top: 16px;
    flex: 0 0 220px;
    width: 220px;
    /* A long menu (portal admin) scrolls on its own instead of hiding its last items */
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.ui-shell-nav-section + .ui-shell-nav-section {
    margin-top: 18px;
}

.ui-shell-nav-heading {
    margin: 0 0 6px;
    padding: 0 10px;
    color: var(--ui-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The menu lists are built by MenuService.SetMenu: <ul><li class="active"><a>…</a></li></ul><br /> */
.ui-shell-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-shell-nav li {
    margin: 1px 0;
    padding: 0;
    list-style: none;
}

.ui-shell-nav br {
    display: none;
}

.ui-shell-nav li a,
.ui-shell-nav ul li.active a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--ui-text-secondary);
    font-weight: 500;
    text-decoration: none;
}

.ui-shell-nav li a:hover {
    background: #e7ebf1;
    color: var(--ui-text);
    text-decoration: none;
}

.ui-shell-nav ul li.active a,
.ui-shell-nav ul li.active a:hover {
    background: var(--ui-surface);
    color: var(--ui-accent);
    font-weight: 600;
    box-shadow: var(--ui-shadow);
}

.ui-shell-content {
    flex: 0 0 850px;
    width: 850px;
    min-height: 480px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

/* The same 20px padding as before, so content pages keep their 810px */
.ui-shell-content-inner {
    padding: 20px;
}

/* Pages without the menu (login, password recovery, error pages) */
.ui-shell-plain {
    flex: 1 0 auto;
    padding: 20px;
}

/* Footer */

.ui-shell-footer {
    border-top: 1px solid var(--ui-border);
    background: var(--ui-surface);
    color: var(--ui-text-muted);
    font-size: 13px;
}

.ui-shell-footer-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    width: 1094px;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    padding: 16px 0;
}

.ui-shell-footer a {
    color: var(--ui-text-secondary);
    font-weight: 500;
    text-decoration: none;
}

.ui-shell-footer a:hover {
    color: var(--ui-accent);
    text-decoration: underline;
}

/* Approved agency navigation. Scope every override: portal-admin and Site.Master retain PR #12. */
.ui-agency-shell { --ui-brand-raised: #16395f; --ui-emphasis: #2563eb; --ui-emphasis-hover: #1d4ed8; --ui-nav-bg: #f6f7f9; --ui-nav-hover: #eceef2; --ui-nav-current: #e3e7ec; --ui-nav-border: var(--ui-border); }
/* The page content sits open on white; the light grey menu separates it */
body.ui-agency-shell { background: var(--ui-surface); }
.ui-agency-shell .ui-shell-header [hidden], .ui-agency-shell .ui-shell-nav [hidden], .ui-agency-shell .ui-shell-nav[hidden], .ui-agency-shell .ui-shell-backdrop[hidden] { display: none !important; }
.ui-agency-shell .ui-shell-header { position: sticky; top: 0; z-index: 30; background: var(--ui-brand); box-shadow: none; }
.ui-agency-shell .ui-shell-header-inner { width: 100%; max-width: none; margin: 0; height: 56px; padding: 0 16px 0 20px; gap: 12px; }
.ui-agency-shell .ui-shell-agency-name { margin-left: -4px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Decoration only: the empty alternative text keeps screen readers from saying "slash" */
.ui-agency-shell .ui-shell-agency-name::before { content: "/"; content: "/" / ""; margin-right: 12px; color: rgba(255,255,255,.35); }
.ui-agency-shell .ui-shell { width: 100%; margin: 0; padding: 0; gap: 0; }
.ui-agency-shell .ui-shell-nav { display: flex; flex-direction: column; gap: 20px; flex: 0 0 264px; width: 264px; top: 56px; height: calc(100vh - 56px); height: calc(100dvh - 56px); max-height: none; padding: 20px 16px 0; overflow: visible; background: var(--ui-nav-bg); border-right: 1px solid var(--ui-nav-border); }
/* 8px of room on the left for the current-page bar, which sits in the gutter outside the item */
.ui-agency-shell .ui-shell-nav-links { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; margin-left: -8px; padding-left: 8px; overflow-y: auto; overscroll-behavior: contain; }
.ui-agency-shell .ui-shell-nav-links > *, .ui-agency-shell .ui-shell-new-listing { flex-shrink: 0; }
/* A hairline between the listing items and the Agency and Website pages groups */
.ui-agency-shell .ui-shell-listings + .ui-shell-group { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--ui-nav-border); }
.ui-agency-shell .ui-shell-listings, .ui-agency-shell .ui-shell-group, .ui-agency-shell .ui-shell-group-links { display: flex; flex-direction: column; gap: 2px; }
.ui-agency-shell .ui-shell-nav-link, .ui-agency-shell .ui-shell-sub-link, .ui-agency-shell .ui-shell-group-toggle, .ui-agency-shell .ui-shell-account-link {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; width: 100%; padding: 8px 10px; margin: 0; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-text-secondary); font: inherit; font-size: 14px; font-weight: 500; line-height: 20px; text-align: left; text-decoration: none; cursor: pointer;
}
.ui-agency-shell .ui-shell-sub-link { min-height: 32px; padding: 6px 10px 6px 40px; }
.ui-agency-shell .ui-shell-link-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ui-agency-shell .ui-shell-icon, .ui-agency-shell .ui-shell-new-listing img { flex-shrink: 0; }
/* Points right when the group is closed and turns down when it opens. It turns only once the script has set each
   group's first state (ui-nav-animate), so closed groups don't spin on every page load. */
.ui-agency-shell .ui-shell-chevron { flex: 0 0 16px; width: 16px; height: 16px; }
.ui-agency-shell.ui-nav-animate .ui-shell-chevron { transition: transform .15s ease; }
.ui-agency-shell .ui-shell-chevron img { transform: scale(.8); transform-origin: top left; }
.ui-agency-shell .ui-shell-group-toggle[aria-expanded="true"] .ui-shell-chevron { transform: rotate(90deg); }
.ui-agency-shell .ui-shell-nav-link:hover, .ui-agency-shell .ui-shell-sub-link:hover, .ui-agency-shell .ui-shell-group-toggle:hover { background: var(--ui-nav-hover); color: var(--ui-text); text-decoration: none; }
.ui-agency-shell .ui-shell-account-link:hover { background: var(--ui-surface-muted); text-decoration: none; }
/* The current page: a grey tile, dark semibold text and a blue bar in the gutter, no border. Never colour alone. */
.ui-agency-shell .ui-shell-nav-links [aria-current="page"] { background: var(--ui-nav-current); color: var(--ui-text); font-weight: 600; }
/* The group holding the current page is semibold; when it is closed it also carries the bar, so the place is never lost */
.ui-agency-shell .ui-shell-group[data-current="true"] > .ui-shell-group-toggle { color: var(--ui-text); font-weight: 600; }
.ui-agency-shell .ui-shell-nav-links [aria-current="page"]::before, .ui-agency-shell .ui-shell-current-closed > .ui-shell-group-toggle::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 2px; background: var(--ui-emphasis); }
.ui-agency-shell .ui-shell-account [aria-current="page"] { background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 600; }
.ui-agency-shell .ui-shell-attention { padding: 1px 7px; border-radius: 999px; color: var(--ui-danger); background: var(--ui-danger-soft); font-size: 12px; font-weight: 500; line-height: 16px; }
.ui-agency-shell .ui-shell-new-listing { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: var(--ui-radius-sm); background: var(--ui-emphasis); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); color: #fff; font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none; }
.ui-agency-shell .ui-shell-new-listing:hover { background: var(--ui-emphasis-hover); text-decoration: none; }
.ui-agency-shell .ui-shell-new-listing img { width: 16px; height: 16px; }
/* Fills the window below the header, so the white content area reaches the bottom on short pages */
.ui-agency-shell .ui-shell-content-viewport { box-sizing: border-box; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); padding: 28px 32px 0; overflow-x: auto; background: var(--ui-surface); }
/* Do not change the existing 850px column or its 20px inner padding. */
.ui-agency-shell .ui-shell-content { flex: 0 0 auto; min-height: 0; margin-bottom: 32px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
/* A page laid out for any width (the home page) narrows with the window instead of keeping 850px */
.ui-agency-shell .ui-shell-content-fluid { width: 100%; max-width: 850px; }
/* One line at the bottom of the menu */
.ui-agency-shell .ui-shell-nav-footer { flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; min-height: 44px; padding: 4px 0; color: var(--ui-text-muted); font-size: 12px; line-height: 16px; }
.ui-agency-shell .ui-shell-nav-footer a { margin-left: .3em; color: var(--ui-text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.ui-agency-shell .ui-shell-nav-footer a:hover { color: var(--ui-text); }
.ui-agency-shell .ui-shell-account-slot { margin-left: auto; flex-shrink: 0; }
.ui-agency-shell .ui-shell-account { position: relative; font-size: 14px; line-height: 20px; }
.ui-agency-shell .ui-shell-account-button { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; padding: 6px 10px 6px 6px; background: var(--ui-brand-raised); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.ui-agency-shell .ui-shell-avatar { flex: 0 0 30px; background: var(--ui-accent); box-shadow: none; font-size: 14px; }
.ui-agency-shell .ui-shell-account-who { display: flex; flex-direction: column; min-width: 0; }
.ui-agency-shell .ui-shell-account-name { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-agency-shell .ui-shell-account-role { font-size: 12px; line-height: 14px; opacity: .62; }
/* The header keeps it simple: the role shows in the account options (and in the phone drawer) */
.ui-agency-shell .ui-shell-account-slot .ui-shell-account-role { display: none; }
.ui-agency-shell .ui-shell-account-options { width: 280px; padding: 8px; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 12px; box-shadow: var(--ui-shadow); color: var(--ui-text); }
html.ui-js .ui-agency-shell .ui-shell-account-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; max-height: calc(100dvh - 80px); overflow-y: auto; }
.ui-agency-shell .ui-shell-account-summary { display: flex; flex-direction: column; gap: 2px; padding: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--ui-border); overflow-wrap: anywhere; }
.ui-agency-shell .ui-shell-account-summary strong { font-size: 14px; font-weight: 600; }
.ui-agency-shell .ui-shell-account-summary span { font-size: 13px; line-height: 18px; color: var(--ui-text-muted); }
.ui-agency-shell .ui-shell-logout { display: block; position: relative; margin-top: 4px; border-top: 1px solid var(--ui-border); padding-top: 4px; }
.ui-agency-shell .ui-shell-logout > img { position: absolute; top: 16px; left: 10px; pointer-events: none; }
.ui-agency-shell .ui-shell-logout .ui-shell-account-link { padding-left: 40px; }
.ui-agency-shell .ui-shell-account-link { min-height: 44px; }
.ui-agency-shell .ui-shell-menu-open, .ui-agency-shell .ui-shell-mobile-title, .ui-agency-shell .ui-shell-drawer-header, .ui-agency-shell .ui-shell-mobile-account-slot, .ui-agency-shell .ui-shell-account-chevron-mobile { display: none; }
.ui-agency-shell .ui-shell-icon-button { align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; flex-shrink: 0; }
.ui-agency-shell .ui-shell-header a:focus-visible, .ui-agency-shell .ui-shell-header button:focus-visible, .ui-agency-shell .ui-shell-nav button:focus-visible, .ui-agency-shell .ui-shell-nav a:focus-visible, .ui-agency-shell .ui-shell-account-options a:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: -2px; box-shadow: var(--ui-focus); }
.ui-agency-shell .ui-shell-header button:focus-visible, .ui-agency-shell .ui-shell-header a:focus-visible { outline-color: #fff; }
/* A blue ring disappears on the blue button: a dark ring around it instead */
.ui-agency-shell .ui-shell-new-listing:focus-visible { outline: 2px solid var(--ui-text); outline-offset: 2px; box-shadow: none; }
/* In-page links and focused fields stop below the sticky header, not under it */
.ui-agency-root { scroll-padding-top: 72px; }
.ui-agency-shell .ui-shell-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* With JS on, the page is drawn in the state agency-navigation.js will set, so nothing moves while the script loads
   (html.ui-js is set in the head, before anything is drawn). The script still sets the real state. */
html.ui-js .ui-agency-shell:not(.ui-nav-ready) .ui-shell-account-options { display: none; }
html.ui-js .ui-agency-shell:not(.ui-nav-ready) .ui-shell-group[data-current="false"][data-default-open="false"] > :not(button) { display: none; }
html.ui-js .ui-agency-shell:not(.ui-nav-ready) .ui-shell-group[data-current="false"][data-default-open="false"] .ui-shell-chevron { transform: none; }
/* Progressive enhancement: without JS all links and account actions remain visible. */
html:not(.ui-js) .ui-agency-shell .ui-shell-header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
html:not(.ui-js) .ui-agency-shell .ui-shell-nav { position: static; height: auto; }
html:not(.ui-js) .ui-agency-shell .ui-shell-nav-links { overflow: visible; }

/* The menu becomes a drawer below 1200px: beside the 264px menu and the 32px padding, the 850px column every older page
   is laid out for needs 1178px plus a scrollbar. Keep in step with agency-navigation.js. */
@media (max-width: 1199px) {
    .ui-agency-shell .ui-shell { display: block; }
    html.ui-js .ui-agency-shell:not(.ui-nav-ready) .ui-shell-nav { display: none; }
    .ui-agency-shell .ui-shell-content-viewport { min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); padding: 16px 16px 0; }
    html.ui-js .ui-agency-shell .ui-shell-header-inner { height: 56px; padding: 0 16px 0 4px; gap: 8px; }
    html.ui-js .ui-agency-shell .ui-shell-header .ui-shell-brand, html.ui-js .ui-agency-shell .ui-shell-agency-name, html.ui-js .ui-agency-shell .ui-shell-account-slot { display: none; }
    html.ui-js .ui-agency-shell .ui-shell-menu-open { display: flex; }
    html.ui-js .ui-agency-shell .ui-shell-mobile-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
    html.ui-js .ui-agency-shell .ui-shell-nav { position: fixed; z-index: 60; top: 0; left: 0; width: 320px; max-width: calc(100% - 44px); height: 100vh; height: 100dvh; gap: 12px; padding: 12px; border: 0; }
    .ui-agency-shell .ui-shell-nav-link, .ui-agency-shell .ui-shell-sub-link, .ui-agency-shell .ui-shell-group-toggle, .ui-agency-shell .ui-shell-new-listing { min-height: 44px; }
    .ui-agency-shell .ui-shell-content-fluid .ui-shell-content-inner { padding: 8px 0 0; }
    html.ui-js .ui-agency-shell .ui-shell-drawer-header { display: flex; align-items: center; gap: 10px; padding-left: 4px; min-height: 44px; flex-shrink: 0; }
    /* The logo in navy on the white drawer, as in the header: the mark alone, 24px */
    .ui-agency-shell .ui-shell-drawer-mark { display: flex; flex-shrink: 0; width: 24px; height: 24px; }
    .ui-agency-shell .ui-shell-drawer-mark img { display: block; width: 24px; height: 24px; }
    .ui-agency-shell .ui-shell-drawer-brand { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
    .ui-agency-shell .ui-shell-drawer-brand strong { color: var(--ui-text); font-size: 14px; font-weight: 600; }
    .ui-agency-shell .ui-shell-drawer-brand > span { color: var(--ui-text-muted); font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ui-agency-shell .ui-shell-drawer-header button { display: flex; }
    html.ui-js .ui-agency-shell .ui-shell-mobile-account-slot { display: block; flex-shrink: 0; }
    .ui-agency-shell .ui-shell-mobile-account-slot { padding-top: 8px; border-top: 1px solid var(--ui-nav-border); }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-button { width: 100%; min-height: 58px; padding: 10px 8px; color: var(--ui-text); background: transparent; }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-button:hover { background: var(--ui-nav-hover); }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-button[aria-expanded="true"] { background: var(--ui-nav-current); }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-avatar { width: 32px; height: 32px; flex-basis: 32px; }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-who { flex: 1; }
    .ui-agency-root { scroll-padding-top: 72px; }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-role { color: var(--ui-text-secondary); opacity: 1; font-size: 13px; line-height: 18px; }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-chevron-desktop { display: none; }
    .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-chevron-mobile { display: block; }
    .ui-agency-shell .ui-shell-mobile-account-slot [aria-expanded="true"] .ui-shell-account-chevron-mobile { transform: rotate(180deg); }
    html.ui-js .ui-agency-shell .ui-shell-mobile-account-slot .ui-shell-account-options { top: auto; bottom: calc(100% + 8px); width: 100%; max-height: calc(100dvh - 100px); }
    .ui-agency-shell .ui-shell-backdrop { position: fixed; z-index: 50; inset: 0; background: rgba(15,23,41,.45); }
    .ui-agency-shell.ui-shell-drawer-open { overflow: hidden; }
    html:not(.ui-js) .ui-agency-shell .ui-shell-nav { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ui-agency-shell.ui-nav-animate .ui-shell-chevron { transition: none; }
}

/* ==========================================================================
   Redesigned pages (Figma "AgencyHub · Admin redesign"): a grey canvas with white cards, the content as wide as the
   window allows, and the shared parts below. A page opts in through its master (Cms.RedesignedPage, and every
   portal admin, sign-in and print page), which puts ui-pro on the body; older pages keep the 850px white column.
   ========================================================================== */

/* The menu is white everywhere; next to an older page's white content it keeps its hairline */
.ui-agency-shell { --ui-nav-bg: #ffffff; --ui-nav-hover: #f2f4f7; --ui-nav-current: #eceff3; }
.ui-agency-shell.ui-pro .ui-shell-nav { border-right-color: transparent; }
.ui-agency-shell.ui-pro .ui-shell-content-viewport { background: var(--ui-canvas); }
.ui-agency-shell.ui-pro .ui-shell-content { width: 100%; max-width: 1320px; }
.ui-agency-shell.ui-pro .ui-shell-content-inner { padding: 0; }

.ui .ui-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui .ui-breadcrumb { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--ui-text-muted); font-size: 13px; }
.ui .ui-breadcrumb a { color: var(--ui-text-muted); }
.ui .ui-breadcrumb a:hover { color: var(--ui-text); }
.ui .ui-breadcrumb-sep::before { content: "\203A"; color: var(--ui-border-strong); }
.ui .ui-stack { display: flex; flex-direction: column; gap: 20px; }

/* Buttons: one primary per view; secondary for supporting actions; ghost for quiet ones; danger for destructive ones */
.ui .ui-btn, .ui a.ui-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0; padding: 0 14px;
    border: 1px solid transparent; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-text);
    font: inherit; font-size: 14px; font-weight: 600; line-height: 20px; white-space: nowrap; text-decoration: none; cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.ui .ui-btn:hover, .ui a.ui-btn:hover { text-decoration: none; }
.ui .ui-btn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.ui .ui-btn[disabled], .ui .ui-btn.aspNetDisabled { opacity: .5; cursor: default; pointer-events: none; }
.ui .ui-btn img, .ui .ui-btn svg { flex-shrink: 0; width: 16px; height: 16px; }
.ui .ui-btn-primary, .ui a.ui-btn-primary { background: var(--ui-emphasis); color: #ffffff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.ui .ui-btn-primary:hover, .ui a.ui-btn-primary:hover { background: var(--ui-emphasis-hover); color: #ffffff; }
.ui .ui-btn-secondary, .ui a.ui-btn-secondary { border-color: var(--ui-border-strong); background: var(--ui-surface); color: var(--ui-text); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.ui .ui-btn-secondary:hover, .ui a.ui-btn-secondary:hover { background: var(--ui-surface-muted); color: var(--ui-text); }
.ui .ui-btn-ghost, .ui a.ui-btn-ghost { color: var(--ui-text-secondary); }
.ui .ui-btn-ghost:hover, .ui a.ui-btn-ghost:hover { background: #f2f4f7; color: var(--ui-text); }
.ui .ui-btn-danger, .ui a.ui-btn-danger { background: var(--ui-danger); color: #ffffff; }
.ui .ui-btn-danger:hover, .ui a.ui-btn-danger:hover { background: #912018; color: #ffffff; }
.ui .ui-btn-sm, .ui a.ui-btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.ui .ui-btn-block { width: 100%; }

/* Fields: label above a 36px control. Units and hints sit with the control, never in the label. */
.ui .ui-form { display: flex; flex-direction: column; gap: 16px; }
.ui .ui-form-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.ui .ui-form-row > .ui-field { flex: 1 1 200px; min-width: 0; }
.ui .ui-form-row > .ui-field-narrow { flex: 0 0 120px; }
.ui .ui-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ui .ui-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ui .ui-label, .ui .ui-field > label { margin: 0; color: var(--ui-text-secondary); font-size: 13px; font-weight: 500; line-height: 18px; }
.ui .ui-required::after { content: " *"; color: var(--ui-danger); }
.ui .ui-input, .ui input.ui-input, .ui select.ui-input, .ui textarea.ui-input {
    display: block; box-sizing: border-box; width: 100%; height: 36px; margin: 0; padding: 0 12px;
    border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface);
    color: var(--ui-text); font: inherit; font-size: 14px; line-height: 20px;
}
.ui textarea.ui-input { height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; }
.ui select.ui-input { padding-right: 32px; -webkit-appearance: none; appearance: none; background: var(--ui-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
.ui .ui-input:focus { outline: none; border-color: var(--ui-accent); box-shadow: var(--ui-focus); }
.ui .ui-input[readonly], .ui .ui-input[disabled], .ui .ui-input.aspNetDisabled { background-color: var(--ui-surface-muted); color: var(--ui-text-secondary); }
.ui .ui-input::placeholder { color: #98a2b3; }
.ui .ui-hint { margin: 0; color: var(--ui-text-muted); font-size: 12px; line-height: 16px; }
/* Validators render a span next to the field: the message under it, in red */
.ui .ui-field-error, .ui .ui-field .error_msg { display: block; margin: 0; color: var(--ui-danger); font-size: 12px; line-height: 16px; }
/* asp:CheckBox and RadioButtonList render input + label; keep them on one line with room to tap */
.ui .ui-check { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; color: var(--ui-text); font-size: 14px; }
.ui .ui-check input, .ui .ui-checks input { width: 16px; height: 16px; margin: 0; accent-color: var(--ui-emphasis); }
.ui .ui-check label, .ui .ui-checks label { margin: 0; cursor: pointer; }
.ui .ui-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ui .ui-checks > span, .ui .ui-checks td { display: inline-flex; align-items: center; gap: 8px; }
/* RadioButtonList and CheckBoxList render a table, so the gap has to reach its rows */
.ui table.ui-checks > tbody, .ui table.ui-checks tr { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Cards: a white surface with a header and a padded body */
.ui .ui-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--ui-border-subtle); }
.ui .ui-card-title { margin: 0; color: var(--ui-text); font-size: 15px; font-weight: 600; line-height: 20px; }
.ui .ui-card-desc { margin: 2px 0 0; color: var(--ui-text-muted); font-size: 13px; line-height: 18px; }
.ui .ui-card-body { padding: 20px; }
.ui .ui-card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--ui-border-subtle); background: var(--ui-surface-muted); }
.ui .ui-card + .ui-card { margin-top: 20px; }
.ui .ui-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ui .ui-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.ui .ui-kv dt { color: var(--ui-text-muted); font-size: 13px; }
.ui .ui-kv dd { margin: 0; color: var(--ui-text); font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* Tabs: links to the sibling lists, each with its count; the current one is underlined */
.ui .ui-tabs { display: flex; gap: 24px; margin: 0 0 20px; border-bottom: 1px solid var(--ui-border); overflow-x: auto; }
.ui .ui-tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 2px; color: var(--ui-text-secondary); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.ui .ui-tabs a:hover { color: var(--ui-text); text-decoration: none; }
.ui .ui-tabs a[aria-current="page"] { color: var(--ui-text); font-weight: 600; }
.ui .ui-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ui-emphasis); }
.ui .ui-tabs a[aria-current="page"] .ui-count { background: var(--ui-accent-soft); color: var(--ui-accent); }
.ui .ui-tabs a:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* A card's toolbar row: search fields, filters and the sort, above its table */
.ui .ui-card > .ui-toolbar { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--ui-border-subtle); }
.ui .ui-toolbar .ui-input { width: auto; }
.ui .ui-toolbar-spacer { flex: 1; }

/* Data tables (asp:GridView with CssClass="ui-table" and GridLines="None") */
.ui table.ui-table { width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; background: var(--ui-surface); font-size: 14px; line-height: 20px; }
.ui .ui-table th { padding: 10px 16px; border: 0; border-bottom: 1px solid var(--ui-border-subtle); background: var(--ui-surface-muted); color: var(--ui-text-secondary); font-size: 12px; font-weight: 500; line-height: 16px; text-align: left; white-space: nowrap; }
.ui .ui-table th a { color: inherit; }
.ui .ui-table th a:hover { color: var(--ui-text); text-decoration: none; }
/* The sortable headers: a small two-way arrow after the label */
.ui .ui-table th a::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 4px; vertical-align: -1px; opacity: .55; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23475467' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4l2-2 2 2M3 6l2 2 2-2'/%3E%3C/svg%3E") center / 10px no-repeat; }
.ui .ui-table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--ui-border-subtle); color: var(--ui-text); vertical-align: middle; }
.ui .ui-table tr:last-child > td { border-bottom: 0; }
.ui .ui-table tbody tr:hover > td { background: #fcfcfd; }
.ui .ui-table tr[data-href]:not([data-href=""]) { cursor: pointer; }
.ui .ui-table tr[data-href]:not([data-href=""]):hover .ui-row-title { color: var(--ui-accent); }
.ui .ui-table .ui-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui .ui-table .ui-nowrap { white-space: nowrap; }
.ui .ui-table .ui-muted { color: var(--ui-text-secondary); }
.ui .ui-table .ui-col-actions { width: 1%; padding-left: 8px; padding-right: 12px; text-align: right; white-space: nowrap; }
.ui .ui-row-title { display: block; color: var(--ui-text); font-weight: 600; }
.ui a.ui-row-title:hover { color: var(--ui-accent); text-decoration: none; }
.ui .ui-row-sub { display: block; margin-top: 2px; color: var(--ui-text-muted); font-size: 13px; line-height: 18px; }
.ui .ui-row-sub a { color: var(--ui-text-muted); text-decoration: underline; text-decoration-color: var(--ui-border-strong); text-underline-offset: 2px; }
.ui .ui-row-sub a:hover { color: var(--ui-accent); }
.ui .ui-table-scroll { overflow-x: auto; }
/* The grid's pager is its last row: page links on the right */
.ui .ui-table tr.ui-table-pager > td { padding: 10px 16px; border-top: 1px solid var(--ui-border-subtle); background: var(--ui-surface); text-align: right; }
.ui .ui-table tr.ui-table-pager table { display: inline-table; margin: 0; border-collapse: separate; border-spacing: 4px 0; }
.ui .ui-table tr.ui-table-pager td td { padding: 0; border: 0; background: none; }
.ui .ui-table tr.ui-table-pager a, .ui .ui-table tr.ui-table-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-text); font-size: 13px; font-weight: 500; }
.ui .ui-table tr.ui-table-pager a:hover { background: var(--ui-surface-muted); text-decoration: none; }
.ui .ui-table tr.ui-table-pager span { border-color: var(--ui-emphasis); background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 600; }
.ui .ui-table-footer { padding: 10px 16px; border-top: 1px solid var(--ui-border-subtle); color: var(--ui-text-secondary); font-size: 13px; }

/* Row menu: the "⋯" button opens the row's actions (ui.js). Without script every action stays listed. */
.ui .ui-menu { position: relative; display: inline-block; text-align: left; }
.ui .ui-menu-trigger { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-text-secondary); cursor: pointer; }
.ui .ui-menu-trigger:hover, .ui .ui-menu[data-open] .ui-menu-trigger { border-color: var(--ui-border-strong); background: var(--ui-surface); color: var(--ui-text); }
.ui .ui-menu-trigger:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 1px; }
.ui .ui-menu-trigger svg { width: 16px; height: 16px; }
.ui .ui-menu-list { display: flex; flex-direction: column; min-width: 220px; padding: 6px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface); box-shadow: 0 12px 24px -6px rgba(16, 24, 40, .14), 0 4px 8px -2px rgba(16, 24, 40, .06); }
html.ui-js .ui .ui-menu-list { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; display: none; }
html.ui-js .ui .ui-menu[data-open] .ui-menu-list { display: flex; }
html:not(.ui-js) .ui .ui-menu-trigger { display: none; }
html:not(.ui-js) .ui .ui-menu-list { min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; flex-direction: row; flex-wrap: wrap; gap: 4px; }
.ui .ui-menu-label { padding: 6px 10px 4px; color: var(--ui-text-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ui .ui-menu-item, .ui a.ui-menu-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--ui-text); font-size: 14px; font-weight: 400; text-decoration: none; white-space: nowrap; cursor: pointer; }
.ui .ui-menu-item:hover, .ui .ui-menu-item:focus-visible { background: #f2f4f7; color: var(--ui-text); text-decoration: none; outline: none; }
.ui .ui-menu-item img { width: 16px; height: 16px; opacity: .75; }
.ui .ui-menu-item .ui-count { margin-left: auto; }
.ui .ui-menu-item-danger, .ui a.ui-menu-item-danger { color: var(--ui-danger); }
.ui .ui-menu-item-danger:hover { background: var(--ui-danger-soft); color: var(--ui-danger); }
.ui .ui-menu-sep { height: 1px; margin: 6px 4px; border: 0; background: var(--ui-border-subtle); }

/* Messages above a form or list */
.ui .ui-alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 14px; line-height: 20px; }
.ui .ui-alert:empty { display: none; }
.ui .ui-alert ul { margin: 0; padding-left: 18px; }
.ui .ui-alert-error { border-color: #fecdca; background: var(--ui-danger-soft); color: var(--ui-danger); }
.ui .ui-alert-success { border-color: #abefc6; background: var(--ui-success-soft); color: var(--ui-success); }
.ui .ui-alert-info { border-color: #b2ccff; background: var(--ui-accent-soft); color: #1e40af; }
.ui .ui-alert-warning { border-color: #fedf89; background: var(--ui-warning-soft); color: var(--ui-warning); }

/* Partial updates: a small pill in place of the old progress text */
.ui .ui-progress { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: var(--ui-surface); box-shadow: var(--ui-shadow); color: var(--ui-text-secondary); font-size: 13px; }
.ui .ui-progress::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--ui-border-strong); border-top-color: var(--ui-emphasis); border-radius: 50%; animation: ui-spin .7s linear infinite; }
.ui .ui-progress-slot { display: flex; justify-content: center; min-height: 0; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Dialogs (ajaxToolkit:ModalPopupExtender): a centred card over a dimmed page */
.ui-dialog-backdrop { background: rgba(15, 23, 41, .45); }
.ui .ui-dialog, .ui-dialog { box-sizing: border-box; width: min(460px, calc(100vw - 32px)); border-radius: 14px; background: var(--ui-surface); box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .25); color: var(--ui-text); font-size: 14px; line-height: 20px; text-align: left; }
.ui-dialog .ui-dialog-body { display: flex; gap: 14px; padding: 24px; }
.ui-dialog .ui-dialog-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.ui-dialog .ui-dialog-text { margin: 0; color: var(--ui-text-secondary); }
.ui-dialog .ui-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-radius: 0 0 14px 14px; background: var(--ui-surface-muted); }
.ui-dialog-icon { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ui-danger-soft); color: var(--ui-danger); }
.ui-dialog-icon svg { width: 20px; height: 20px; }

.ui .ui-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 50%; background: #f2f4f7; color: var(--ui-text-secondary); }
.ui .ui-empty-icon svg { width: 22px; height: 22px; }
.ui .ui-empty .ui-btn { margin-top: 16px; }
.ui .ui-badge-plain::before { display: none; }

@media (max-width: 899px) {
    .ui .ui-page-header { flex-direction: column; align-items: stretch; }
    .ui .ui-columns { grid-template-columns: minmax(0, 1fr); }
    .ui .ui-table .ui-hide-sm { display: none; }
    .ui .ui-btn, .ui a.ui-btn { min-height: 44px; }
    .ui .ui-input { height: 44px; }
}

/* ==========================================================================
   Portal administration frame (CmsAdmin.Master): the agency frame's header and white menu, the menu built by
   MenuService.SetMenu as <ul><li class="active"><a>.
   ========================================================================== */

.ui-admin-shell .ui-shell-header { position: sticky; top: 0; z-index: 30; background: var(--ui-brand); box-shadow: none; }
.ui-admin-shell .ui-shell-header-inner { width: 100%; max-width: none; height: 64px; margin: 0; padding: 0 24px; }
.ui-admin-shell .ui-shell { width: 100%; margin: 0; padding: 0; gap: 0; align-items: stretch; }
.ui-admin-shell .ui-shell-nav { position: sticky; top: 64px; flex: 0 0 264px; width: 264px; height: calc(100vh - 64px); max-height: none; padding: 20px 16px; overflow-y: auto; background: #ffffff; }
.ui-admin-shell .ui-shell-nav li a, .ui-admin-shell .ui-shell-nav ul li.active a { display: flex; align-items: center; min-height: 34px; padding: 7px 10px; border-radius: var(--ui-radius-sm); color: var(--ui-text-secondary); font-weight: 500; }
.ui-admin-shell .ui-shell-nav li a:hover { background: #f2f4f7; color: var(--ui-text); }
.ui-admin-shell .ui-shell-nav ul li.active a, .ui-admin-shell .ui-shell-nav ul li.active a:hover { position: relative; background: #eceff3; color: var(--ui-text); font-weight: 600; box-shadow: none; }
.ui-admin-shell .ui-shell-nav ul li.active a::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 2px; background: #2563eb; }
.ui-admin-shell .ui-shell-content { flex: 1 1 auto; width: auto; min-width: 0; min-height: calc(100vh - 64px); border: 0; border-radius: 0; background: var(--ui-canvas); box-shadow: none; }
.ui-admin-shell .ui-shell-content-inner { max-width: 1320px; padding: 28px 32px 40px; }
.ui-admin-shell .ui-shell-user-link { white-space: nowrap; }
@media (max-width: 899px) {
    .ui-admin-shell .ui-shell { flex-direction: column; }
    .ui-admin-shell .ui-shell-nav { position: static; width: 100%; height: auto; flex-basis: auto; border-bottom: 1px solid var(--ui-border); }
    .ui-admin-shell .ui-shell-content-inner { padding: 16px; }
    .ui-admin-shell .ui-shell-user-who { display: none; }
}

/* ==========================================================================
   Sign-in and account pages (Site.Master): one centred card on the grey canvas
   ========================================================================== */

.ui-auth-shell .ui-shell-header { background: var(--ui-brand); box-shadow: none; }
.ui-auth-shell .ui-shell-plain { display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; }
.ui-auth-shell .ui-shell-footer { border-top: 0; background: transparent; }
.ui .ui-auth-card { box-sizing: border-box; width: 100%; max-width: 420px; padding: 32px; border: 1px solid var(--ui-border-subtle); border-radius: 16px; background: var(--ui-surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -8px rgba(16, 24, 40, .08); }
.ui .ui-auth-card-wide { max-width: 560px; }
.ui .ui-auth-title { margin: 0; color: var(--ui-text); font-size: 22px; font-weight: 600; line-height: 28px; text-align: left; }
.ui .ui-auth-text { margin: 6px 0 24px; color: var(--ui-text-secondary); }
.ui .ui-auth-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ui .ui-auth-footer { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--ui-border-subtle); color: var(--ui-text-muted); font-size: 13px; text-align: center; }
.ui .ui-auth-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent); }
.ui .ui-auth-icon svg { width: 22px; height: 22px; }
.ui .ui-code-input { letter-spacing: .3em; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Print pages (the Print masters): an A4 sheet on screen with a toolbar; only the sheet prints
   ========================================================================== */

body.ui-print-body { margin: 0; background: var(--ui-canvas); color: var(--ui-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 13px; -webkit-font-smoothing: antialiased; }
.ui-print-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--ui-border); background: var(--ui-surface); }
.ui-print-sheet { box-sizing: border-box; width: 210mm; max-width: calc(100% - 32px); min-height: 200mm; margin: 24px auto 40px; padding: 14mm 14mm 16mm; background: #ffffff; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px -8px rgba(16, 24, 40, .1); }
.ui-print-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ui-text); }
.ui-print-brand { color: var(--ui-text-muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ui-print-date { color: var(--ui-text-muted); font-size: 11px; white-space: nowrap; }
.ui-print-foot { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--ui-border); color: var(--ui-text-muted); font-size: 10px; text-align: center; }
.ui-print .ui-page-title, .ui-print h1 { margin: 0; color: var(--ui-text); font-size: 20px; font-weight: 600; line-height: 26px; text-align: left; }
.ui-print .ui-print-subtitle { margin: 2px 0 0; color: var(--ui-text-secondary); font-size: 12px; }
.ui-print .ui-print-section + .ui-print-section { margin-top: 18px; }
.ui-print .ui-print-section-title { margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--ui-border); color: var(--ui-text); font-size: 13px; font-weight: 600; }
.ui-print table.ui-table { width: 100%; border: 0; border-collapse: collapse; font-size: 11.5px; line-height: 16px; }
.ui-print .ui-table th { padding: 6px 8px; border: 0; border-bottom: 1px solid var(--ui-text); background: none; color: var(--ui-text); font-size: 10.5px; font-weight: 600; text-align: left; white-space: nowrap; }
.ui-print .ui-table th a { color: inherit; text-decoration: none; }
.ui-print .ui-table td { padding: 6px 8px; border: 0; border-bottom: 1px solid var(--ui-border); vertical-align: top; }
.ui-print .ui-table tr { page-break-inside: avoid; }
.ui-print .ui-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-print .ui-kv { display: grid; grid-template-columns: 34mm 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.ui-print .ui-kv dt { margin: 0; color: var(--ui-text-muted); }
.ui-print .ui-kv dd { margin: 0; color: var(--ui-text); overflow-wrap: anywhere; }
.ui-print-photo { width: 32mm; height: 32mm; object-fit: cover; border-radius: 4px; }
@page { size: A4; margin: 12mm; }
@media print {
    body.ui-print-body { background: #ffffff; }
    .ui-print-toolbar { display: none; }
    .ui-print-sheet { width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
    .ui-print .ui-table th { border-bottom-color: #000000; }
}

/* The credit line at the bottom of the portal admin menu (the agency frame has its own) */
.ui-admin-shell .ui-shell-nav-credit { margin: 24px 0 0; padding: 0 10px; color: var(--ui-text-muted); font-size: 12px; line-height: 16px; }
.ui-admin-shell .ui-shell-nav-credit a { color: var(--ui-text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.ui-auth-shell .ui-shell-footer-inner { justify-content: center; }

/* Print pages: small additions to the Print masters' sheet */
/* Space between the title block and the first section (the sheet only spaced section + section) */
.ui.ui-print .ui-print-section { margin-top: 18px; }
/* A paragraph of text in a section (comments, an agent's profile) */
.ui.ui-print .ui-print-text { margin: 0; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
/* A detail page's photo beside its key/values */
.ui.ui-print .ui-print-profile { display: flex; align-items: flex-start; gap: 6mm; }
.ui.ui-print .ui-print-profile .ui-kv { flex: 1 1 auto; }
/* A small photo in a list row */
.ui.ui-print .ui-print-thumb { display: block; width: 12mm; height: 12mm; object-fit: cover; border-radius: 3px; }
/* Row title/sub sized for the sheet's compact table */
.ui.ui-print .ui-table .ui-row-sub { font-size: 11px; line-height: 15px; }
/* Sort arrows are for the screen only */
@media print {
    .ui.ui-print .ui-table th a::after { display: none; }
}

/* Sign-in pages: sign-in pages (Site.Master), change password, error pages */

/* Site.Master centres its content with flex: the .ui wrapper takes the full width, so every auth card is the same
   width whatever its text (a short error message no longer shrinks the card) */
.ui-auth-shell .ui-shell-plain > .ui { display: flex; justify-content: center; width: 100%; }

/* cms.css gives every h1 a 20px bottom padding and centres every h2 */
.ui h1.ui-auth-title, .ui h1.ui-empty-title { padding: 0; }
.ui h2.ui-card-title { text-align: left; }

/* ValidationSummary DisplayMode="List" renders text and <br />: a block, not a row of flex items */
.ui .ui-auth-card .ui-alert:not(:empty) { display: block; }

/* The progress pill under an auth card's form; the empty state inside an auth card (the card has the padding) */
.ui .ui-auth-card .ui-progress { margin-top: 16px; }
.ui .ui-auth-card .ui-empty { padding: 8px 0; }

/* One narrow card on an app page (change password) */
.ui .ui-card-narrow { max-width: 560px; }
/* An alert that is the last thing in a card body (password changed) */
.ui .ui-card-body > .ui-alert:last-child { margin-bottom: 0; }

/* Lists (clients_list, agents_list, client_ads): small additions to the data tables */

/* A yes/no column (clients_list's client types): a check mark, centred */
.ui .ui-table .ui-col-flag { width: 1%; text-align: center; white-space: nowrap; }
.ui .ui-flag { display: inline-flex; vertical-align: middle; color: var(--ui-success-dot); }
.ui .ui-flag svg { width: 16px; height: 16px; }

/* A photo column (agents_list): a small round thumbnail before the name */
.ui .ui-table .ui-col-thumb { width: 1%; padding-right: 0; }
.ui .ui-thumb { display: block; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: center top; background: #f2f4f7; }

/* Print sheets with several tables (client_ads): each GridView caption reads as a section title */
.ui.ui-print table.ui-table > caption { margin: 0; padding: 0 0 4px; border-bottom: 1px solid var(--ui-border); color: var(--ui-text); font-size: 13px; font-weight: 600; text-align: left; caption-side: top; }
.ui.ui-print table.ui-table + table.ui-table { margin-top: 18px; }

/* Portal admin: portal admin users, manage users, banners and web pages (cms_admin) */

/* Field widths sized to their content, inside .ui-form-row (.ui-field-narrow already exists) */
.ui .ui-form-row > .ui-field-md { flex: 0 1 240px; }
.ui .ui-form-row > .ui-field-lg { flex: 0 1 420px; }

/* Buttons under a form that is not one card (CreateUserWizard navigation, FormView pages) */
.ui .ui-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.ui .ui-form-actions-start { justify-content: flex-start; }

/* RadioButtonList with RepeatLayout="Flow": input + label pairs on one line */
.ui .ui-radio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; }
.ui .ui-radio-row > span { display: inline-flex; align-items: center; gap: 8px; }
.ui .ui-radio-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--ui-emphasis); }
.ui .ui-radio-row label { margin: 0 16px 0 0; color: var(--ui-text); font-size: 14px; cursor: pointer; }
.ui .ui-radio-row br { display: none; }

/* A save message on the left of a card footer, the buttons on the right */
.ui .ui-footer-status { margin-right: auto; }
.ui .ui-footer-status .ui-alert { margin: 0; padding: 6px 12px; font-size: 13px; }

/* Native file input */
.ui input[type="file"].ui-input { height: auto; padding: 6px 8px; }

/* Banner preview: the banner at its zone size on a quiet frame, scrolled when wider than the card */
.ui .ui-banner-preview { display: flex; padding: 20px; overflow-x: auto; border: 1px dashed var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface-muted); }
/* Centred with auto margins, so a banner wider than the card scrolls from its left edge */
.ui .ui-banner-preview > * { flex-shrink: 0; margin: 0 auto; }
.ui .ui-banner-preview img, .ui .ui-banner-preview iframe, .ui .ui-banner-preview object { display: block; max-width: none; border: 0; box-shadow: var(--ui-shadow); }
.ui .ui-banner-preview:empty::before { content: "No file"; margin: 0 auto; color: var(--ui-text-muted); }

/* webpages: the AJAX HTML editor fills the card */
.ui .ui-editor .ajax__html_editor_extender_container { box-sizing: border-box; width: 100% !important; max-width: 100%; }


/* Portal admin agencies: cms_admin home, agencies_list, agency_add, agency_details */

/* A .ui-stack spaces its cards with its gap: no extra margin between adjacent cards */
.ui .ui-stack > .ui-card + .ui-card { margin-top: 0; }

/* Form rows: a button lined up with the inputs */
.ui .ui-form-row > .ui-field-action { flex: 0 0 auto; }

/* Shared agency header, matching Shell (base). */
.ui-agency-shell .ui-shell-brand-mark { width: 24px; height: 24px; background: transparent; border-radius: 0; }
.ui-agency-shell .ui-shell-brand { gap: 12px; }
.ui-agency-shell .ui-shell-account-slot { margin-left: 0; }
.ui-agency-shell .ui-shell-header .ui-shell-account-role { display: none; }
.ui-agency-shell .ui-shell-header .ui-shell-account-button { padding: 4px 8px 4px 4px; gap: 8px; border-radius: 8px; }
.ui-agency-shell .ui-shell-header .ui-shell-avatar { flex-basis: 28px; width: 28px; height: 28px; background: var(--ui-emphasis); }
.ui-home-mobile-brand, .ui-home-mobile-search, .ui-home-mobile-account { display: none; }
/* Header search needs ui.js, so without JS it stays out of the way (Cms.Master draws it disabled until then) */
html:not(.ui-js) .ui-home-header-search, html:not(.ui-js) .ui-home-mobile-search, html:not(.ui-js) .ui-home-mobile-account { display: none !important; }
.ui-home-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; min-width: 0; }
.ui-home-header-search { width: 360px; max-width: 30vw; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border-radius: 8px; background: var(--ui-brand-raised); }
.ui-home-header-search > img { flex-shrink: 0; }
.ui-home-header-search input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: white; font: inherit; font-size: 13px; line-height: 18px; }
.ui-home-header-search:focus-within { outline: 2px solid white; outline-offset: 2px; }
.ui-home-header-search input::placeholder { color: #adbacc; opacity: 1; }
.ui-home-header-search button { border: 1px solid #667085; background: transparent; border-radius: 4px; color: #adbacc; padding: 1px 6px; font: inherit; font-size: 12px; line-height: 16px; cursor: pointer; }
.ui-home-notifications { display: flex; flex: 0 0 36px; height: 36px; align-items: center; justify-content: center; }

@media (max-width: 1199px) {
    html.ui-js .ui-agency-shell .ui-home-mobile-brand { display: flex; flex-shrink: 0; }
    html.ui-js .ui-agency-shell .ui-shell-mobile-title { flex: 1; }
    .ui-home-header-actions { gap: 0; flex-shrink: 0; }
    .ui-home-mobile-search, .ui-home-mobile-account { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
    .ui-home-notifications { display: none; }
    .ui-home-header-search { position: absolute; top: 56px; left: 16px; right: 16px; width: auto; max-width: none; height: 44px; box-shadow: var(--ui-shadow); }
    html.ui-js .ui-home-header-search:not(.is-open) { display: none; }
    .ui-agency-shell .ui-home-mobile-account .ui-shell-avatar { flex-basis: 32px; width: 32px; height: 32px; }
    .ui-home-header-search button { min-height: 36px; }
}
.ui-home-notifications { position: relative; }
/* Hover and keyboard-focus label for header icons. ui.js hides it on Escape. */
.ui-tooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: max-content; max-width: 240px; padding: 6px 10px; border-radius: 6px; background: var(--ui-text, #101828); color: #fff; font-size: 12px; line-height: 16px; font-weight: 500; text-align: left; white-space: normal; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease; }
.ui-home-notifications:hover .ui-tooltip, .ui-home-notifications:focus-visible .ui-tooltip { opacity: 1; visibility: visible; transition-delay: .25s; }
.ui-home-notifications.ui-tooltip-dismissed .ui-tooltip { opacity: 0; visibility: hidden; }
.ui-header-attention-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border: 2px solid var(--ui-brand); border-radius: 50%; background: var(--ui-danger-dot); }

/* Shared kit. Consumers opt in with these classes; existing controls keep their layout. */
/* <div class="ui-file" data-state="empty"><input type="file" ...></div>
   The page supplies data-state="uploading" or "error", aria-describedby and its validation message. */
.ui-file { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); }
.ui-file input[type="file"] { min-width: 0; width: 100%; min-height: 36px; font: inherit; font-size: 14px; color: var(--ui-text-secondary); }
.ui-file input[type="file"]::file-selector-button { min-height: 36px; margin-right: 10px; padding: 0 12px; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: var(--ui-surface); color: var(--ui-text); font: inherit; cursor: pointer; }
.ui-file input[type="file"]:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; border-radius: 6px; }
.ui-file.ui-file-ready input[type="file"] { flex: 0 0 118px; width: 118px; color: transparent; }
.ui-file [data-ui-file-name] { min-width: 0; overflow-wrap: anywhere; color: var(--ui-text-secondary); font-size: 14px; line-height: 20px; }
.ui-file[data-state="error"] { border-color: var(--ui-danger); }
.ui-file[data-state="error"] + .ui-file-message { color: var(--ui-danger); }
.ui-file-message { margin: 6px 0 0; color: var(--ui-text-muted); font-size: 13px; line-height: 18px; }
.ui-file[data-state="uploading"]::after { content: ""; flex: 0 0 16px; height: 16px; margin-left: auto; border: 2px solid var(--ui-border); border-top-color: var(--ui-emphasis); border-radius: 50%; animation: ui-spin .7s linear infinite; }
/* RadioButtonList RepeatLayout="Flow": native radios keep focus/arrow-key behaviour. */
.ui-segmented:has(input[type="radio"]) { display: flex; width: 100%; min-width: 0; gap: 2px; padding: 4px; border: 1px solid var(--ui-border); background: var(--ui-surface-muted); }
.ui-segmented > input[type="radio"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ui-segmented > input[type="radio"] + label { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; min-height: 36px; margin: 0; padding: 0 8px; border-radius: 6px; color: var(--ui-text-secondary); font-size: 13px; line-height: 18px; font-weight: 500; overflow-wrap: anywhere; cursor: pointer; }
.ui-segmented > input[type="radio"]:checked + label { background: var(--ui-surface); color: var(--ui-text); box-shadow: var(--ui-shadow); }
.ui-segmented > input[type="radio"]:focus-visible + label { outline: 2px solid var(--ui-accent); outline-offset: -2px; }
.ui-segmented > input[type="radio"]:disabled + label { opacity: .5; cursor: default; }
.ui-segmented:has(> input[type="radio"]) > br { display: none; }
/* Place last in the content wrapper. Release only that wrapper's horizontal scroll container,
   so sticky follows the viewport; wide tables still use their own .ui-table-scroll. */
.ui-shell-content-viewport:has(.ui-savebar) { overflow: visible; }
.ui-savebar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 64px; width: 100%; padding: 12px 12px 12px 20px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.ui-savebar-status { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.ui-savebar-status::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--ui-warning-dot); }
.ui-savebar-hint { color: var(--ui-text-muted); font-size: 13px; line-height: 18px; font-weight: 400; }
.ui-savebar-actions { display: flex; flex-shrink: 0; gap: 8px; }
/* ui.js moves server-rendered data-ui-toast elements into this stack after each full/partial load. */
.ui-toast-stack { position: fixed; z-index: 40; right: 16px; bottom: calc(var(--ui-savebar-offset, 0px) + 16px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; width: max-content; max-width: calc(100vw - 32px); max-height: calc(100dvh - var(--ui-savebar-offset, 0px) - 88px); overflow: auto; }
.ui-toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; max-width: 100%; border-radius: 10px; background: var(--ui-text); color: var(--ui-surface); box-shadow: 0 8px 24px -4px rgba(16,24,40,.12), 0 2px 6px -2px rgba(16,24,40,.06); font: 500 13px/18px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
.ui-toast[hidden] { display: none; }
.ui-toast::before { content: ""; flex: 0 0 16px; height: 16px; background: var(--ui-success-dot); mask: url("home/tick.svg") center / contain no-repeat; }
.ui-toast[data-ui-toast="error"]::before { background: var(--ui-surface); mask-image: url("home/alert.svg"); }
.ui-toast a, .ui-toast button { color: var(--ui-accent-soft); font: inherit; }
.ui-toast button { flex-shrink: 0; min-width: 24px; min-height: 24px; padding: 2px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.ui-toast button:focus-visible, .ui-toast a:focus-visible { outline: 2px solid var(--ui-surface); outline-offset: 2px; }
.ui-shell-drawer-open .ui-toast-stack { visibility: hidden; }
/* jQuery UI appends the list to body; scope the new styling to suburb pickers only. */
.ui-suburb-suggestions.ui-autocomplete { box-sizing: border-box; padding: 6px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-text); box-shadow: var(--ui-shadow); font: 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; z-index: 45; }
.ui-suburb-suggestions .ui-menu-item-wrapper { padding: 8px 10px; border: 0; border-radius: 6px; }
.ui-suburb-suggestions .ui-state-active { margin: 0; background: var(--ui-accent-soft); color: var(--ui-text); }
.ui-suburb-suggestions .ui-suburb-empty { padding: 8px 10px; opacity: 1; color: var(--ui-text-muted); cursor: default; }
@media (max-width: 899px) {
    .ui-file input[type="file"], .ui-file input[type="file"]::file-selector-button { min-height: 44px; }
    .ui-segmented > input[type="radio"] + label { min-height: 44px; }
    .ui-savebar { flex-wrap: wrap; gap: 8px; padding: 12px; }
    .ui-savebar-status { flex-basis: 100%; }
    .ui-savebar-actions { width: 100%; justify-content: flex-end; }
    .ui-savebar-hint { display: none; }
    .ui-toast button, .ui-toast a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
    .ui-suburb-suggestions .ui-menu-item-wrapper, .ui-suburb-suggestions .ui-suburb-empty { box-sizing: border-box; min-height: 44px; padding: 12px 10px; }
    /* Opt-in only. Header associations stay in the DOM; ui.js supplies readable cell labels. */
    .ui .ui-table-phone, .ui .ui-table-phone > tbody { display: block; width: 100%; min-width: 0; }
    .ui .ui-table-phone > thead, .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager):has(> th) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager):has(> td) { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 103px; padding: 16px 72px 16px 16px; border-bottom: 1px solid var(--ui-border); }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td { display: block; width: auto; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td[data-ui-column-label]::before { content: attr(data-ui-column-label) ": "; color: var(--ui-text-muted); font-size: 12px; }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td:first-child::before, .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td.ui-col-actions::before { content: none; }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td.ui-col-actions { position: absolute; top: 16px; right: 16px; width: 44px; }
    .ui .ui-table-phone > :is(thead, tbody, tfoot) > tr:not(.ui-table-pager) > td.ui-col-actions > .ui-menu > .ui-menu-trigger { width: 44px; height: 44px; }
    .ui .ui-table-phone > :is(tbody, tfoot) > tr.ui-table-pager a, .ui .ui-table-phone > :is(tbody, tfoot) > tr.ui-table-pager span { min-width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ui-file[data-state="uploading"]::after { animation: none; } }
