/* ==========================================================================
   portal-modern.css: the FastUKCompanySearch look for the Convert-IXBRL registered area (Oct 2026)

   Loaded ONLY by Views/Shared/_PortalLayout.cshtml, after style.css/site.css/responsive.css, so it wins
   without !important. Public pages (_Layout, _LeanLayout, _DocsLayout, _RankingsLayout) never load it,
   which keeps their SEO markup and load speed untouched.

   Section 1 is copied from FUCS_BACKEND/FastUkCompanySearch.WebPortal/wwwroot/css/portal-modern.css with the
   same class names, so merging the two products later is mostly deleting the duplicate. Section 2 maps
   Convert-IXBRL's own portal classes onto the same palette. Notes: CursorPlans/portal-styling-context.md

   Palette (FUCS): page #f4f8ff, surface #f8fbff / #ffffff, border #dce7f8 / #d7e3f6, heading #0d315f,
   link #103b77, primary #1f6feb (active pill #2a77d8), soft #eef5ff / #c6dbfb / #184a8d.
   ========================================================================== */


/* ---------- 1. Shared FUCS components (same names as FUCS) ---------- */

.portal-header-inner {
    padding-left: 22px;
    padding-right: 22px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #0f3d80;
    line-height: 1;
}

.portal-user-menu-toggle {
    border-radius: 12px;
    border: 1px solid #d4e1f5;
    background: #f8fbff;
    color: #1f3551 !important;
    padding: 7px 10px !important;
    font-size: 14px;
    text-decoration: none !important;
}

.portal-user-menu-toggle:hover,
.portal-user-menu-toggle:focus {
    color: #114c9e !important;
    background: #edf4ff;
    text-decoration: none !important;
    box-shadow: none !important;
}

.portal-user-menu-dropdown {
    border: 1px solid #d7e3f6;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(17, 56, 114, 0.12);
    padding: 8px;
    min-width: 220px;
}

.portal-user-menu-dropdown .dropdown-item {
    border-radius: 10px;
    color: #2f3a4a;
    font-weight: 500;
    padding: 9px 11px;
}

.portal-user-menu-dropdown .dropdown-item:hover {
    background: #eef5ff;
    color: #123f7b;
}

.phase1-surface {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.08);
    padding: 18px;
}

.modern-side-panel {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 20px;
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.08);
}

.modern-side-title {
    color: #0d315f;
    font-weight: 700;
    margin-bottom: 8px;
}

.modern-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 12px;
    line-height: 1.1;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.modern-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.modern-btn:disabled {
    opacity: 0.65;
    transform: none;
}

.modern-btn-primary {
    background: #1f6feb;
    border-color: #1b62d2;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
}

.modern-btn-primary:hover,
.modern-btn-primary:focus {
    background: #195fc8;
    border-color: #1657b8;
    color: #ffffff;
}

.modern-btn-soft {
    background: #eef5ff;
    border-color: #c6dbfb;
    color: #184a8d;
    box-shadow: none;
}

.modern-btn-soft:hover {
    background: #e4efff;
    border-color: #b7d0f7;
    color: #123f7b;
}

.modern-btn-outline {
    background: #ffffff;
    border-color: #b6cff3;
    color: #1d4f93;
    box-shadow: none;
}

.modern-btn-outline:hover {
    background: #f6faff;
}


/* ---------- 2. Convert-IXBRL portal mapped onto the FUCS palette ---------- */

/* Page */
body {
    background: #f4f8ff;
    color: #1f3551;
}

/* Header */
.portal-header-inner .navbar {
    padding: 12px 0;
}

.portal-header-inner .navbar-brand {
    font-size: 1.15rem;
}

/* Logo from images/logo/ (Oct 2026); its "ix" mark and navy text match the FUCS brand colour */
.brand-mark .brand-logo {
    display: block;
    width: auto;
    height: 32px;
}

@media (max-width: 575px) {
    .brand-mark .brand-logo {
        height: 26px;
    }
}

/* Current package badge beside the logo (badge-info normally, badge-warning when there is no balance) */
.portal-header-inner .navbar > .badge {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
}

.portal-header-inner .navbar > .badge-info {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    color: #184a8d;
}

.portal-header-inner .navbar > .badge-warning {
    background: #fff7e6;
    border: 1px solid #f5d9a8;
    color: #8a5a00;
}

.portal-top-nav .nav-item {
    background: transparent !important;
}

/* responsive.css gives every .nav-item an old hover effect: a light-blue square (!important) plus an animated blue
   ::before bar. It showed behind the pill tabs, so it is switched off across the portal. */
.nav-item:hover {
    background-color: transparent !important;
}

.nav-item::before {
    display: none;
}

/* ---- Find Companies panel (_searchAreaPartial.cshtml, Filters/*.cshtml) ---- */

.ukcdb-advanced-search-panel {
    height: 90vh;
    padding-top: 14px;
    font-size: 9pt;
    color: #1f3551;
}

.portal-panel-title {
    color: #0d315f;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 12px;
    text-align: center;
}

.portal-panel-section-title {
    font-size: 0.95rem;
    text-align: center;
}

.portal-panel-section-title i {
    color: #2a77d8;
    margin-right: 2px;
}

.portal-panel-section-title-spaced {
    margin-top: 14px;
}

.portal-panel-note {
    color: #5a6b85;
    font-size: 8.5pt;
    text-align: center;
    margin-top: -4px;
}

.portal-panel-search-btn {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 9px 12px;
}

