:root {
    --gxp-primary: var(--primary-blue, #2563eb);
    --gxp-primary-dark: var(--primary-blue-dark, #1d4ed8);
    --gxp-blue-100: var(--blue-100, #dbeafe);
    --gxp-blue-200: var(--blue-200, #bfdbfe);
    --gxp-blue-900: var(--blue-900, #1e3a8a);
    --gxp-gray-50: var(--gray-50, #f9fafb);
    --gxp-gray-100: var(--gray-100, #f3f4f6);
    --gxp-gray-200: var(--gray-200, #e5e7eb);
    --gxp-gray-300: var(--gray-300, #d1d5db);
    --gxp-gray-500: var(--gray-500, #6b7280);
    --gxp-gray-700: var(--gray-700, #374151);
    --gxp-gray-900: var(--gray-900, #111827);
    --gxp-green: var(--green-500, #22c55e);
    --gxp-red: var(--red-500, #ef4444);
    --gxp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.gxp-portfolio-dashboard {
    position: relative;
    padding: 2rem 1.5rem;
    color: var(--gxp-gray-700);
    isolation: isolate;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    overflow-x: hidden;
}

.gxp-shell {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--gxp-shadow);
    backdrop-filter: blur(6px);
}

.gxp-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(55px);
    opacity: 0.24;
    pointer-events: none;
    z-index: -1;
}

.gxp-orb-a {
    width: 300px;
    height: 300px;
    background: #60a5fa;
    top: -60px;
    left: -70px;
}

.gxp-orb-b {
    width: 260px;
    height: 260px;
    background: #38bdf8;
    right: -80px;
    bottom: -100px;
}

.gxp-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
    max-width: 100%;
}

.gxp-header-copy {
    min-width: 0;
}

.gxp-eyebrow {
    margin: 0 0 0.35rem 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--gxp-primary);
}

.gxp-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--gxp-blue-900);
    word-break: break-word;
}

.gxp-subtitle {
    margin: 0.5rem 0 0 0;
    color: var(--gxp-gray-500);
    max-width: 56ch;
    line-height: 1.4;
}

.gxp-header-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: 640px;
}

.gxp-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--gxp-gray-500);
}

.gxp-portfolio-select {
    width: 100%;
    min-width: 220px;
    max-width: 100%;
    border: 1px solid var(--gxp-gray-300);
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    background: #fff;
    color: var(--gxp-gray-900);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.gxp-feedback-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.gxp-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--gxp-gray-500);
    font-size: 0.875rem;
    font-weight: 600;
}

.gxp-loader-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--gxp-primary);
    animation: gxp-bounce 1s infinite ease-in-out;
}

.gxp-loader-dot:nth-child(2) {
    animation-delay: 0.1s;
}

.gxp-loader-dot:nth-child(3) {
    animation-delay: 0.2s;
}

.gxp-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.gxp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1rem 0 1.25rem;
}

.gxp-kpi-card {
    border: 1px solid var(--gxp-gray-200);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
}

.gxp-kpi-label {
    margin: 0;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--gxp-gray-500);
}

.gxp-kpi-value {
    margin: 0.35rem 0 0.2rem 0;
    font-size: 1.35rem;
    color: var(--gxp-gray-900);
    font-weight: 800;
}

.gxp-kpi-meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gxp-gray-500);
}

.gxp-rules-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--gxp-gray-200);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
}

.gxp-rule-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gxp-rule-label {
    color: var(--gxp-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}

.gxp-rule-value {
    color: var(--gxp-gray-900);
    font-weight: 700;
}

.gxp-rule-sep {
    width: 1px;
    height: 1rem;
    background: var(--gxp-gray-300);
    flex-shrink: 0;
}

/* Rule tooltips */
.gxp-has-tooltip {
    position: relative;
    cursor: help;
}
.gxp-has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--gxp-gray-900, #1a1a2e);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.gxp-has-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gxp-gray-900, #1a1a2e);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
}
.gxp-has-tooltip:hover::after,
.gxp-has-tooltip:hover::before {
    opacity: 1;
}

.gxp-strategy-description {
    margin: -0.5rem 0 1rem;
    padding: 0 0.25rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gxp-gray-500);
}

