:root {
    --bg: #f0f3fa;
    --paper: #ffffff;
    --panel: #0f1e3e;
    --panel-soft: #172b55;
    --panel-muted: rgba(87, 217, 255, 0.1);
    --accent: #285bb8;
    --accent-soft: #eef3fa;
    --text: #1a2340;
    --muted: #5a6a8a;
    --line: #e8ecf3;
    --cyan: #57d9ff;
    --shadow: 0 8px 28px rgba(15, 30, 62, 0.06);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI Variable", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #f7f9fd 0%, var(--bg) 100%);
}

a {
    color: inherit;
}

.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navigation {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 68px;
    padding: 10px 28px;
    color: #ffffff;
    background: var(--panel);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(15, 30, 62, 0.12);
}

.top-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    color: #ffffff;
    text-decoration: none;
}

.top-brand-copy {
    display: grid;
    gap: 2px;
}

.top-brand-copy strong {
    font-size: 0.92rem;
}

.top-brand-copy small {
    color: rgba(255, 255, 255, 0.44);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-links {
    display: flex;
    align-self: stretch;
    justify-content: center;
}

.top-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.top-links a::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: -10px;
    left: 16px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}

.top-links a:hover,
.top-links a.active {
    color: var(--cyan);
}

.top-links a.active::after {
    background: var(--cyan);
}

.top-context {
    justify-self: end;
    padding: 7px 11px;
    border: 1px solid rgba(87, 217, 255, 0.22);
    border-radius: 8px;
    color: var(--cyan);
    background: rgba(87, 217, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 600;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 16px 18px;
    color: #f6f9ff;
    background:
        linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar h1 {
    margin: 8px 0 12px;
    font-size: 1.35rem;
    line-height: 1.05;
}

.brand-block {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    color: #0d2b66;
    background: linear-gradient(135deg, #ffffff 0%, #cfe0ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.main-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 32px 40px;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.sidebar .muted {
    color: rgba(232, 240, 255, 0.76);
}

.nav-links {
    display: grid;
    gap: 8px;
}

.nav-section-label {
    margin: 2px 8px -8px;
    color: rgba(255, 255, 255, 0.34);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.nav-links a {
    justify-content: flex-start;
}

.nav-links a.active {
    color: var(--cyan);
    background: rgba(87, 217, 255, 0.12);
}

.nav-links a,
.button-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    color: #f8fbff;
    background: var(--panel-muted);
    transition: transform 0.18s ease, background 0.18s ease;
}

.button-link,
button {
    color: #f8fbff;
    background: linear-gradient(135deg, #2d7ff9 0%, #1b56c4 100%);
}

.nav-links a:hover,
.button-link:hover,
button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}

.button-link:hover,
button:hover {
    background: linear-gradient(135deg, #3d8cff 0%, #1b56c4 100%);
}

.danger-button {
    margin-top: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.subtle-danger {
    margin-top: 0;
}

.danger-button:hover {
    background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
}

.sidebar-note {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: auto;
    font-size: 0.78rem;
}

.note-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(232, 240, 255, 0.72);
}

.workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 2px 0 0;
    min-height: auto;
}

.workspace-bar h2 {
    margin: 6px 0 0;
    font-size: 1.35rem;
}

.workspace-pill {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #1f4ea3;
    background: rgba(255, 255, 255, 0.72);
}

.hero-card,
.content-card {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid rgba(217, 229, 251, 0.9);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.funds-heading h2 {
    margin: 7px 0 5px;
    font-size: 1.2rem;
}

.funds-heading .muted {
    margin: 0;
    font-size: 0.86rem;
}

.export-button {
    color: #ffffff;
    background: var(--panel);
}

.export-button:hover {
    color: var(--panel);
    background: rgba(87, 217, 255, 0.2);
}

.fund-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.summary-card {
    position: relative;
    overflow: hidden;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.summary-card::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
}

.summary-card.accent::after {
    background: var(--cyan);
}

.summary-card.sync-card::after {
    background: #0a7c4a;
}

.summary-card.sync-card strong {
    font-size: 1.05rem;
    line-height: 1.35;
}

.sync-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sync-refresh-form {
    margin: 0;
}

.sync-refresh-button {
    display: grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    place-items: center;
    border: 1px solid #c9d9ee;
    border-radius: 50%;
    background: #ffffff;
    color: #1769d2;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sync-refresh-button:hover {
    border-color: #1769d2;
    background: #eef6ff;
    transform: rotate(30deg);
}

.sync-refresh-button:focus-visible {
    outline: 3px solid rgba(23, 105, 210, 0.25);
    outline-offset: 2px;
}

.export-menu {
    position: relative;
    z-index: 20;
}

.export-menu > summary {
    list-style: none;
}

.export-menu > summary::-webkit-details-marker {
    display: none;
}

.export-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 9px;
    width: 270px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 30, 62, 0.16);
}

.export-options > strong {
    margin-bottom: 2px;
    color: var(--panel);
    font-size: 0.82rem;
}

.export-options label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 0.78rem;
    cursor: pointer;
}

.export-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
}