/* Closed filter row: white card, navy text */
.ukcdb-advanced-search-panel .toggle-advanced-search-button {
    background: #ffffff;
    border: 1px solid #d7e3f6;
    border-radius: 12px;
    color: #103b77;
    font-size: 13px;
    font-weight: 600;
    margin-right: 0;
    height: auto;
    padding: 7px 10px;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.ukcdb-advanced-search-panel .toggle-advanced-search-button:hover {
    background: #f7faff;
    border-color: #b6cff3;
}

/* Open filter header: soft blue with navy text, so the solid-blue SEARCH button stays the one primary action.
   Its icons are the blue SVGs (swapped from the white ones in Filters/*.cshtml). */
.ukcdb-advanced-search-panel .filter-toggle-open {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 12px;
    color: #0d315f;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 10px;
}

.ukcdb-advanced-search-panel .filter-toggle-open .ukcdb-filter-label-text {
    color: #0d315f;
}

/* Open filter body */
.ukcdb-advanced-search-panel .filterOpen {
    background: #ffffff;
    border: 1px solid #d7e3f6;
    border-radius: 12px;
    color: #1f3551;
    margin-top: 6px;
    padding: 8px;
}

.ukcdb-advanced-search-panel .filter-help-text,
.ukcdb-advanced-search-panel .filter-value-label {
    color: #5a6b85;
}

/* Two-option choice inside a filter (Director Age: Any / All) */
.filter-choice-pills {
    display: inline-flex;
    gap: 6px;
    margin-top: 6px;
}

.filter-choice-pill {
    background: #ffffff;
    border: 1px solid #c8dcfb;
    border-radius: 999px;
    color: #184a8d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    min-width: 56px;
    padding: 5px 14px;
}

.filter-choice-pill:hover {
    background: #eef5ff;
}

.filter-choice-pill.is-active {
    background: #2a77d8;
    border-color: #2a77d8;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(42, 119, 216, 0.22);
}

.ukcdb-advanced-search-panel .form-control {
    border-color: #c7dafb;
    border-radius: 10px;
}

.ukcdb-advanced-search-panel .form-control:focus {
    border-color: #8db7f1;
    box-shadow: 0 0 0 3px rgba(42, 119, 216, 0.14);
}

.ukcdb-advanced-search-panel .badge-dark {
    background: #0d315f;
    border-radius: 999px;
}

/* Financials filter tiles */
.ukcdb-advanced-search-panel .more-filters-button {
    background: #ffffff;
    border: 1px solid #d7e3f6;
    border-radius: 14px;
    color: #184a8d;
    font-weight: 600;
}

.ukcdb-advanced-search-panel .more-filters-button i {
    color: #2a77d8;
}

.ukcdb-advanced-search-panel .more-filters-button:hover {
    background: #eef5ff;
    border-color: #b6cff3;
    color: #123f7b;
}

/* ---- Search filter building blocks (filter-section, amount-range-row, date-preset-filter in app.js) ---- */

:root {
    --ff-navy: #123a75;
    --ff-text: #1d2c4d;
    --ff-muted: #6c7b95;
    --ff-border: #c9d9f1;
    --ff-pill: #e8f0fd;
    --ff-blue: #1a66d6;
    --ff-blue-dark: #1452b0;
    --ff-line: #e6edf8;
    --ff-error: #c62828;
}

/* Choice chips: quick ranges, date presets, popular metrics */
.ff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ff-chip {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 999px;
    color: var(--ff-navy);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.3;
    padding: 5px 11px;
}

.ff-chip:hover {
    background: var(--ff-pill);
}

.ff-chip[aria-pressed="true"] {
    background: var(--ff-pill);
    border-color: var(--ff-blue);
    color: var(--ff-blue);
    font-weight: 600;
}

/* Collapsible sidebar section */
.fs-section {
    margin-top: 10px;
}

.fs-head {
    align-items: center;
    box-sizing: border-box;
    background: var(--ff-pill);
    border: 1px solid var(--ff-border);
    border-radius: 12px;
    color: var(--ff-navy);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    padding: 9px 12px;
    text-align: left;
    width: 100%;
}

.fs-head:focus-visible {
    outline: 2px solid var(--ff-blue);
    outline-offset: 2px;
}

.fs-icon {
    height: 13px;
    flex: none;
}

.fs-sum {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 999px;
    color: var(--ff-muted);
    flex: none;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    max-width: 170px;
    overflow: hidden;
    padding: 2px 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-sum.is-set {
    background: var(--ff-navy);
    border-color: var(--ff-navy);
    color: #ffffff;
}

.fs-chev {
    flex: none;
    height: 16px;
    transition: transform 0.15s;
    width: 16px;
}

.fs-section.is-closed .fs-chev {
    transform: rotate(-90deg);
}

.fs-body {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 12px;
    color: var(--ff-text);
    margin-top: 6px;
    padding: 12px;
}

.fs-title {
    min-width: 0;
}

/* Industry opens a picker, so its arrow points right and never turns */
.fs-head-link .fs-chev-right {
    transform: rotate(-90deg);
}

.fs-head-link:hover,
.fs-head:hover {
    border-color: #b6cff3;
}

.fs-body .ff-cat-grid {
    margin-top: 0;
}

/* Filters the user has set, under "Advanced Search" (_searchAreaPartial.cshtml) */
.ff-tagbar {
    margin: 4px 0 2px;
}

.ff-tagbar-head {
    align-items: center;
    color: var(--ff-muted);
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ff-link-btn-small {
    font-size: 12px;
}

.ff-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ff-tag {
    align-items: center;
    background: var(--ff-pill);
    border: 1px solid var(--ff-border);
    border-radius: 999px;
    color: var(--ff-navy);
    display: inline-flex;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    max-width: 100%;
    padding: 3px 5px 3px 11px;
}

.ff-tag button {
    background: #ffffff;
    border: 0;
    border-radius: 50%;
    color: var(--ff-navy);
    cursor: pointer;
    flex: none;
    font-size: 13px;
    height: 19px;
    line-height: 1;
    padding: 0;
    width: 19px;
}

.ff-tag button:hover {
    color: var(--ff-error);
}

/* Second Search button, fixed to the bottom of the sidebar (the panel is a flex column) */
.ff-side-foot {
    background: #f8fbff;
    border-top: 1px solid var(--ff-line);
    border-radius: 0 0 20px 20px;
    flex: none;
    padding: 10px 15px 12px;
}

.ff-side-foot .portal-panel-search-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Status: one choice at a time */
.ff-radio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-radio {
    align-items: center;
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    color: var(--ff-text);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
}

.ff-radio:hover {
    background: #f7faff;
}

.ff-radio input {
    accent-color: var(--ff-blue);
    flex: none;
    height: 16px;
    margin: 0;
    width: 16px;
}

.ff-radio.is-checked {
    background: var(--ff-pill);
    border-color: var(--ff-blue);
}

/* Small labels, help lines and From/To pairs inside a section */
.ff-field-label {
    color: var(--ff-muted);
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.ff-field-label-spaced {
    margin-top: 10px;
}

.ff-help {
    color: var(--ff-muted);
    font-size: 12px;
    margin-top: 8px;
}

.ff-help.err {
    color: var(--ff-error);
    font-weight: 500;
}

.ff-info {
    color: var(--ff-blue);
    cursor: help;
    margin-left: 2px;
}

.ff-pair {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 10px;
}

.ff-pair-field {
    display: block;
    margin: 0;
    min-width: 0;
}

.ukcdb-advanced-search-panel .form-control.is-bad {
    border-color: var(--ff-error);
}

/* Date filter with quick choices */
.dpf + .dpf {
    border-top: 1px solid var(--ff-line);
    margin-top: 14px;
    padding-top: 14px;
}

.dpf-subtitle {
    color: var(--ff-navy);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dpf-custom {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 10px;
}

.dpf-field {
    display: block;
    margin: 0;
    min-width: 0;
}

.dpf-field > span {
    color: var(--ff-muted);
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.dpf-custom.is-invalid .dp__input {
    border-color: var(--ff-error);
}

.dpf-hint,
.arr-hint {
    color: var(--ff-muted);
    font-size: 12px;
}

.dpf-hint {
    margin-top: 8px;
}

.dpf-hint.err,
.arr-hint.err {
    color: var(--ff-error);
    font-weight: 500;
}

/* Financial filter row */
.arr-row {
    border: 1px solid var(--ff-border);
    border-radius: 14px;
    margin-top: 12px;
    padding: 12px 14px;
}

.arr-main {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-areas: "label min max seg rm";
    grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr) auto 34px;
}

.arr-label {
    color: var(--ff-navy);
    font-size: 13px;
    font-weight: 600;
    grid-area: label;
}

.arr-money {
    display: block;
    margin: 0;
    position: relative;
}

.arr-min { grid-area: min; }
.arr-max { grid-area: max; }

.arr-money span {
    color: var(--ff-muted);
    font-size: 14px;
    left: 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.arr-money input {
    border: 1px solid var(--ff-border);
    box-sizing: border-box;
    min-width: 0;
    border-radius: 10px;
    color: var(--ff-text);
    font: inherit;
    font-size: 14px;
    height: 38px;
    padding: 0 10px 0 26px;
    width: 100%;
}

.arr-money.no-currency input {
    padding-left: 12px;
}

.arr-money input::placeholder {
    color: #8a97ad;
}

.arr-money input:focus {
    border-color: var(--ff-blue);
    box-shadow: 0 0 0 3px rgba(26, 102, 214, 0.15);
    outline: none;
}

.arr-money input.bad {
    border-color: var(--ff-error);
}

.arr-seg-wrap {
    grid-area: seg;
}

.arr-seg {
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    display: inline-flex;
    overflow: hidden;
}

.arr-seg button {
    background: #ffffff;
    border: 0;
    border-left: 1px solid var(--ff-border);
    color: var(--ff-text);
    cursor: pointer;
    font-size: 12.5px;
    height: 36px;
    padding: 0 10px;
    white-space: nowrap;
}

.arr-seg button:first-child {
    border-left: 0;
}

.arr-seg button:hover {
    background: var(--ff-pill);
}

.arr-seg button[aria-pressed="true"] {
    background: var(--ff-blue);
    color: #ffffff;
}

.arr-remove {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 50%;
    color: var(--ff-muted);
    cursor: pointer;
    font-size: 13px;
    grid-area: rm;
    height: 34px;
    width: 34px;
}

.arr-remove:hover {
    border-color: var(--ff-error);
    color: var(--ff-error);
}

.arr-sub {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-left: 180px;
}

.arr-sub .arr-hint {
    margin-left: auto;
}

/* Financial filter category buttons (_moreFiltersContainer.cshtml) */
.ff-cat-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 8px;
}

.ff-cat-btn {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    color: var(--ff-navy);
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    min-width: 0;
    padding: 8px 8px;
    text-align: left;
}

.ff-cat-btn:hover {
    background: var(--ff-pill);
}

.ff-cat-btn i {
    color: var(--ff-blue);
    flex: none;
    font-size: 12px;
}

.ff-cat-label {
    line-height: 1.25;
    min-width: 0;
}

.ff-cat-btn .fs-sum {
    flex: none;
    font-size: 10px;
    padding: 1px 7px;
}

/* Financial filter modal (_financialFilterPopup.cshtml): header and footer stay put, body scrolls */
#xbrlConceptFilterContainer .ff-dialog {
    max-width: min(900px, 94vw);
}

.ff-modal {
    color: var(--ff-text);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3.5rem);
    overflow: hidden;
}

.ff-head {
    align-items: center;
    border-bottom: 1px solid var(--ff-line);
    display: flex;
    flex: none;
    gap: 12px;
    padding: 14px 20px;
}

.ff-title {
    font-size: 1.15rem;
    margin: 0;
}

.ff-active-count,
.ff-muted,
.ff-tip,
.ff-foot-status {
    color: var(--ff-muted);
    font-size: 13px;
}

.ff-head .ff-save-btn-head {
    margin-left: auto;
}

.ff-save-btn {
    align-items: center;
    background: var(--ff-blue);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(26, 102, 214, 0.25);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    white-space: nowrap;
}

.ff-save-btn:hover {
    background: var(--ff-blue-dark);
}

.ff-save-btn:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.ff-save-short {
    display: none;
}

.ff-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.ff-combo {
    position: relative;
}

/* Centred on the 44px input (top: 22px), not on .ff-combo, which also holds the open list */
.ff-combo-icon {
    color: var(--ff-blue);
    font-size: 14px;
    left: 14px;
    pointer-events: none;
    position: absolute;
    top: 22px;
    transform: translateY(-50%);
}

.ff-combo-input {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--ff-text);
    font: inherit;
    font-size: 14px;
    height: 44px;
    padding: 0 14px 0 40px;
    width: 100%;
}

.ff-combo-input::placeholder {
    color: #8a97ad;
}

.ff-combo-input:focus {
    border-color: var(--ff-blue);
    box-shadow: 0 0 0 3px rgba(26, 102, 214, 0.15);
    outline: none;
}

/* In the flow (pushes the content down) so the scrolling modal body never clips it */
.ff-list {
    background: #ffffff;
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 40, 90, 0.15);
    list-style: none;
    margin: 4px 0 0;
    max-height: 270px;
    overflow-y: auto;
    padding: 4px;
}

.ff-list li {
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 12px;
    justify-content: space-between;
    padding: 9px 12px;
}

.ff-list li small {
    color: var(--ff-muted);
    font-size: 12px;
}

.ff-list li.active {
    background: var(--ff-blue);
    color: #ffffff;
}

.ff-list li.active small {
    color: #dce8fb;
}

.ff-list li.none {
    color: var(--ff-muted);
    cursor: default;
}

.ff-popular {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ff-tip {
    font-size: 12px;
    margin-top: 8px;
}

.ff-empty {
    border: 1px dashed var(--ff-border);
    border-radius: 14px;
    color: var(--ff-muted);
    font-size: 14px;
    margin-top: 14px;
    padding: 26px 16px;
    text-align: center;
}

.ff-foot {
    align-items: center;
    background: #ffffff;
    border-top: 1px solid var(--ff-line);
    display: flex;
    flex: none;
    gap: 14px;
    padding: 12px 20px;
}

.ff-foot .ff-save-btn {
    margin-left: auto;
}

.ff-foot-status.err {
    color: var(--ff-error);
    font-weight: 500;
}

.ff-link-btn {
    background: none;
    border: 0;
    color: var(--ff-blue);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
}

.ff-link-btn:disabled {
    color: var(--ff-muted);
    cursor: default;
    text-decoration: none;
}

@media (max-width: 700px) {
    /* Full screen; the header (with Save) stays at the top while the rows scroll.
       Sized to the fixed .modal box rather than 100vh, so a page scrollbar can't push the header off screen. */
    #xbrlConceptFilterContainer .ff-dialog {
        align-items: stretch;
        height: 100%;
        margin: 0;
        max-width: none;
        min-height: 0;
    }

    .ff-modal {
        border-radius: 0;
        height: 100%;
        max-height: none;
    }

    .ff-head,
    .ff-body,
    .ff-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ff-head {
        gap: 8px;
    }

    .ff-save-long {
        display: none;
    }

    .ff-save-short {
        display: inline;
    }

    .ff-head .ff-save-btn {
        padding: 0 12px;
    }

    .ff-active-count {
        display: none;
    }
}

@media (max-width: 700px) {
    .arr-main {
        grid-template-areas: "label label rm" "min max max" "seg seg seg";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    }

    .arr-main:not(.has-choices) {
        grid-template-areas: "label label rm" "min max max";
    }

    .arr-sub {
        padding-left: 0;
    }

    .arr-sub .arr-hint {
        margin-left: 0;
        width: 100%;
    }

    .arr-seg {
        display: flex;
        width: 100%;
    }

    .arr-seg button {
        flex: 1;
        padding: 0 4px;
    }
}

/* ---- Company autocomplete (moved from site.css; portal only) ---- */

.company-autocomplete {
    position: relative;
}

.company-autocomplete-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.company-autocomplete-input-wrap .company-autocomplete-input {
    padding-right: 2rem;
    font-size: 0.9rem;
    height: 40px;
}

.company-autocomplete-selected-number,
.company-autocomplete-spinner,
.company-autocomplete-clear {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.company-autocomplete-selected-number {
    right: 2rem;
    background-color: #2a77d8;
    color: white;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: bold;
}

.company-autocomplete-spinner {
    right: 2rem;
    width: 0.9rem;
    height: 0.9rem;
    color: #6c757d;
}

.company-autocomplete-clear {
    right: 0.4rem;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
}

.company-autocomplete-clear:hover {
    color: #212529;
}

.company-autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1050;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d7e3f6;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(17, 56, 114, 0.12);
}

.company-autocomplete-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: #1f3551;
    cursor: pointer;
}