.gxp-panel {
    border: 1px solid var(--gxp-gray-200);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.gxp-chart-panel {
    margin-bottom: 1rem;
}

.gxp-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.gxp-panel-title {
    margin: 0;
    font-size: 1rem;
    color: var(--gxp-gray-900);
}

.gxp-range-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gxp-range-btn {
    border: 1px solid var(--gxp-gray-300);
    background: #fff;
    color: var(--gxp-gray-700);
    border-radius: 0.55rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gxp-range-btn:hover {
    border-color: var(--gxp-primary);
    color: var(--gxp-primary-dark);
}

.gxp-range-btn:focus-visible,
.gxp-tab-btn:focus-visible,
.gxp-page-btn:focus-visible {
    outline: 2px solid var(--gxp-primary);
    outline-offset: 2px;
}

.gxp-range-btn.is-active {
    background: linear-gradient(145deg, var(--gxp-primary) 0%, var(--gxp-primary-dark) 100%);
    border-color: var(--gxp-primary-dark);
    color: #fff;
}

.gxp-chart-wrap {
    height: 340px;
    position: relative;
}

.gxp-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--gxp-gray-200);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.gxp-tab-btn {
    appearance: none;
    border: 1px solid var(--gxp-gray-300);
    background: #fff;
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gxp-gray-700);
    cursor: pointer;
    white-space: nowrap;
}

.gxp-tab-btn.is-active {
    background: var(--gxp-blue-100);
    border-color: var(--gxp-blue-200);
    color: var(--gxp-primary-dark);
}

.gxp-tab-panel {
    display: none;
}

.gxp-tab-panel.is-active {
    display: block;
}

.gxp-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.gxp-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
}

.gxp-filter-select,
.gxp-filter-input {
    border: 1px solid var(--gxp-gray-300);
    border-radius: 0.55rem;
    background: #fff;
    color: var(--gxp-gray-900);
    font-size: 0.8rem;
    padding: 0.38rem 0.58rem;
    min-height: 2rem;
}

.gxp-filter-select {
    min-width: 132px;
}

.gxp-filter-input {
    flex: 1 1 180px;
    min-width: 170px;
}

.gxp-filter-btn {
    border: 1px solid var(--gxp-gray-300);
    border-radius: 0.55rem;
    background: #fff;
    color: var(--gxp-gray-700);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.38rem 0.65rem;
    cursor: pointer;
}

.gxp-filter-btn:hover {
    border-color: var(--gxp-primary);
    color: var(--gxp-primary-dark);
}

.gxp-analyze-btn {
    padding: 0.26rem 0.58rem;
    font-size: 0.74rem;
}

.gxp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
}

.gxp-positions-table {
    min-width: 1080px;
}

.gxp-composition-table {
    min-width: 860px;
}

.gxp-tab-panels,
.gxp-tab-panel {
    min-width: 0;
    max-width: 100%;
}

.gxp-table th,
.gxp-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--gxp-gray-100);
    text-align: left;
    font-size: 0.82rem;
}

.gxp-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gxp-gray-500);
    font-weight: 700;
    background: rgba(248, 250, 252, 0.7);
}

.gxp-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.gxp-sortable:hover {
    color: var(--gxp-gray-700);
}

.gxp-sort-icon::after {
    content: "\2195";
    margin-left: 0.25em;
    opacity: 0.35;
    font-size: 0.85em;
}

.gxp-sort-active .gxp-sort-icon::after {
    opacity: 1;
    color: var(--gxp-primary, #2563eb);
}

.gxp-sort-asc .gxp-sort-icon::after {
    content: "\2191";
}

.gxp-sort-desc .gxp-sort-icon::after {
    content: "\2193";
}

.gxp-table tr:hover td {
    background: rgba(248, 250, 252, 0.6);
}

.gxp-text-strong {
    color: var(--gxp-gray-900);
    font-weight: 700;
}

.gxp-rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 1.55rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--gxp-blue-100);
    color: var(--gxp-primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
}

