/*
 * Registered Funds module styles.
 *
 * The site ships a customised Bootstrap 5.0.0-beta1 build (main.css) that has no
 * .text-dark, no .offcanvas and a .row that is not a flex container, and its
 * .bg-light is pure white while .badge text is white. Everything the module needs
 * beyond that build is defined here, scoped to the module pages, so status states
 * stay legible and layouts do not depend on utilities the build lacks.
 */

/* ---------- Status badges (all combinations meet WCAG AA 4.5:1) ---------- */
.rf-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
    vertical-align: middle;
    background: #EEF0F2;
    color: #2E3338;
    border-color: #D5D9DE;
}

.rf-badge--ok {
    background: #E3F4EF;
    color: #0F5B44;
    border-color: #B9E3D3;
}

.rf-badge--info {
    background: #E0F2F4;
    color: #0B4F55;
    border-color: #B3DEE3;
}

.rf-badge--review {
    background: #FFF3D6;
    color: #6E4300;
    border-color: #F5D98A;
}

.rf-badge--warn {
    background: #FBE3E3;
    color: #8A1C1C;
    border-color: #F1B8B8;
}

.rf-badge--neutral {
    background: #EEF0F2;
    color: #2E3338;
    border-color: #D5D9DE;
}

a.rf-badge,
a.rf-badge:hover,
a.rf-badge:focus {
    text-decoration: none;
    color: inherit;
}

a.rf-badge:hover,
a.rf-badge:focus {
    filter: brightness(0.96);
    outline: 2px solid #00A6A6;
    outline-offset: 1px;
}

/* ---------- Page header buttons ---------- */
.rf-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: flex-start;
}

.rf-page-actions .btn {
    white-space: nowrap;
}

/* ---------- Metric strips and card grids ---------- */
.rf-metric-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.rf-metric-strip > * {
    flex: 1 1 170px;
    min-width: 0;
}

.rf-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.rf-card-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.rf-card {
    border: 1px solid #DEDEDE;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
    min-width: 0;
}

.rf-card--warn {
    border-color: #F1B8B8;
    background: #FFF8F8;
}

.rf-card--review {
    border-color: #F5D98A;
    background: #FFFCF3;
}

.rf-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

/* ---------- Tables ---------- */
.rf-nowrap {
    white-space: nowrap;
}

.rf-table {
    table-layout: auto;
}

.rf-table td,
.rf-table th {
    vertical-align: top;
}

.rf-table td {
    overflow-wrap: anywhere;
}

.rf-table .rf-col-name {
    min-width: 220px;
}

.rf-table .rf-col-parties {
    min-width: 200px;
    max-width: 320px;
}

.rf-table .rf-col-date {
    min-width: 110px;
    white-space: nowrap;
}

.rf-table .rf-col-money {
    min-width: 110px;
    white-space: nowrap;
    text-align: right;
}

.rf-party-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rf-party-list li {
    margin-bottom: 4px;
}

.rf-party-more {
    display: inline-block;
    margin-top: 2px;
}

.rf-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Evidence side panel (module-owned; the site's Bootstrap build has no offcanvas) ---------- */
.rf-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
}

.rf-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(440px, 100%);
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rf-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #DEDEDE;
}

.rf-panel__header h2 {
    font-size: 18px;
    margin: 0;
    overflow-wrap: anywhere;
}

.rf-panel__close {
    background: none;
    border: 1px solid #C9CED3;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    color: #2E3338;
}

.rf-panel__close:hover,
.rf-panel__close:focus {
    border-color: #00A6A6;
    outline: 2px solid #00A6A6;
    outline-offset: 1px;
}

.rf-panel__body {
    padding: 16px 20px 24px;
    overflow-y: auto;
}

.rf-panel__body dl {
    margin: 0;
}

.rf-panel__body dt {
    font-weight: 400;
    color: #777777;
    font-size: 13px;
    margin-top: 12px;
}

.rf-panel__body dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.rf-panel__body .rf-panel__links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Selected share class ---------- */
.rf-row--selected td {
    background: #E0F2F4 !important;
}

.rf-callout {
    border-left: 4px solid #00A6A6;
    background: #F3FAFA;
    padding: 12px 16px;
    border-radius: 4px;
}

.rf-callout--muted {
    border-left-color: #C9CED3;
    background: #F7F8F9;
}

.rf-coverage-state {
    border: 1px dashed #C9CED3;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #4B5257;
}

.rf-small-muted {
    color: #6C757D;
    font-size: 13px;
}