.company-autocomplete-option.active {
    background-color: #eef5ff;
}

.company-autocomplete-option mark {
    background: transparent;
    padding: 0;
    font-weight: bold;
    color: inherit;
}

.company-autocomplete-number {
    flex-shrink: 0;
    color: #6c757d;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.company-autocomplete-hint {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px 2px;
    margin-top: 4px;
    border-top: 1px solid #e9eef7;
    color: #6c757d;
    font-size: 0.72rem;
}

.company-autocomplete-hint kbd {
    background: #f1f5fb;
    color: #495057;
    border: 1px solid #d7e3f6;
    border-radius: 3px;
    padding: 0 4px;
    margin-right: 2px;
    font-size: 0.7rem;
    box-shadow: none;
}

/* ---- Results area (SearchResultsContainer/*.cshtml) ---- */

.ukcdb-details-panel.phase1-surface {
    background: #ffffff;
    border-radius: 20px;
}

/* Inner options panel reuses .ukcdb-details-panel; keep it flat */
.results-summary-bar .ukcdb-details-panel {
    background: transparent;
    padding: 0;
}

/* Tabs as underlined text tabs, so they don't read as buttons */
.ukcdb-details-panel .nav-tabs {
    border-bottom: 1px solid #d5e2f5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.ukcdb-details-panel .nav-tabs .nav-link {
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #5a6b85;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 2px 9px;
    margin: 0 0 -1px;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.ukcdb-details-panel .nav-tabs .nav-link:hover {
    color: #123a75;
    border-bottom-color: #c9d9f1;
}

.ukcdb-details-panel .nav-tabs .nav-link.active {
    color: #123a75;
    border-bottom-color: #123a75;
}

.ukcdb-details-panel .nav-tabs .nav-link:not(.active) .closeCompanyTabButton {
    color: #5a6b85;
    border-color: #c9d9f1;
}

/* Selected filter chips */
.filters-label {
    color: #0d315f;
    font-weight: 700;
}

.filters-label-icon {
    width: 16px;
    margin-top: -3px;
}

.filter-badge {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 6px 4px 12px;
}

.filter-value {
    color: #1f6feb;
    font-weight: 700;
}

/* The industries chip is a multi-line block: its outer .filter-badge must stay an invisible wrapper (as site.css
   intends) so the pill styling above doesn't put a rounded box around the inner card */
.filter-badge.sic-home-filter-badge {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.sic-home-filter-container {
    background: #f8fbff;
    border-color: #dce7f8;
    border-radius: 14px;
    padding: 8px 10px;
}

.sic-home-filter-chip {
    border-color: #c6dbfb;
    color: #184a8d;
    font-weight: 600;
    padding: 3px 4px 3px 10px;
}

.sic-home-more-btn {
    border-color: #c6dbfb;
    color: #184a8d;
}

.sic-home-clear-all-btn {
    border-color: #f5c2c2;
    color: #9b2c2c;
}

.sic-home-clear-all-btn:hover {
    background: #fdecec;
}

.clearFilterButton {
    border-color: #b6cff3;
    color: #5a7bb0;
    font-size: 12px;
    width: 20px;
    height: 20px;
}

.clearFilterButton:hover {
    background: #1f6feb;
    border-color: #1f6feb;
}

.results-lists-col {
    border-left: 1px solid #dce7f8;
}

.results-divider {
    border-top-color: #dce7f8;
    margin: 12px 8px;
}

/* Count / pagination / actions strip */
.results-summary-bar {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    line-height: 20px;
    margin: 4px 0 12px;
    padding: 10px 8px;
}

.results-stats-box {
    width: 100%;
    color: #1f3551;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.results-stats-box .font-weight-normal {
    color: #5a6b85;
    font-size: 12px;
}

.custom-pagination-btn {
    background: #ffffff;
    border: 1px solid #b6cff3;
    border-radius: 999px;
    color: #1d4f93;
    font-size: 13px;
    font-weight: 600;
}

.custom-pagination-btn:hover {
    background: #eef5ff;
    color: #123f7b;
}

.custom-pagination-btn:disabled {
    background: #ffffff;
    border-color: #dce7f8;
    color: #a9b8cf;
}

.results-summary-bar .border.rounded.bg-light {
    background: #eef5ff !important;
    border-color: #c6dbfb !important;
    border-radius: 999px !important;
    color: #0d315f;
    font-size: 13px;
}

/* Save as list / Download results (were green): FUCS primary, no sweep animation */
.results-summary-bar .app_button_small {
    background: #1f6feb;
    border: 1px solid #1b62d2;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
    font-weight: 600;
}

.results-summary-bar .app_button_small::before {
    display: none;
}

.results-summary-bar .app_button_small:hover,
.results-summary-bar .app_button_small:focus {
    background: #195fc8;
    color: #ffffff;
}

/* Company Lists dropdown button */
#savedSearchesDropdown {
    background: #ffffff;
    border: 1px solid #b6cff3;
    border-radius: 10px;
    color: #1d4f93;
    font-weight: 600;
}

#savedSearchesDropdown:hover {
    background: #eef5ff;
}