.export-options button {
    margin-top: 5px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: -6px 0 18px;
}

.active-filters-title {
    margin-right: 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(40, 91, 184, 0.2);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(40, 91, 184, 0.07);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
}

.filter-chip:hover {
    border-color: var(--accent);
    background: rgba(40, 91, 184, 0.12);
}

.filter-chip span {
    font-size: 0.9rem;
    line-height: 1;
}

.clear-all-filters {
    margin-left: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.summary-card span,
.summary-card small {
    display: block;
    color: var(--muted);
}

.summary-card span {
    margin-bottom: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--panel);
    font-size: 1.5rem;
}

.summary-card small {
    font-size: 0.74rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.clear-link {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) 1.8fr;
    gap: 24px;
    background:
        linear-gradient(135deg, rgba(219, 233, 255, 0.95) 0%, rgba(255, 255, 255, 0.96) 58%),
        var(--paper);
}

.hero-copy h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.metric-card {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    border: 1px solid var(--line);
}

.metric-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.metric-card strong {
    font-size: 1.35rem;
}

.metric-helper {
    margin: 10px 0 0;
    font-size: 0.92rem;
}

.section-header,
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.group-dropdown,
.candidate-dropdown {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 255, 0.96) 100%);
    overflow: hidden;
}

.group-dropdown + .group-dropdown {
    margin-top: 14px;
}

.group-dropdown summary,
.candidate-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.group-dropdown summary::-webkit-details-marker,
.candidate-dropdown summary::-webkit-details-marker {
    display: none;
}

.group-header,
.candidate-summary {
    padding: 18px 20px;
}

.summary-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.disclosure-indicator {
    font-size: 0.84rem;
    color: #3367c1;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
}

.candidate-body {
    padding: 0 20px 20px;
    border-top: 1px solid var(--line);
}

.contact-entry-box {
    margin-top: 18px;
}

.company-profile-list {
    margin-bottom: 18px;
}

.contact-form-box {
    padding: 0 20px 20px;
    border-top: 1px solid var(--line);
}

.contact-notes {
    color: var(--muted);
    background: rgba(244, 249, 255, 0.9);
    font-style: italic;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
}

.profile-grid p {
    margin: 0;
}

.profile-wide {
    grid-column: 1 / -1;
}

.search-box {
    margin: 18px 0 20px;
}

.filters-panel {
    margin: 18px 0 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.filters-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: #fafcff;
    transition: background 0.15s ease;
}

.filters-panel > summary::-webkit-details-marker {
    display: none;
}

.filters-panel > summary:hover {
    background: #f4f7ff;
}

.filters-summary-copy {
    display: grid;
    gap: 3px;
}

.filters-summary-copy strong {
    color: var(--panel);
    font-size: 0.86rem;
}

.filters-summary-copy small {
    color: var(--muted);
    font-size: 0.72rem;
}

.filters-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.filters-chevron {
    display: inline-block;
    font-size: 1rem;
    transition: transform 0.18s ease;
}