.gxp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.gxp-badge-drop {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.gxp-badge-neg {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.gxp-badge-stop {
    background: rgba(239, 68, 68, 0.13);
    color: #b91c1c;
}

.gxp-badge-tp {
    background: rgba(16, 185, 129, 0.13);
    color: #047857;
}

.gxp-badge-neutral {
    background: rgba(107, 114, 128, 0.18);
    color: #374151;
}

.gxp-pagination {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.gxp-page-btn {
    border: 1px solid var(--gxp-gray-300);
    border-radius: 0.55rem;
    padding: 0.35rem 0.7rem;
    background: #fff;
    color: var(--gxp-gray-700);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.gxp-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gxp-page-info {
    font-size: 0.78rem;
    color: var(--gxp-gray-500);
    font-weight: 700;
}

.gxp-stats-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.65rem;
}

.gxp-stat-card {
    border: 1px solid var(--gxp-gray-200);
    background: #fff;
    border-radius: 0.8rem;
    padding: 0.7rem 0.8rem;
}

.gxp-stat-card p {
    margin: 0;
}

.gxp-stat-card p:first-child {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gxp-gray-500);
    font-weight: 700;
}

.gxp-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gxp-gray-200);
    color: var(--gxp-gray-500);
    font-size: 0.55rem;
    font-weight: 800;
    font-style: normal;
    text-transform: none;
    letter-spacing: 0;
    cursor: help;
    vertical-align: middle;
    margin-left: 3px;
    position: relative;
}

.gxp-info:hover {
    background: var(--gxp-blue-100, #dbeafe);
    color: var(--gxp-blue-600, #2563eb);
}

.gxp-info[title] {
    position: relative;
}

.gxp-info[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gxp-gray-900);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.gxp-info[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--gxp-gray-900);
    z-index: 100;
    pointer-events: none;
}

.gxp-stat-card p:last-child {
    margin-top: 0.35rem;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--gxp-gray-900);
}

.gxp-empty {
    text-align: center;
    padding: 1rem;
    color: var(--gxp-gray-500);
}

.gxp-muted {
    color: var(--gxp-gray-500);
    font-size: 0.78rem;
}

.gxp-composition-date {
    white-space: nowrap;
}

.gxp-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    min-width: 120px;
}

.gxp-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.17rem 0.46rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid var(--gxp-gray-300);
    background: #fff;
    color: var(--gxp-gray-700);
    white-space: nowrap;
}

.gxp-chip-enter {
    background: rgba(34, 197, 94, 0.14);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.35);
}

.gxp-chip-exit {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.35);
}

.gxp-chip-turnover {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.3);
}

.gxp-chip-asset {
    gap: 0.25rem;
}

.gxp-chip-pos {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.28);
}

.gxp-chip-neg {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.28);
}

.gxp-chip-more {
    background: rgba(107, 114, 128, 0.14);
    color: #374151;
    border-color: rgba(107, 114, 128, 0.28);
    cursor: pointer;
}

.gxp-chip-more:hover {
    background: rgba(107, 114, 128, 0.28);
}

.gxp-chip-hidden {
    display: none;
}

.gxp-chip-list-assets.is-expanded .gxp-chip-hidden {
    display: inline-flex;
}

.gxp-positive {
    color: var(--gxp-green);
}

.gxp-negative {
    color: var(--gxp-red);
}

.gxp-range-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gxp-custom-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.gxp-date-input {
    border: 1px solid var(--gxp-gray-300);
    border-radius: 0.55rem;
    background: #fff;
    color: var(--gxp-gray-900);
    font-size: 0.8rem;
    padding: 0.38rem 0.58rem;
    min-height: 2rem;
}

.gxp-date-sep {
    font-size: 0.78rem;
    color: var(--gxp-gray-500);
    font-weight: 600;
}

.gxp-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.gxp-chart-pnl-inline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gxp-gray-100);
}

.gxp-pnl-rows {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.gxp-pnl-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
}

.gxp-pnl-row-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gxp-gray-500);
}

.gxp-pnl-row-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gxp-gray-700);
    white-space: nowrap;
}

.gxp-pnl-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gxp-gray-100);
}

.gxp-pnl-bar-track {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.22);
    overflow: hidden;
}

.gxp-pnl-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.gxp-pnl-bar-pos {
    background: linear-gradient(90deg, var(--gxp-green) 0%, #4ade80 100%);
}

.gxp-pnl-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gxp-gray-700);
}

.gxp-pnl-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.gxp-pnl-dot-pos {
    background: var(--gxp-green);
}

.gxp-pnl-dot-neg {
    background: var(--gxp-red);
}

.gxp-pnl-dot-flat {
    background: var(--gxp-gray-300);
}

.gxp-pnl-metrics {
    display: flex;
    gap: 1.5rem;
}

.gxp-pnl-metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.gxp-pnl-metric-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gxp-gray-900);
}

.gxp-pnl-metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--gxp-gray-500);
}

.gxp-section-title {
    margin: 1.25rem 0 0.65rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--gxp-gray-500);
    border-bottom: 1px solid var(--gxp-gray-100);
    padding-bottom: 0.4rem;
}