#savedSearchesDropdown .badge-light {
    background: #2a77d8;
    border-radius: 999px;
    color: #ffffff;
}

/* Result cards */
#searchResultsContainer .card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(17, 56, 114, 0.06);
    overflow: hidden;
}

#searchResultsContainer .card-header {
    background: #f8fbff;
    border-bottom: 1px solid #e4ecf8;
    padding: 10px 16px;
}

#searchResultsContainer .result-item strong {
    color: #0d315f;
}

#searchResultsContainer .result-item:hover {
    transform: none;
    font-size: inherit;
}

#searchResultsContainer .result-item:hover strong {
    color: #1f6feb;
}

/* Result card body, laid out like the company view (_srSearchResultsRows.cshtml) */
#searchResultsContainer .card-body {
    padding: 14px 16px 16px;
}

.result-match-chip {
    display: inline-flex;
    align-items: center;
    background: #fff7e6;
    border: 1px solid #f5d9a8;
    border-radius: 999px;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 600;
    margin: 0 6px 6px 0;
    padding: 3px 10px;
}

.result-address {
    color: #1f3551;
    font-size: 14px;
    font-weight: 600;
    margin: 2px 0 10px;
}

.result-icon {
    width: 13px;
    margin: -3px 4px 0 0;
    opacity: 0.75;
}

.result-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.result-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
}

.result-pill-dot {
    display: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.result-pill.is-active,
.result-pill.is-inactive {
    font-weight: 700;
}

.result-pill.is-active {
    background: #e6f6ec;
    border-color: #b8e3c7;
    color: #1e7a43;
}

.result-pill.is-inactive {
    background: #fdecec;
    border-color: #f5c2c2;
    color: #9b2c2c;
}

.result-pill.is-active .result-pill-dot,
.result-pill.is-inactive .result-pill-dot {
    display: inline-block;
    background: currentColor;
}

.result-chart-wrap {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.result-chart {
    flex: 1;
    min-width: min(300px, 100%);
    height: 160px;
    position: relative;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.result-stat {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
}

.result-stat-clickable {
    cursor: pointer;
}

.result-stat-clickable:hover {
    border-color: #b6cff3;
}

.result-stat-label {
    color: #5a6b85;
    font-size: 12px;
    line-height: 1.3;
}

.result-stat-value {
    color: #0d315f;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.result-year-chip {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    padding: 0 6px;
}

.result-info-row {
    row-gap: 10px;
}

.result-info-card {
    border: 1px solid #e4ecf8;
    border-radius: 14px;
    height: 100%;
    padding: 10px 14px 6px;
}

.result-info-title {
    color: #0d315f;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-info-card .company-kv {
    font-size: 13px;
    padding: 6px 0;
}

.result-info-card .company-kv .company-status-pill {
    margin-left: 6px;
}

.result-sic-line {
    border-top: 1px solid #eef2f8;
    color: #1f3551;
    font-size: 13px;
    padding: 6px 0;
}

.result-sic-code {
    background: #eef5ff;
    border-radius: 6px;
    color: #184a8d;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    padding: 1px 6px;
}

#searchResultsContainer .badge-secondary {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
}

.ukcdb-result-number {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    color: #184a8d;
    font-weight: 700;
    height: 22px;
    line-height: 16px;
}

.ukcdb-viewfinancials-button {
    background: #1f6feb;
    border-color: #1b62d2;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
}

.ukcdb-viewfinancials-button:hover {
    background: #195fc8;
    border-color: #1657b8;
}

/* Empty-state placeholder and feature cards (_srSearchResultsFeatures.cshtml) */
.searchfeature-shell {
    background: #ffffff;
}

.searchfeature-shell .section-title {
    color: #0d315f;
    font-weight: 700;
}

.searchfeature-card {
    border: 1px solid #dce7f8;
    border-radius: 16px;
    box-shadow: none;
}

.searchfeature-card:hover {
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.08);
}

.searchfeature-card .card-title {
    color: #0d315f;
}

.searchfeature-card .card-text {
    color: #5a6b85;
    font-size: 14px;
}

.searchfeature-icon {
    background: #eef5ff;
    width: 44px;
    height: 44px;
}

.searchfeature-icon i,
.searchfeature-icon i::before {
    color: #2a77d8 !important;
}

.search-placeholder {
    border-radius: 18px;
}


/* ---------- 3. Company view (Phase 2: _srOpenCompanyTabContent.cshtml, Views/Home/Subviews/*) ---------- */

/* Navy hero, as on the FUCS company page */
.company-hero-card {
    background: linear-gradient(135deg, #1d4f8f 0%, #163d73 100%);
    border-radius: 20px;
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.18);
    color: #ffffff;
    margin-bottom: 14px;
    padding: 20px 24px;
}

.company-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.company-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
}

/* Only the status badge (first) carries a dot: green when active, amber otherwise */
.company-hero-dot {
    display: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f4b740;
}

.company-hero-badge:first-child .company-hero-dot {
    display: inline-block;
}

.company-hero-badge.is-active .company-hero-dot {
    background: #3ddc84;
}

.company-hero-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 4px;
}

.company-hero-number {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.company-hero-number strong {
    color: #ffffff;
}

.company-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.company-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.company-hero-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.company-hero-btn-primary {
    background: #ffffff;
    border-color: #ffffff;
    color: #163d73;
}

.company-hero-btn-primary:hover {
    background: #eef5ff;
}

/* Section pills: two labelled rows */
.company-pill-rows {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.company-pill-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.company-pill-group-label {
    color: #5a6b85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 78px;
}

.company-pill {
    background: #ffffff;
    border: 1px solid #c8dcfb;
    border-radius: 999px;
    color: #184a8d;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.company-pill:hover {
    background: #eef5ff;
    border-color: #b6cff3;
}

.company-pill.is-active {
    background: #2a77d8;
    border-color: #2a77d8;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(42, 119, 216, 0.22);
}

/* Mobile section dropdown */
.subtab-dropdown-container .btn-secondary {
    background: #ffffff;
    border: 1px solid #c8dcfb;
    border-radius: 12px;
    color: #184a8d;
    font-weight: 600;
}

/* Cards */
.company-card {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(17, 56, 114, 0.06);
    margin-bottom: 14px;
    padding: 16px 18px;
}

.company-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.company-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #eef5ff;
    color: #2a77d8;
    font-size: 13px;
    flex-shrink: 0;
}

.company-card-title {
    color: #0d315f;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.company-card-meta {
    margin-left: auto;
    color: #5a6b85;
    font-size: 13px;
    font-weight: 600;
}

.company-card-alert {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    border-radius: 12px;
    color: #9b2c2c;
    margin: 0;
    padding: 10px 12px;
}

.company-empty-state {
    color: #5a6b85;
    margin: 0;
}

/* Label / value rows */
.company-kv {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #eef2f8;
    padding: 8px 0;
    font-size: 14px;
}

.company-kv-label {
    color: #5a6b85;
    flex-shrink: 0;
}

.company-kv-value {
    color: #1f3551;
    font-weight: 600;
    text-align: right;
}

.company-kv-line {
    display: block;
}

.company-kv-sub {
    display: block;
    color: #5a6b85;
    font-size: 12px;
    font-weight: 400;
}

.company-kv-group {
    color: #5a6b85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 12px 0 2px;
}

.company-card-head + .company-kv-group {
    margin-top: 0;
}

/* Officers / PSC stats and person cards */
.company-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.company-stat {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
}

.company-stat-value {
    color: #0d315f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.company-stat-label {
    color: #5a6b85;
    font-size: 12px;
}

.company-person-card {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    margin-bottom: 10px;
    padding: 12px 16px;
}

.company-person-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.company-person-index {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    padding: 1px 7px;
    text-align: center;
}

.company-person-name {
    color: #0d315f;
    font-size: 15px;
    font-weight: 700;
}

a.company-person-name:hover {
    color: #1f6feb;
}

.company-person-role {
    color: #5a6b85;
    font-size: 13px;
    text-transform: capitalize;
}

.company-status-pill {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
    padding: 2px 10px;
}

.company-status-pill.is-active {
    background: #e6f6ec;
    border: 1px solid #b8e3c7;
    color: #1e7a43;
}

.company-status-pill.is-resigned {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #9b2c2c;
}

.company-person-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
}