.filters-panel .label-hide {
    display: none;
}

.filters-panel[open] .label-show {
    display: none;
}

.filters-panel[open] .label-hide {
    display: inline;
}

.filters-panel[open] .filters-chevron {
    transform: rotate(180deg);
}

.filters-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.filters-form {
    margin: 0;
    padding: 18px 16px;
}

.batch-actions-card {
    margin-bottom: 18px;
}

.candidate-selector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #1f4ea3;
    background: rgba(219, 233, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 600;
}

.candidate-selector input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-done {
    color: #155724;
    background: #dff7e7;
}

.status-pending {
    color: #8a5a00;
    background: #fff1cf;
}

.stack-form p {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compact-form input {
    min-width: 90px;
}

.category-form {
    min-width: 180px;
}

.checkbox-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.pagination-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.pagination-links a,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
}

.pagination-links a:hover {
    border-color: var(--accent);
    background: #eef6ff;
}

.pagination-current {
    border-color: var(--accent);
    color: #ffffff;
    background: var(--accent);
    font-weight: 700;
}

.pagination-links .pagination-direction {
    padding-inline: 12px;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--muted);
}

.nested-pagination {
    margin-top: 12px;
}

.secondary-button {
    color: #1f4ea3;
    background: rgba(219, 233, 255, 0.78);
}

.secondary-button:hover {
    background: rgba(201, 220, 255, 0.95);
}

.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.qi-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 30px;
    margin-right: 10px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0d2b66;
    background: linear-gradient(135deg, #d9e7ff 0%, #f7fbff 100%);
    border: 1px solid var(--line);
}

.fund-name-cell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    text-decoration: none;
    color: #f8fbff;
    background: linear-gradient(135deg, #2d7ff9 0%, #1b56c4 100%);
    flex-shrink: 0;
}

.inline-form input {
    min-width: 110px;
    margin: 0;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(45, 127, 249, 0.2);
    border-color: #78aafc;
}

.table-wrapper {
    margin-top: 16px;
    max-height: min(68vh, 760px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.compact-table {
    margin-top: 18px;
}

.compact-table th,
.compact-table td {
    padding: 12px 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.84);
}

th,
td {
    padding: 10px 9px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4a618d;
    background: #f0f3fa;
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--line);
}

#catalog-results {
    transition: opacity 0.15s ease;
}

#catalog-results.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

td {
    font-size: 0.78rem;
}

tbody tr:hover td {
    background: #f4f7ff;
}

.empty-state,
.summary-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: #f7fbff;
    border: 1px dashed var(--line);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    margin-bottom: 0;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-card-header h3 {
    margin: 6px 0 0;
    font-size: 1.2rem;
}

.donut-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: 24px;
    align-items: center;
    margin-top: 18px;
}

.donut-ring {
    display: grid;
    place-items: center;
    width: min(240px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--donut-fill);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.donut-hole {
    display: grid;
    place-items: center;
    width: 58%;
    aspect-ratio: 1;
    padding: 18px;
    border-radius: 50%;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.12);
}

.donut-hole span {
    color: var(--muted);
    font-size: 0.85rem;
}

.donut-hole strong {
    font-size: 1rem;
    line-height: 1.3;
}

.chart-legend {
    display: grid;
    gap: 12px;
}

.legend-row {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
    align-items: start;
}

.legend-bullet {
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border-radius: 999px;
}

.legend-row strong {
    display: block;
    margin-bottom: 4px;
}

.legend-row p {
    margin: 0;
}

.bar-chart {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.bar-row {
    display: grid;
    gap: 8px;
}

.bar-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(219, 233, 255, 0.9);
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.top-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

.top-user form {
    margin: 0;
}

.top-logout {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    font-size: 0.72rem;
}

.top-password {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    text-decoration: none;
}

.top-password:hover {
    color: #ffffff;
}

.top-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-card a {
    color: var(--accent);
    font-weight: 700;
}

.portfolio-column {
    min-width: 125px;
    text-align: center;
}

.selection-column {
    width: 46px;
    min-width: 46px;
    text-align: center;
}

.selection-column input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.selection-column input:disabled {
    cursor: not-allowed;
}

.bulk-portfolio-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-height: 42px;
    margin-top: 16px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: #f8faff;
    font-size: 0.82rem;
}