.gxp-section-title:first-child {
    margin-top: 0;
}

.gxp-regime-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gxp-regime-uptrend {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.gxp-regime-recovery {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.gxp-regime-drawdown {
    background: rgba(239, 68, 68, 0.13);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.gxp-regime-consolidation {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.gxp-regime-neutral {
    background: rgba(107, 114, 128, 0.14);
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.gxp-position-dive {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: flex;
    justify-content: flex-end;
}

.gxp-position-dive-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.gxp-position-dive-panel {
    position: relative;
    width: min(680px, 100%);
    height: 100%;
    background: #fff;
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.2);
    padding: 0.95rem;
    overflow-y: auto;
}

.gxp-position-dive-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.gxp-position-dive-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gxp-gray-500);
    font-weight: 700;
}

.gxp-position-dive-title {
    margin: 0;
    font-size: 1.08rem;
    color: var(--gxp-gray-900);
}

.gxp-position-dive-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: var(--gxp-gray-500);
}

.gxp-position-dive-close {
    border: 1px solid var(--gxp-gray-300);
    background: #fff;
    border-radius: 999px;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
}

.gxp-position-dive-summary {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.gxp-position-dive-metric {
    border: 1px solid var(--gxp-gray-200);
    border-radius: 0.7rem;
    padding: 0.55rem 0.65rem;
    background: var(--gxp-gray-50);
}

.gxp-position-dive-metric span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gxp-gray-500);
    font-weight: 700;
}

.gxp-position-dive-metric strong {
    margin-top: 0.2rem;
    display: block;
    font-size: 0.86rem;
    color: var(--gxp-gray-900);
}

.gxp-position-dive-chart-wrap {
    margin-top: 0.85rem;
    height: 260px;
}

.gxp-position-dive-events {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gxp-position-dive-table-wrap {
    margin-top: 0.6rem;
    overflow: auto;
}

.gxp-position-dive-table {
    min-width: 620px;
}

@keyframes gxp-bounce {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.7;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .gxp-shell {
        padding: 1.35rem;
    }

    .gxp-header {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
        align-items: end;
    }

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

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

}

@media (max-width: 767px) {
    .gxp-portfolio-dashboard {
        padding: 0.45rem 0;
    }

    .gxp-shell {
        border-radius: 0.85rem;
        padding: 0.75rem;
    }

    .gxp-panel {
        padding: 0.75rem;
    }

    .gxp-subtitle {
        display: none;
    }

    .gxp-header-controls {
        max-width: 100%;
    }

    .gxp-chart-wrap {
        height: 320px;
    }

    .gxp-table-wrap {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .gxp-table {
        min-width: 780px;
    }

    .gxp-composition-table {
        min-width: 700px;
    }

    .gxp-position-dive-panel {
        width: 100%;
        padding: 0.75rem;
    }

    .gxp-position-dive-summary {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1100px) {
    .gxp-shell {
        padding: 1.5rem;
    }

    .gxp-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .gxp-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ===== Admin Page Classes ===== */

.gxp-admin-card {
    max-width: 1280px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
}

.gxp-admin-card--info {
    background: #f8fafc;
}

.gxp-admin-card--danger {
    border-color: #f1c0c0;
    background: #fff7f7;
}

.gxp-admin-card--danger .gxp-admin-card__title {
    color: #8a1f11;
}

.gxp-admin-card__title {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.gxp-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 12px 0 18px;
}

.gxp-admin-grid--wide {
    max-width: 1280px;
}

.gxp-admin-grid__card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 10px;
}

.gxp-admin-grid__card--metric {
    border-color: #e5e7eb;
    background: #f8fafc;
    padding: 8px;
}

.gxp-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.gxp-admin-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.gxp-admin-form-row--tight {
    gap: 8px;
}

.gxp-admin-form-row label > span,
.gxp-admin-field-label {
    display: block;
    font-size: 12px;
    color: #4b5563;
}

.gxp-admin-field-label--checkbox {
    display: flex;
    gap: 6px;
    align-items: center;
    padding-bottom: 4px;
}

.gxp-user-list-grid {
    columns: 1;
}

.gxp-user-list-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.gxp-postbox {
    max-width: 900px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 20px;
}

.gxp-postbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #c3c4c7;
    background: #f6f7f7;
    cursor: pointer;
    user-select: none;
}

.gxp-postbox-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.gxp-postbox-header .toggle-indicator {
    font-size: 20px;
    color: #787c82;
    transition: transform 0.15s;
}

.gxp-postbox.is-collapsed .toggle-indicator {
    transform: rotate(-90deg);
}

.gxp-compact-table {
    width: 100%;
    border-collapse: collapse;
}

.gxp-compact-table th,
.gxp-compact-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    text-align: left;
}

.gxp-compact-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #50575e;
    font-weight: 600;
    background: #f6f7f7;
}