.company-person-grid .company-kv-wide {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .company-person-grid {
        grid-template-columns: 1fr;
    }

    .company-hero-title {
        font-size: 21px;
    }
}

/* Tables: filings and the five financial statements */
.subview-content .table {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-collapse: separate;
    border-radius: 16px;
    border-spacing: 0;
    font-size: 14px;
    overflow: hidden;
}

.subview-content .table td {
    border-top: 1px solid #eef2f8;
    color: #1f3551;
    padding: 8px 12px;
    vertical-align: middle;
}

.subview-content .table tr:first-child td {
    background: #f8fbff;
    border-top: 0;
    color: #0d315f;
    font-weight: 700;
}

.subview-content .table tr:not(:first-child):hover td {
    background: #f7faff;
}

/* Separate borders let cell backgrounds square off the rounded table corners, so round the corner cells too */
.subview-content .table tr:first-child td:first-child { border-top-left-radius: 15px; }
.subview-content .table tr:first-child td:last-child { border-top-right-radius: 15px; }
.subview-content .table tr:last-child td:first-child { border-bottom-left-radius: 15px; }
.subview-content .table tr:last-child td:last-child { border-bottom-right-radius: 15px; }

.company-card-table .table {
    border-radius: 12px;
    margin-bottom: 0;
}

.company-card-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.company-inline-icon {
    width: 16px;
    margin-top: -3px;
}

/* Charges */
.charge-panel .charge-card {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    margin-bottom: 10px;
    padding: 14px 16px;
}

.charge-panel .charge-title {
    color: #0d315f;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.charge-panel .charge-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.charge-panel .detail-section {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 12px;
    margin: 0;
    padding: 8px 10px;
}

.charge-panel .detail-section dt {
    color: #5a6b85;
    font-size: 12px;
    font-weight: 600;
}

.charge-panel .detail-section dd {
    color: #1f3551;
    font-weight: 600;
    margin: 0;
}

.charge-panel .charge-subheading {
    color: #5a6b85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 8px 0 4px;
}

.charge-panel .charge-list {
    margin-bottom: 4px;
    padding-left: 18px;
}

.charge-panel .document-section {
    color: #5a6b85;
    font-size: 13px;
    margin-top: 6px;
}


/* ---------- 4. Other Search tabs, modals, alerts (Phase 3) ---------- */

/* Shared tab header (Import Companies, Import Directors, Monitored Directors) */
.portal-tab-card {
    max-width: 920px;
    margin: 8px auto 0;
}

.portal-tab-header {
    margin-bottom: 18px;
    text-align: center;
}

.portal-tab-title {
    color: #0d315f;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
}

.portal-tab-title i {
    color: #2a77d8;
    font-size: 0.85em;
    margin-right: 4px;
}

.portal-tab-subtitle {
    color: #5a6b85;
    font-size: 15px;
    margin: 0 auto;
    max-width: 640px;
}

.portal-tab-section-title {
    color: #0d315f;
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin: 18px 0 10px;
}

.portal-tab-section-title i {
    color: #2a77d8;
}

.portal-tab-notice {
    background: #fff7e6;
    border: 1px solid #f5d9a8;
    border-radius: 12px;
    color: #8a5a00;
    font-weight: 600;
    padding: 12px 14px;
}

.portal-beta-badge {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    vertical-align: middle;
}

/* Import Companies (ImportFavourites.cshtml) */
.import-csv-sample {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 14px;
    margin: 0 auto 18px;
    max-width: 260px;
    padding: 12px 16px 14px;
}

.import-csv-sample-label {
    color: #5a6b85;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.import-csv-sample-label {
    display: block;
    margin-bottom: 8px;
    text-align: left;
}

/* Spreadsheet-style sample: column letter row, row numbers, gridlines */
.import-csv-grid {
    border-collapse: collapse;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px;
    width: 100%;
}

.import-csv-grid th,
.import-csv-grid td {
    border: 1px solid #d5e2f5;
    color: #0d315f;
    padding: 4px 10px;
    text-align: left;
}

.import-csv-grid thead th {
    background: #eef3fb;
    color: #5a6b85;
    font-weight: 600;
    text-align: center;
}

.import-csv-grid tbody th {
    background: #eef3fb;
    color: #5a6b85;
    font-weight: 600;
    text-align: center;
    width: 36px;
}

.import-form {
    display: grid;
    gap: 8px;
    margin: 0 auto;
    max-width: 520px;
    text-align: left;
}

.import-form-label {
    color: #0d315f;
    font-size: 13px;
    font-weight: 700;
    margin: 6px 0 0;
}

.import-form .form-control {
    border-color: #c7dafb;
    border-radius: 10px;
}

.import-file-input {
    color: #1d2c4d;
    font-size: 14px;
    height: auto;
    padding: 6px;
}

.import-file-input::file-selector-button {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 8px;
    color: #123a75;
    cursor: pointer;
    font-weight: 600;
    margin-right: 12px;
    padding: 6px 12px;
    transition: background-color 0.18s ease;
}

.import-file-input::file-selector-button:hover {
    background: #dfeeff;
}

.import-upload-btn {
    justify-content: center;
    margin-top: 8px;
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
}

.import-results-summary {
    border-radius: 16px;
}

.import-results-next {
    color: #1f3551;
    margin: 8px 0 12px;
}

/* Import / Monitored Directors (_srImportDirectorsTab, _srMonitoredDirectorsTab) */
.step-box {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(17, 56, 114, 0.06);
}

.step-number {
    background: #2a77d8;
    border-color: #2a77d8;
    box-shadow: 0 6px 14px rgba(42, 119, 216, 0.22);
}

.step-content h6 {
    color: #0d315f;
    font-weight: 700;
}

.step-content p {
    color: #5a6b85;
}

.step-arrow {
    color: #9bbbe8;
}

.advanced-matching-box {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 16px;
    color: #184a8d;
}

.advanced-matching-box h6,
.advanced-matching-box p {
    color: #184a8d;
}

.notification-controls-box {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 16px;
}

.notification-controls-box .badge {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #184a8d;
}

.empty-state h4 {
    color: #0d315f;
    font-weight: 700;
}

.empty-state p {
    color: #5a6b85;
}

.empty-state-icon {
    color: #b6cff3;
    font-size: 48px;
    margin-bottom: 20px;
}

.director-card {
    border: 1px solid #dce7f8;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(17, 56, 114, 0.06);
}

.director-card:hover {
    border-color: #b6cff3;
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.1);
}

.director-card.selected {
    border-color: #2a77d8;
    background: #f7faff;
}

.director-header {
    background: #163d73;
}

.director-number {
    color: #163d73;
}

/* Modals: SIC selector and financial filter popup (already semi-modern in site.css; palette only) */
.ukcdb-modern-modal {
    border-color: #dce7f8;
    border-radius: 20px;
    box-shadow: 0 24px 50px rgba(17, 56, 114, 0.18);
}

.sic-selector-modal-title,
.financial-filter-modal-title {
    color: #184a8d;
    background: #eef5ff;
    border-color: #c6dbfb;
}

.modal-close-pill {
    background: #ffffff;
    border-color: #c8dcfb;
    color: #184a8d;
    font-size: 1.3rem;
    width: 34px;
    height: 34px;
    min-width: 34px;
}

.modal-close-pill:hover {
    background: #eef5ff;
}

.financial-filter-label {
    color: #0d315f;
}

.financial-filter-row {
    border-color: #dce7f8;
    border-radius: 14px;
}