.bulk-portfolio-bar button {
    padding: 8px 12px;
    font-size: 0.78rem;
}

.bulk-portfolio-bar button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.portfolio-toggle-form,
.portfolio-toggle-form button,
td form {
    margin: 0;
}

.portfolio-toggle,
.portfolio-remove {
    min-width: 104px;
    padding: 8px 10px;
    border: 1px solid #bfd0e8;
    color: var(--accent);
    background: #ffffff;
    font-size: 0.74rem;
}

.portfolio-toggle.is-selected {
    border-color: #8bc9ad;
    color: #087044;
    background: #edf9f3;
}

.portfolio-remove {
    min-width: auto;
    color: #a43434;
    border-color: #efcaca;
}

.portfolio-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-actions-header {
    justify-content: flex-end;
}

.portfolio-view-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin: 4px 0 16px;
}

.portfolio-view-switcher > span {
    margin-right: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.portfolio-view-switcher a {
    padding: 7px 11px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.portfolio-view-switcher a:first-of-type {
    border-radius: 8px 0 0 8px;
}

.portfolio-view-switcher a:last-of-type {
    border-radius: 0 8px 8px 0;
}

.portfolio-view-switcher a + a {
    margin-left: -1px;
}

.portfolio-view-switcher a.is-active {
    z-index: 1;
    border-color: var(--accent);
    color: #ffffff;
    background: var(--accent);
}

.manager-groups {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.manager-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.manager-group > summary {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto 24px;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
}

.manager-group > summary::-webkit-details-marker {
    display: none;
}

.manager-group[open] > summary {
    border-bottom: 1px solid var(--line);
    background: #f3f7fd;
}

.manager-group-name {
    font-size: 0.88rem;
    font-weight: 800;
}

.manager-group-metrics {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    color: var(--muted);
    font-size: 0.76rem;
}

.manager-group-metrics strong {
    min-width: 145px;
    color: var(--text);
    text-align: right;
}

.manager-group-chevron {
    color: var(--accent);
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.manager-group[open] .manager-group-chevron {
    transform: rotate(180deg);
}

.manager-group-table {
    overflow-x: auto;
}

.manager-group-table th {
    position: static;
}

.portfolio-dashboard {
    margin-top: 18px;
}

.portfolio-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.portfolio-dashboard-metrics article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
}

.portfolio-dashboard-metrics article.has-warning {
    border-color: #f1d19c;
    background: #fffaf0;
}

.portfolio-dashboard-metrics span,
.portfolio-dashboard-metrics small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.portfolio-dashboard-metrics strong {
    display: block;
    margin-top: 7px;
    font-size: 1.2rem;
}

.portfolio-dashboard-metrics small {
    margin-top: 6px;
    line-height: 1.35;
}

.portfolio-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.portfolio-chart-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

.portfolio-chart-card header h3 {
    margin: 5px 0 0;
    font-size: 1rem;
}

.portfolio-bars {
    display: grid;
    gap: 15px;
    margin-top: 18px;
}

.portfolio-bar-row > div:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.76rem;
}

.portfolio-bar-row > div:first-child span {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-bar-row > div:first-child strong {
    font-size: 0.73rem;
}

.portfolio-bar-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f7;
}

.portfolio-bar-track span {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.portfolio-bars-cyan .portfolio-bar-track span {
    background: #22b8dd;
}

.portfolio-bars-green .portfolio-bar-track span {
    background: #0a9960;
}

.portfolio-bar-row > small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.67rem;
}

.portfolio-top-funds ol {
    display: grid;
    gap: 0;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.portfolio-top-funds li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.portfolio-top-funds li > span {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.75rem;
}

.portfolio-top-funds li > span > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-top-funds li b {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.68rem;
}

.portfolio-top-funds li > strong {
    font-size: 0.74rem;
    text-align: right;
}

.portfolio-top-funds li > strong small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-weight: 500;
}

.portfolio-search {
    margin: 22px 0 16px;
}

.portfolio-search > div {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
}

.portfolio-search input {
    flex: 1;
}

.portfolio-empty {
    padding: 44px 20px;
    text-align: center;
}

.login-page {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
    background: linear-gradient(145deg, #0f1e3e 0%, #1f4f9c 100%);
}

.login-card {
    width: min(100%, 420px);
    padding: 36px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.login-card .brand-mark {
    margin-bottom: 22px;
}

.login-card h1 {
    margin: 4px 0 8px;
}

.login-card form {
    margin-top: 24px;
}

.login-error {
    padding: 10px 12px;
    border-radius: 8px;
    color: #9f2525;
    background: #fff0f0;
}

.password-card {
    max-width: 620px;
}

.admin-notice,
.credential-box {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #bcd8ca;
    border-radius: 10px;
    color: #075f3c;
    background: #eefaf4;
}

.credential-box {
    border-color: #9ec4f4;
    color: var(--text);
    background: #eef6ff;
}

.credential-box p {
    margin: 6px 0 12px;
    color: var(--muted);
}

.credential-box div {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
    margin-top: 7px;
}

.credential-box code {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 5px;
    background: #ffffff;
    font-size: 0.9rem;
    user-select: all;
}

.user-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 20px;
    margin-top: 18px;
}

.user-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-panel-heading h3,
.create-user-panel h3 {
    margin: 0;
}

.user-panel-heading span {
    color: var(--muted);
    font-size: 0.78rem;
}

.user-table-wrapper {
    max-height: none;
}

.user-username {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
}

.user-status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.user-status.is-active {
    color: #087044;
    background: #e8f8f0;
}

.user-status.is-inactive {
    color: #8c3535;
    background: #fff0f0;
}

.user-actions {
    display: flex;
    gap: 6px;
}

.user-actions button {
    padding: 7px 9px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.user-actions .subtle-danger {
    color: #a43434;
    border: 1px solid #efcaca;
    background: #ffffff;
}

.user-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    transform: none;
}

.create-user-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8faff;
}

.create-user-panel .stack-form {
    margin-top: 16px;
}

@media (max-width: 900px) {
    .page-shell {
        display: flex;
    }

    .main-content {
        padding: 20px;
    }

    .top-navigation {
        grid-template-columns: 1fr auto;
        gap: 12px;
        min-height: 62px;
        padding: 8px 20px;
    }

    .top-links {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 34px;
        margin: 0 -20px -8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .top-links a::after {
        bottom: 0;
    }

    .top-context {
        font-size: 0;
    }

    .top-context::after {
        content: "Comercial";
        font-size: 0.68rem;
    }

    .top-user {
        font-size: 0;
    }

    .top-user .top-logout {
        font-size: 0.72rem;
    }

    .portfolio-summary-grid {
        grid-template-columns: 1fr;
    }

    .manager-group > summary {
        grid-template-columns: 1fr 20px;
    }

    .portfolio-dashboard-metrics,
    .portfolio-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .manager-group-metrics {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: space-between;
    }

    .manager-group-chevron {
        grid-column: 2;
        grid-row: 1;
    }

    .user-admin-layout {
        grid-template-columns: 1fr;
    }

    .create-user-panel {
        order: -1;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .fund-summary-grid {
        grid-template-columns: 1fr;
    }

    .bulk-portfolio-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .export-options {
        position: fixed;
        top: 82px;
        right: 20px;
        left: 20px;
        width: auto;
        max-height: calc(100vh - 102px);
        overflow-y: auto;
    }

    .filters-summary-copy small {
        display: none;
    }

    .filters-toggle-label .label-show,
    .filters-toggle-label .label-hide {
        display: none;
    }

    .section-header,
    .group-header,
    .workspace-bar,
    .candidate-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .donut-layout {
        grid-template-columns: 1fr;
    }

    .bar-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