/* Review walkthrough: separate navigation, actions and data. */
.rf-results-actions { padding: 8px 0; }
.rf-list-action { position: relative; }
.rf-list-action > summary { list-style: none; }
.rf-list-panel { position: absolute; right: 0; top: 100%; z-index: 20; background: white; border: 1px solid #dce5e4; border-radius: 8px; padding: 16px; width: 300px; box-shadow: 0 6px 18px #1233; }
.rf-shortcuts { text-align: right; }
.rf-shortcuts > summary, .rf-help > summary { cursor: pointer; color: #137e78; font-size: 13px; }
.rf-shortcuts[open] .rf-quick-filters { padding-top: 12px; max-width: 700px; }
.rf-help { font-size: 13px; }
.rf-help[open] > :not(summary) { margin-top: 8px; }
.rf-help .notes { max-width: 900px; }
.rf-assets-note { display: flex; flex-wrap: wrap; gap: 8px 24px; color: #64716f; font-size: 13px; }
#registeredFundsPage .rf-metric-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px; padding: 0 !important; border: 0 !important; }
#registeredFundsPage .rf_metric { border: 1px solid #e0e8e7; background: #f8fbfa; padding: 14px; border-radius: 8px; min-width: 0; }
.rf-structure-icon { display: inline-flex; justify-content: center; align-items: center; width: 34px; height: 34px; border: 1px solid #b4d5d1; border-radius: 8px; background: #eaf5f3; color: #176963; font-size: 23px; font-weight: 600; cursor: help; }
.rf-class-toggle { border: 0; border-radius: 4px; padding: 4px 8px; margin-top: 6px; background: #eaf5f3; color: #166f68; font-size: 13px; }
.rf-class-row[hidden] { display: none !important; }
.rf-class-row > td { background: #f5faf9 !important; padding: 0 !important; }
.rf-class-content { margin: 10px 20px 16px; padding: 8px 16px; border-left: 3px solid #7bbcb6; }
.rf-class-list { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0; }
.rf-class-item { display: flex; flex-direction: column; min-width: 160px; }
.rf-chart-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rf-chart-heading h3 { margin: 0; }
.rf-adviser-chart-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,1fr); align-items: center; gap: 16px; }
.rf-adviser-canvas { position: relative; height: 240px; min-width: 0; }
.rf-adviser-canvas canvas[hidden] { display: none; }
.rf-adviser-chart, .rf-private-summary { min-width: 0; }
.rf-fund-charts { display: flex; flex-wrap: wrap; gap: 24px; width: calc(100% - 30px); }
.rf-fund-charts > .block_content_ws { flex: 1 1 450px; width: auto; margin-right: 0; }
.rf-adviser-chart .rf-adviser-canvas canvas { min-height: 0; max-height: none; }
.rf-adviser-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e1e9e8; }
.rf-adviser-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 14px; }
.rf-adviser-source { background: #f6faf9; padding: 10px; border-radius: 6px; }
.rf-role-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rf-role-source { border-top: 1px solid #dfe8e6; padding: 10px 0; }
.rf-provider-table td { vertical-align: top; }
.rf-category-0 { background: #e6eff6; color: #294f6d; }
.rf-category-1 { background: #e1f1ed; color: #25594c; }
.rf-category-2 { background: #eee8f5; color: #57416e; }
.rf-category-3 { background: #f3eedb; color: #64531f; }
.rf-category-4 { background: #e9eedf; color: #44582c; }
.rf-category-5 { background: #e9ebf0; color: #414c65; }
.rf-activity-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.rf-activity-controls label { font-size: .875rem; }
.rf-activity-evidence { min-width: 220px; max-width: 480px; padding: .75rem 0; }
.rf-activity-subject { display: block; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-watchlist-picker { position: relative; }
.rf-watchlist-options { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 280px; background: white; border: 1px solid #d8e0e3; border-radius: 6px; box-shadow: 0 4px 12px #0002; padding: 1rem; }
.rf-activity-table td { vertical-align: top; }
.rf-activity-table tr[hidden] { display: none; }
.rf-activity-group th { background: #f3f5f7; }
.rf-lifecycle-form { display: grid; gap: .8rem; max-width: 650px; padding-top: 1rem; }
.rf-history-canvas { position: relative; height: 290px; }
.rf-history-canvas canvas { min-height: 0 !important; max-height: 100% !important; }
.rf-registered-summary-row { clear: both; width: 100%; }
.rf-provider-table th:first-child { width: 30%; }
.rf-provider-table th:nth-child(2) { width: 38%; }
@media (max-width: 1000px) {
    #registeredFundsPage .rf-metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rf-adviser-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .rf-shortcuts { text-align: left; }
    .rf-adviser-links { flex-direction: column; }
    .rf-list-panel { width: 260px; }
}

/* Overview: explicit grids avoid dependence on mixed Bootstrap gutter utilities. */
#registeredFundOverview .rf-metric-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:0!important; border:0!important; background:transparent!important; margin-bottom:24px!important; }
#registeredFundOverview .rf-overview-metric { min-width:0; padding:20px; background:#fff; border:1px solid #e1e8e8; border-radius:10px; box-shadow:0 2px 6px #123e3e05; }
#registeredFundOverview .rf-overview-metric strong { display:block; font-size:26px; line-height:1.3; margin:7px 0; font-variant-numeric:tabular-nums; }
#registeredFundOverview .rf-overview-metric .small { font-size:13px; line-height:1.5; }
#registeredFundOverview .rf-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin-bottom:24px; }
#registeredFundOverview .rf-overview-cell { min-width:0; }
#registeredFundOverview .rf-overview-cell > div { padding:24px!important; border-radius:10px!important; height:100%; }
#registeredFundOverview .rf-page-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; align-content:flex-start; }
#registeredFundOverview .table { margin-top:14px; }
.rf-directory-panel { padding:24px; margin:20px 0; background:white; border:1px solid #e1e8e8; border-radius:10px; }
.rf-directory-search,.rf-directory-pager { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:16px 0; }
.rf-directory-search input { max-width:360px; }
@media(max-width:1000px) { #registeredFundOverview .rf-metric-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } #registeredFundOverview .rf-overview-grid { grid-template-columns:1fr; } }
@media(max-width:600px) { #registeredFundOverview .rf-metric-strip { grid-template-columns:1fr; } #registeredFundOverview .rf-page-actions { justify-content:flex-start; } }