.financial-filter-save-btn,
.sic-selector-save-btn {
    background: #1f6feb;
    border-color: #1b62d2;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
    color: #ffffff;
    font-weight: 600;
}

.financial-filter-save-btn:hover,
.sic-selector-save-btn:hover {
    background: #195fc8;
    border-color: #1657b8;
    color: #ffffff;
}

.sic-selector-clear-all-btn {
    background: #ffffff;
    border-color: #f5c2c2;
    color: #9b2c2c;
}

.sic-selector-clear-all-btn:hover:not(:disabled) {
    background: #fdecec;
    border-color: #e9a3a3;
    color: #9b2c2c;
}

.sic-selector-tab-btn {
    background: #ffffff;
    border-color: #c8dcfb;
    color: #184a8d;
}

.sic-selector-tab-btn:hover {
    background: #eef5ff;
    border-color: #b6cff3;
    color: #123f7b;
}

.sic-selector-tab-btn-active,
.sic-selector-tab-btn-active:hover {
    background: #2a77d8;
    border-color: #2a77d8;
    box-shadow: 0 6px 14px rgba(42, 119, 216, 0.22);
}

.sic-selector-topic-tile {
    border: 1px solid #dce7f8;
    border-radius: 14px;
}

.sic-selector-topic-tile:hover {
    border-color: #b6cff3;
    background: #f7faff;
}

.sic-selector-topic-tile-label {
    color: #0d315f;
}

.sic-selector-topic-tile-selected,
.sic-selector-topic-tile-partial {
    border-color: #2a77d8;
    background-color: #eef5ff;
}

/* SIC selector "Full List": section and division columns like the FUCS side nav, codes list as a card.
   site.css uses !important on the active/selected states, hence the !important here. */
.sic-selector-section-list,
.sic-selector-division-list {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 14px;
    overflow-x: hidden;
    padding: 6px;
}

.sic-selector-section-item {
    background: transparent;
    border-bottom: 0;
    border-radius: 10px;
    color: #103b77;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
    padding: 0.5rem 0.6rem;
}

.sic-selector-section-item:hover:not(.sic-selector-section-item-disabled) {
    background: #eef5ff;
}

.sic-selector-section-item-active {
    background: #2a77d8 !important;
    box-shadow: 0 6px 14px rgba(42, 119, 216, 0.22);
    color: #ffffff !important;
}

.sic-selector-section-icon {
    background: #ffffff;
    border: 1px solid #dce7f8;
    width: 1.8rem;
    height: 1.8rem;
    min-width: 1.8rem;
    font-size: 0.9rem;
}

.sic-selector-section-item-active .sic-selector-section-icon {
    border-color: transparent;
}

.sic-selector-codes-panel {
    border-color: #dce7f8 !important;
    border-radius: 14px !important;
}

.sic-selector-codes-header {
    background: #f8fbff;
    border-bottom-color: #e4ecf8 !important;
    color: #0d315f;
    font-weight: 700;
}

.sic-selector-codes-header .sic-selector-actions .btn-link {
    color: #1f6feb;
    font-weight: 600;
}

.sic-selector-code-row {
    border-bottom: 1px solid #eef2f8 !important;
    color: #1f3551;
    font-size: 0.9rem;
}

.sic-selector-code-row:hover:not(:disabled) {
    background: #f7faff;
}

.sic-selector-code-row-selected {
    background: #eef5ff !important;
    color: #0d315f !important;
}

.sic-selector-code-checkbox {
    border: 1.5px solid #b6cff3;
    border-radius: 5px;
    color: #ffffff;
    font-weight: 700;
}

.sic-selector-code-row-selected .sic-selector-code-checkbox {
    background: #2a77d8;
    border-color: #2a77d8;
}

.sic-selector-code-code {
    color: #184a8d;
}

.sic-selector-code-row-selected .sic-selector-code-code {
    color: #184a8d;
}

/* Anonymous "Browsing anonymously" prompt (_loginPromptPartial.cshtml) */
.login-prompt-card {
    background: #fff9ec;
    border: 1px solid #f5d9a8;
    border-radius: 18px;
    color: #5c4300;
    padding: 14px 18px;
}

.login-prompt-card h4 {
    color: #0d315f;
    font-size: 17px;
    font-weight: 700;
}

.login-prompt-card .table td {
    color: #5c4300;
    padding: 4px 0;
}

.login-prompt-card .btn {
    background: #1f6feb;
    border-color: #1b62d2;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
    color: #ffffff;
    font-weight: 600;
}

.login-prompt-card .btn:hover {
    background: #195fc8;
}

/* ---------- 5. Other portal pages (Phase 4) ---------- */

/* Login, Welcome, ThanksProceedToPurchase: one centred card on the page background.
   .full_bg (solid purple-blue, fixed 800px) is only used by these three pages. */
.full_bg {
    background: transparent;
    height: auto;
    padding: 0;
}

.full_bg .signup_section {
    margin: 0;
}

.portal-auth-card form,
.portal-auth-card .section_title {
    padding: 0;
}

.signup_form.portal-auth-card form .form-group .form-control {
    border: 1px solid #c7dafb;
    border-radius: 10px;
    color: #1f3551;
    font-weight: 400;
    height: 44px;
    padding: 6px 12px;
}

.signup_form.portal-auth-card form .form-group .form-control:focus {
    border-color: #8db7f1;
    box-shadow: 0 0 0 3px rgba(42, 119, 216, 0.14);
    color: #1f3551;
}

.signup_form.portal-auth-card form .form-group {
    margin-bottom: 14px;
}

/* Login, Welcome, ThanksProceedToPurchase: one centred card */
.signup_form.portal-auth-card {
    background: #ffffff;
    border: 1px solid #dce7f8;
    border-radius: 20px;
    box-shadow: 0 12px 26px rgba(17, 56, 114, 0.08);
    margin: 32px auto 16px;
    max-width: 480px;
    padding: 28px 30px 22px;
}

.portal-auth-head {
    margin-bottom: 18px;
    text-align: center;
}

.portal-auth-logo {
    display: block;
    margin: 0 auto 12px;
}

.signup_form .portal-auth-title {
    color: #0d315f;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.portal-auth-lead {
    color: #5a6b85;
    font-size: 14px;
    margin: 0;
}

.portal-auth-label {
    color: #0d315f;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.portal-auth-card .form-control {
    border-color: #c7dafb;
    border-radius: 10px;
    height: 42px;
}

.portal-auth-card .form-control:focus {
    border-color: #8db7f1;
    box-shadow: 0 0 0 3px rgba(42, 119, 216, 0.14);
}

.portal-auth-head .portal-auth-btn {
    margin-top: 18px;
}

.portal-auth-btn {
    justify-content: center;
    width: 100%;
    font-size: 14px;
    padding: 11px 12px;
}

.portal-auth-note {
    color: #5a6b85;
    font-size: 12px;
    margin: 12px 0 0;
    text-align: center;
}

.portal-auth-help {
    border-top: 1px solid #eef2f8;
    color: #5a6b85;
    font-size: 13px;
    margin-top: 16px;
    padding-top: 14px;
}

.portal-auth-back {
    font-size: 13px;
    margin-bottom: 24px;
}

.portal-auth-back a {
    color: #184a8d;
    font-weight: 600;
}

.portal-auth-icon {
    width: 15px;
    margin-top: -3px;
}

.portal-auth-spinner {
    display: block;
    margin: 4px auto 0;
}

/* Officer page */
.portal-page-shell {
    margin: 8px auto 24px;
    max-width: 1100px;
}

.portal-back-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.portal-back-links .company-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.company-card-icon img {
    width: 14px;
}

/* Alerts inside the portal: rounded, softer */
#app .alert {
    border-radius: 14px;
}

/* SweetAlert2 dialogs and toasts */
.swal2-popup {
    border-radius: 20px !important;
    font-family: 'Poppins', sans-serif;
}

.swal2-popup.swal2-toast {
    border: 1px solid #dce7f8;
    border-radius: 14px !important;
    box-shadow: 0 14px 30px rgba(17, 56, 114, 0.12) !important;
}

.swal2-title {
    color: #0d315f !important;
}

.swal2-html-container {
    color: #1f3551 !important;
}

.swal2-styled.swal2-confirm {
    background: #1f6feb !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22) !important;
    font-weight: 600;
}

.swal2-styled.swal2-cancel,
.swal2-styled.swal2-deny {
    background: #eef5ff !important;
    border: 1px solid #c6dbfb !important;
    border-radius: 10px !important;
    color: #184a8d !important;
    font-weight: 600;
}