.gxp-compact-table tr:hover td {
    background: #f6f7f7;
}

.gxp-compact-table .gxp-row-selected td {
    background: #e8f0fe;
}

.gxp-admin-chart-wrap {
    max-width: 900px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 18px;
}

.gxp-admin-chart-canvas {
    position: relative;
    height: 340px;
    max-width: 860px;
}

.gxp-admin-chart-canvas canvas {
    width: 100%;
    height: 100%;
}

.gxp-admin-inline-form {
    display: inline-block;
    margin-left: 6px;
}

.gxp-admin-description {
    margin: 6px 0 0;
}

.gxp-admin-rule-label {
    margin-right: 12px;
}

.gxp-admin-help-icon {
    color: #999;
    cursor: help;
    vertical-align: middle;
}

.gxp-admin-section-header {
    font-size: 13px;
}

.gxp-admin-nowrap {
    white-space: nowrap;
}

.gxp-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.gxp-admin-badge--classic {
    background: #f0f0f1;
    color: #50575e;
}

.gxp-admin-badge--horizon {
    background: #dbeafe;
    color: #1d4ed8;
}

.gxp-admin-badge--active {
    background: rgba(34, 197, 94, 0.14);
    color: #166534;
}

.gxp-admin-badge--paused {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.gxp-admin-badge--closed {
    background: rgba(107, 114, 128, 0.14);
    color: #374151;
}

.gxp-admin-perf {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gxp-admin-perf__value {
    font-weight: 600;
    color: #1e1e1e;
}

.gxp-admin-copy-btn {
    border: 1px solid #c3c4c7;
    background: #f6f7f7;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #50575e;
}

.gxp-admin-copy-btn:hover {
    background: #dcdcde;
    color: #1e1e1e;
}

/* --- Width Constraints --- */
.gxp-form-narrow { max-width: 900px; }
.gxp-form-wide { max-width: 1280px; }

/* --- Horizontal Rule Spacing --- */
.gxp-hr-sm { margin: 12px 0; }
.gxp-hr-md { margin: 24px 0; }
.gxp-hr-lg { margin: 24px 0 14px; }

/* --- Details/Summary --- */
.gxp-details-summary { cursor: pointer; font-weight: 600; }
.gxp-details-summary--advanced { cursor: pointer; font-weight: 600; user-select: none; padding: 4px 0; }

/* --- Text Utilities --- */
.gxp-text-danger { color: #8a1f11; }
.gxp-text-muted-sm { font-size: 11px; color: #6b7280; margin-top: 2px; }
.gxp-block-label { display: block; margin-bottom: 10px; }
.gxp-reset-top { margin-top: 0; }

/* --- Description Spacing --- */
.gxp-desc-flush { margin: 0; }
.gxp-desc-xs { margin: 2px 0 0; }
.gxp-desc-sm { margin: 6px 0 0; }
.gxp-desc-md { margin: 8px 0 0; }
.gxp-desc-b-xs { margin: 0 0 8px; }
.gxp-desc-b-sm { margin: 0 0 10px; }
.gxp-desc-b-md { margin: 0 0 12px; }
.gxp-desc-inline { margin: 8px 0; }

/* --- Input/Select Widths --- */
.gxp-input-xs { width: 80px; }
.gxp-input-sm { width: 110px; }
.gxp-input-md { width: 120px; }
.gxp-input-lg { width: 130px; }
.gxp-input-xl { width: 140px; }
.gxp-input-full { width: 100%; }
.gxp-input-note { width: 100%; min-width: 160px; }
.gxp-input-mono { width: 100%; font-family: monospace; }
.gxp-textarea-mono { width: 100%; font-family: monospace; }
.gxp-select-wide { min-width: 240px; }

/* --- Label Widths --- */
.gxp-label-md { min-width: 180px; }
.gxp-label-lg { min-width: 260px; }
.gxp-label-flex { flex: 1 1 220px; }
.gxp-label-flex-wide { flex: 1 1 260px; }

/* --- List Item --- */
.gxp-list-item-block { display: block; margin-bottom: 4px; }
.gxp-list-styled { margin: 8px 0 0 18px; list-style: disc; }

/* --- Toggle/Flex Groups --- */
.gxp-toggle-group { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }

/* --- Chart Container --- */
.gxp-chart-container { position: relative; height: 320px; }
.gxp-chart-canvas-full { width: 100%; height: 100%; }

/* --- Content Box --- */
.gxp-content-box-scroll { max-width: 1280px; overflow: auto; background: #fff; border: 1px solid #dcdcde; border-radius: 8px; padding: 8px; }

/* --- Log Context --- */
.gxp-log-context { white-space: pre-wrap; margin: 0; max-width: 520px; }

/* --- Disabled Rule --- */
.gxp-rule-disabled { opacity: 0.5; }

/* --- Search Input --- */
.gxp-search-input { margin-bottom: 8px; width: 100%; max-width: 320px; }

/* --- Spacing row --- */
.gxp-row-spacing { margin-bottom: 6px; }

/* --- Progress Bar --- */
.gxp-progress-wrap { display: none; margin: 10px 0; }
.gxp-progress-track { background: #e0e0e0; border-radius: 4px; height: 20px; overflow: hidden; }
.gxp-progress-fill { background: #0073aa; height: 100%; width: 0%; transition: width 0.3s; }
.gxp-progress-text { margin: 5px 0; }

/* --- Log Display --- */
.gxp-log-wrap { display: none; margin: 10px 0; }
.gxp-log-display { max-height: 260px; overflow-y: auto; background: #1e1e1e; color: #d4d4d4; font-family: monospace; font-size: 12px; line-height: 1.6; padding: 8px 10px; border-radius: 4px; margin-top: 4px; }

/* --- Fill Form --- */
.gxp-fill-layout { display: flex; gap: 10px; align-items: end; margin: 10px 0; }
.gxp-fill-results-wrap { display: none; margin-top: 15px; }
.gxp-btn-danger { color: #a00; }
.gxp-btn-hidden { display: none; color: #a00; }

/* --- Inline Forms --- */
.gxp-form-inline-flex { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

@media (min-width: 768px) {
    .gxp-user-list-grid {
        columns: 2;
    }
}

/* --- Sticky Save Bar --- */
.gxp-sticky-save {
    position: sticky;
    bottom: 0;
    background: #f0f0f1;
    border-top: 1px solid #c3c4c7;
    padding: 12px 0;
    z-index: 10;
    margin: 0 -12px;
    padding-left: 12px;
}

/* --- KPI Compact Strip (Overview tab) --- */
.gxp-kpi-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 20px 0;
    max-width: 900px;
}
.gxp-kpi-strip__item {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}
.gxp-kpi-strip__label {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gxp-kpi-strip__value {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

/* --- Selected Pills (User Lists) --- */
.gxp-selected-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.gxp-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dbeafe;
    color: #1e3a8a;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.4;
}
.gxp-pill__remove {
    background: none;
    border: none;
    color: #1e3a8a;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.6;
}
.gxp-pill__remove:hover { opacity: 1; }

/* --- Danger Zone Confirm --- */
.gxp-danger-confirm {
    margin-top: 10px;
    padding: 10px;
    background: #fcf0f0;
    border: 1px solid #d63638;
    border-radius: 4px;
}
.gxp-danger-confirm p { margin: 0 0 8px; }
.gxp-btn-confirm-delete {
    background: #d63638 !important;
    color: #fff !important;
    border-color: #d63638 !important;
    margin-right: 8px;
}
.gxp-btn-confirm-delete:hover {
    background: #a02022 !important;
    border-color: #a02022 !important;
}

/* --- Section Nav (Asset Timeline pills) --- */
.gxp-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 20px;
    position: sticky;
    top: 32px;
    background: #f0f0f1;
    z-index: 9;
    padding: 8px 0;
}
.gxp-section-nav__item {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #c3c4c7;
    color: #2271b1;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.gxp-section-nav__item:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}
.gxp-section-nav__item.is-active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* --- Smooth Postbox Collapse --- */
.gxp-postbox-inside {
    padding: 12px;
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.25s ease;
}
.gxp-postbox.is-collapsed .gxp-postbox-inside {
    max-height: 0;
    padding: 0 12px;
}