.swal2-input,
.swal2-textarea {
    border-color: #c7dafb !important;
    border-radius: 10px !important;
}

/* Search in progress: card with progress track and cancel link */
.search-loading-card {
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(18, 58, 117, 0.06);
    margin: 20px auto;
    max-width: 640px;
    padding: 20px 22px;
    width: calc(100% - 32px);
}

.search-loading-head {
    align-items: center;
    display: flex;
    gap: 12px;
}

.search-loading-spinner {
    animation: search-loading-spin 0.9s linear infinite;
    border: 3px solid #e6edf8;
    border-top-color: #2a77d8;
    border-radius: 50%;
    flex-shrink: 0;
    height: 26px;
    width: 26px;
}

.search-loading-text {
    color: #1d2c4d;
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

.search-loading-track {
    background: #e6edf8;
    border-radius: 999px;
    height: 26px;
    margin-top: 16px;
    overflow: hidden;
}

.search-loading-fill {
    align-items: center;
    background: linear-gradient(90deg, #2a77d8, #5a9ef0);
    border-radius: 999px;
    display: flex;
    height: 100%;
    justify-content: flex-end;
    min-width: 2.5rem;
    padding-right: 10px;
    transition: width 0.4s ease;
}

.search-loading-percent {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.search-loading-actions {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.search-loading-cancel {
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 999px;
    color: #123a75;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.search-loading-cancel:hover {
    background: #eef5ff;
    border-color: #b6cff3;
}

@keyframes search-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .search-loading-spinner { animation: none; }
    .search-loading-fill { transition: none; }
}

/* Search cancelled note */
.search-cancelled-note {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #c9d9f1;
    border-radius: 14px;
    color: #1d2c4d;
    display: flex;
    font-size: 15px;
    gap: 10px;
    margin: 20px auto;
    max-width: 640px;
    padding: 14px 18px;
    width: calc(100% - 32px);
}

.search-cancelled-note i {
    color: #2a77d8;
}

/* Results pager: one line, page label and buttons never wrap */
.results-pager {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
    margin: 16px 0 0;
    white-space: nowrap;
}

.results-pager-btn {
    background: #ffffff;
    border: 1px solid #b6cff3;
    border-radius: 999px;
    color: #1d4f93;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.results-pager-btn:hover:not(:disabled) {
    background: #eef5ff;
    color: #123f7b;
}

.results-pager-btn:disabled {
    border-color: #dce7f8;
    color: #a9b8cf;
    cursor: default;
}

.results-pager-page {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #0d315f;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
}

/* Summary bar: stats, pager and actions share one line on desktop */
@media (min-width: 992px) {
    .results-summary-bar {
        align-items: center;
        flex-wrap: nowrap;
    }
    .results-summary-bar .results-pager-col {
        flex: 0 0 auto;
        max-width: none;
    }
}

/* Action buttons sit side by side and never stack */
.results-summary-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.results-summary-actions .btn {
    margin: 0 !important;
}

/* Compact progress inside the results bar: full width, short bar, no extra padding */
.search-count-progress {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    max-width: 100%;
}

.search-count-text {
    color: #1d2c4d;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.search-count-progress .search-loading-track {
    height: 18px;
    margin-top: 8px;
    width: 100%;
}

.search-count-progress .search-loading-percent {
    font-size: 11px;
}

.search-count-progress .search-loading-actions {
    justify-content: flex-start;
    margin-top: 8px;
}

/* Results bar: stats, pager and actions line up at the top */
.results-summary-bar {
    align-items: flex-start !important;
}

.results-summary-bar .col-md {
    flex: 1 1 300px;
    min-width: 260px;
}

.results-summary-bar .results-pager,
.results-summary-bar .results-summary-actions {
    margin-top: 0;
}

/* Results bar stays on one row: stats takes the spare width, pager and actions keep their size */
.results-summary-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
}

.results-summary-bar > .col-md {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
}

.results-summary-bar > .col-md-auto {
    flex: 0 0 auto;
    max-width: none;
    width: auto;
}

/* Calculating progress: text on top, bar and Cancel side by side */
.search-count-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
}

.search-count-progress .search-count-text {
    grid-column: 1 / -1;
}

.search-count-progress .search-loading-track {
    grid-column: 1;
    margin-top: 8px;
}

.search-count-progress .search-loading-actions {
    grid-column: 2;
    margin-top: 8px;
}

.search-count-progress .search-loading-cancel {
    white-space: nowrap;
}

/* Results bar as a grid: stats on the left, pager with the actions stacked under it on the right */
.results-summary-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    row-gap: 10px;
    align-items: start;
}

.results-summary-bar > .col-md {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.results-summary-bar > .results-pager-col {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.results-summary-bar > .col-md-auto:not(.results-pager-col) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
}

.results-summary-bar > div:not([class]) {
    grid-column: 1 / -1;
}

.results-summary-bar .results-pager {
    justify-content: flex-end;
    margin: 0;
}

.results-summary-bar .search-count-progress .search-loading-track {
    height: 22px;
}

/* Company tab: give the Company and Financials pill rows real breathing room */
.company-pill-rows {
    gap: 22px;
    margin-bottom: 18px;
    padding: 6px 0 4px;
}

.company-pill-rows .company-pill-row + .company-pill-row {
    margin-top: 4px;
}

/* Actions sit under the pager and span exactly its width */
.results-summary-bar > .results-pager-col,
.results-summary-bar > .col-md-auto:not(.results-pager-col) {
    justify-self: stretch;
}

.results-summary-bar > .col-md-auto:not(.results-pager-col) {
    grid-column: 2;
    grid-row: 2;
}

.results-summary-bar .results-summary-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.results-summary-bar .results-summary-actions > .dropdown,
.results-summary-bar .results-summary-actions > .app_button_small {
    flex: 1 1 0;
}

.results-summary-bar .results-summary-actions .btn,
.results-summary-bar .results-summary-actions .dropdown > .btn {
    width: 100%;
    justify-content: center;
}

/* Company Lists dropdown */
.lists-toggle {
    align-items: center;
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 999px;
    color: #123a75;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    padding: 7px 14px 7px 16px;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.lists-toggle:hover,
.lists-toggle:focus,
.lists-toggle[aria-expanded="true"] {
    background: #eef5ff;
    border-color: #b6cff3;
    color: #123a75;
    box-shadow: none;
}

.lists-toggle-count {
    background: #123a75;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    padding: 4px 7px;
}

.lists-menu {
    border: 1px solid #c9d9f1;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(18, 58, 117, 0.12);
    max-height: 320px;
    min-width: 320px;
    overflow-y: auto;
    padding: 6px;
}

.lists-item {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 8px 8px 10px;
}

.lists-item:hover {
    background: #f4f8ff;
}

.lists-item-name {
    color: #1d2c4d;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lists-item-index {
    color: #5a6b85;
    display: inline-block;
    font-weight: 700;
    margin-right: 8px;
    min-width: 16px;
}

.lists-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.lists-icon-btn {
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 8px;
    color: #2a77d8;
    cursor: pointer;
    height: 30px;
    width: 32px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.lists-icon-btn:hover {
    background: #eef5ff;
    border-color: #b6cff3;
}

.lists-icon-btn-danger {
    color: #b42318;
}

.lists-icon-btn-danger:hover {
    background: #fdf1f0;
    border-color: #f0c2bd;
}

.lists-empty,
.lists-hint {
    color: #5a6b85;
    font-size: 13px;
    padding: 10px 12px;
}

.lists-empty-icon {
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
    width: 16px;
}

.lists-hint {
    text-align: center;
}

/* Results bar with no progress showing: stats sit centred against the pager and buttons, not floating at the top */
.results-summary-bar > .col-md {
    align-self: center;
}

/* My Account page */
.account-page {
    margin-bottom: 40px;
    max-width: 880px;
    padding: 0 16px;
}

.account-card {
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(18, 58, 117, 0.06);
    margin-bottom: 18px;
    padding: 6px 22px 10px;
}

.account-card-title {
    border-bottom: 1px solid #e6edf8;
    color: #0d315f;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    padding: 14px 0 12px;
}

.account-row {
    align-items: flex-start;
    border-bottom: 1px solid #eef3fb;
    display: grid;
    gap: 8px 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    padding: 14px 0;
}

.account-row:last-child {
    border-bottom: 0;
}

.account-label {
    color: #1d2c4d;
    font-size: 14px;
    font-weight: 600;
    padding-top: 6px;
}

.account-value {
    color: #1d2c4d;
    font-size: 14px;
    min-width: 0;
}

.account-credits {
    font-size: 22px;
    font-weight: 700;
}

.account-email {
    font-size: 15px;
    overflow-wrap: anywhere;
}

.account-sub {
    color: #5a6b85;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}

.account-badge {
    background: #e7f6ec;
    border: 1px solid #b9e3c6;
    border-radius: 999px;
    color: #14532d;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
}

.account-badge-danger {
    background: #fdf1f0;
    border-color: #f0c2bd;
    color: #8a1c12;
}

.account-manage-btn {
    margin-left: 8px;
    padding: 4px 12px !important;
    font-size: 13px !important;
}

.account-key {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    max-width: 100%;
    word-break: break-all;
}

.account-key code {
    background: #f4f8ff;
    border: 1px solid #dce7f8;
    border-radius: 8px;
    color: #0d315f;
    padding: 6px 10px;
}

.account-copy {
    color: #2a77d8;
    cursor: pointer;
}

.account-btn-danger {
    background: #fdf1f0 !important;
    border: 1px solid #f0c2bd !important;
    color: #b42318 !important;
}

.account-note {
    border-radius: 12px;
    font-size: 13px;
    margin: 4px 0 8px;
    padding: 10px 14px;
}

.account-note-info {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    color: #184a8d;
}

.account-test-note {
    margin: 10px 0 8px;
    text-align: center;
}

.account-actions {
    display: flex;
    justify-content: center;
    margin: 6px 0 14px;
}

.account-footnote {
    color: #5a6b85;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 700px) {
    .account-row {
        grid-template-columns: 1fr;
    }
}
"EOF

/* Header: package badge centred on the logo line */
.portal-header-inner .navbar {
    align-items: center;
}

.portal-header-inner .navbar > .badge {
    align-self: center;
    margin-left: 10px;
}

/* User menu: roomier rows, rounded highlight on Documentation, icon tile */
.portal-user-menu-dropdown {
    border-radius: 16px;
    min-width: 240px;
    padding: 8px;
}

.portal-user-menu-dropdown .dropdown-item {
    align-items: center;
    border-radius: 12px;
    color: #1d2c4d;
    display: flex;
    font-size: 15px;
    font-weight: 600;
    gap: 12px;
    padding: 11px 12px;
}

.portal-user-menu-dropdown .dropdown-item:hover {
    background: #eef5ff;
    color: #123a75;
}

.portal-user-menu-dropdown .portal-dropdown-link {
    background: #eef5ff;
    color: #123a75;
    font-weight: 700;
}

.portal-user-menu-dropdown .dropdown-icon {
    align-items: center;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(17, 56, 114, 0.08);
    display: flex;
    flex-shrink: 0;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.portal-user-menu-dropdown .dropdown-icon img {
    height: 18px;
    width: 18px;
}

.portal-user-menu-dropdown .dropdown-divider {
    border-top: 1px solid #e6edf8;
    margin: 6px 4px;
}
"EOF

/* Brand and package badge share one centre line (the inline logo baseline pushed the brand box down) */
.portal-header-inner .navbar-brand {
    align-items: center;
    display: flex;
}

.portal-header-inner .brand-mark {
    align-items: center;
    display: flex;
    gap: 8px;
}

.portal-header-inner .navbar > .badge {
    line-height: 1;
    margin-top: 0;
    margin-bottom: 0;
}
"EOF

/* SweetAlert dialogs (ukcdb-swal classes from app.js): rounded card, navy title, pill buttons */
.swal2-popup.ukcdb-swal {
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(18, 58, 117, 0.22);
    max-width: 520px;
    padding: 28px 28px 24px;
    width: calc(100% - 32px);
}

.ukcdb-swal .ukcdb-swal-title {
    color: #0d315f;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
    padding: 0;
}

.ukcdb-swal .ukcdb-swal-text {
    color: #5a6b85;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 auto;
}

.ukcdb-swal .ukcdb-swal-text strong {
    color: #0d315f;
}

.ukcdb-swal .ukcdb-swal-input {
    border: 1px solid #c9d9f1;
    border-radius: 12px;
    box-shadow: none;
    color: #1d2c4d;
    font-size: 15px;
    height: 48px;
    margin: 20px auto 0;
    width: 100%;
}

.ukcdb-swal .ukcdb-swal-input:focus {
    border-color: #2a77d8;
    box-shadow: 0 0 0 3px rgba(42, 119, 216, 0.15);
    outline: none;
}

.ukcdb-swal .ukcdb-swal-actions {
    gap: 10px;
    margin: 22px auto 0;
}

.ukcdb-swal .ukcdb-swal-confirm,
.ukcdb-swal .ukcdb-swal-cancel {
    border-radius: 999px !important;
    font-size: 15px;
    font-weight: 700;
    min-width: 110px;
    padding: 10px 22px !important;
}

.ukcdb-swal .ukcdb-swal-confirm {
    background: #2a77d8 !important;
    box-shadow: 0 8px 18px rgba(42, 119, 216, 0.25);
}

.ukcdb-swal .ukcdb-swal-confirm:focus {
    box-shadow: 0 0 0 3px rgba(42, 119, 216, 0.25) !important;
}

.ukcdb-swal .ukcdb-swal-cancel {
    background: #eef5ff !important;
    border: 1px solid #c6dbfb !important;
    box-shadow: none;
    color: #123a75 !important;
}

.ukcdb-swal .ukcdb-swal-close {
    color: #8a97ab;
    font-size: 30px;
    font-weight: 400;
    top: 12px;
    right: 14px;
}

.ukcdb-swal .ukcdb-swal-close:hover {
    color: #123a75;
}

.ukcdb-swal .swal2-validation-message {
    background: #fdf1f0;
    border-radius: 10px;
    color: #b42318;
    font-size: 14px;
    margin: 12px auto 0;
}

/* Exporting: hide the stats and Save as a list, and let the export progress use the whole bar */
.results-summary-bar:has(.search-export-progress) > .col-md {
    display: none;
}

.results-summary-bar:has(.search-export-progress) .results-summary-actions > .app_button_small {
    display: none;
}

.results-summary-bar:has(.search-export-progress) > .col-md-auto:not(.results-pager-col) {
    grid-column: 1 / -1;
    justify-self: stretch;
}

.search-export-progress {
    align-items: stretch !important;
    padding: 8px 0 !important;
    width: 100%;
}

.search-export-progress > div:first-child {
    text-align: center;
}

.search-export-progress .search-loading-track {
    height: 22px;
    width: 100%;
}

.search-export-progress .search-loading-actions {
    justify-content: center;
}

/* Dialog spacing: more room around the Save as a list popup */
.swal2-popup.ukcdb-swal {
    padding: 36px 36px 30px;
}

.ukcdb-swal .ukcdb-swal-title {
    margin: 0 0 14px;
}

/* Import results: one panel with a stat strip and a plain table */
.import-results {
    background: #ffffff;
    border: 1px solid #c9d9f1;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(18, 58, 117, 0.06);
    margin: 0 auto 18px;
    max-width: 920px;
    padding: 22px 24px 24px;
}

.import-results-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.import-results-title {
    color: #0d315f;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.import-results-close {
    background: #eef5ff;
    border: 1px solid #c6dbfb;
    border-radius: 999px;
    color: #123a75;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 18px;
    transition: background-color 0.18s ease;
}

.import-results-close:hover {
    background: #dfeeff;
}

.import-results-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.import-results-stat {
    background: #f8fbff;
    border: 1px solid #dce7f8;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    text-align: center;
}

.import-results-stat-value {
    color: #0d315f;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.import-results-stat-label {
    color: #5a6b85;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.import-results-stat-added .import-results-stat-value {
    color: #14653a;
}

.import-results-has-errors .import-results-stat:last-child {
    background: #fdf1f0;
    border-color: #f0c2bd;
}

.import-results-has-errors .import-results-stat:last-child .import-results-stat-value {
    color: #8a1c12;
}

.import-results-next {
    color: #5a6b85;
    font-size: 14px;
    margin: 14px 0 0;
    text-align: center;
}

.import-results-table-wrap {
    border: 1px solid #e6edf8;
    border-radius: 14px;
    margin-top: 16px;
    max-height: 420px;
    overflow: auto;
}

.import-results-table {
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
    width: 100%;
}

.import-results-table th,
.import-results-table td {
    border-bottom: 1px solid #eef3fb;
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
}

.import-results-table thead th {
    background: #f8fbff;
    color: #5a6b85;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
}

.import-results-table tbody tr:last-child td {
    border-bottom: 0;
}

.import-results-table tbody tr:hover {
    background: #f8fbff;
}

@media (max-width: 575px) {
    .import-results-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Import results sit inside the page's own panel, so they don't get a second white card */
.import-results {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    padding: 4px 0 0;
}
