/* Attribution Dashboard - Matching CE vs Fable style */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
}

html.scrollable, body.scrollable {
    overflow: auto !important;
    height: auto !important;
    min-height: 100%;
}

html.modal-open, body.modal-open {
    overflow: hidden !important;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    padding: 12px;
    background: #f8fafc;
    color: #1e293b;
}

.dashboard {
    max-width: 1800px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header h1 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.title-divider {
    color: #cbd5e1;
    font-size: 1.2rem;
    font-weight: 300;
}

.period-select {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 2px 6px;
    border: none;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0px center;
    padding-right: 16px;
}

.period-select:hover {
    color: #2563eb;
}

.period-select:focus {
    outline: none;
}

.period-select option {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
}

.custom-period-content {
    width: min(92vw, 460px);
}

.custom-period-form {
    padding: 20px;
}

.custom-period-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.custom-period-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.custom-period-field input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #1e293b;
    font: 500 0.9rem 'Inter', sans-serif;
}

.custom-period-field input:focus {
    outline: 2px solid #bfdbfe;
    border-color: #3b82f6;
}

.custom-period-error {
    margin: 12px 0 0;
    color: #b91c1c;
    font-size: 0.75rem;
}

.custom-period-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.custom-period-btn {
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #475569;
    cursor: pointer;
    font: 600 0.78rem 'Inter', sans-serif;
}

.custom-period-btn:hover {
    background: #f1f5f9;
}

.custom-period-btn.primary {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.custom-period-btn.primary:hover {
    background: #1d4ed8;
}

@media (max-width: 520px) {
    .custom-period-fields {
        grid-template-columns: 1fr;
    }
}

.date-range {
    color: #94a3b8;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.nav-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 8px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.header-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: white;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-link-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.nav-link.nav-back {
    padding: 6px 8px; /* slightly tighter than standard links */
}

@media (max-width: 1200px) {
    .nav-link.nav-back .nav-link-text {
        display: none; /* keep only the arrow on tighter headers */
    }
}

.nav-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.nav-link.primary {
    background: #1e293b;
    border-color: #1e293b;
    color: white;
}

.nav-link.primary:hover {
    background: #0f172a;
    border-color: #0f172a;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid #e2e8f0;
}

.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.user-menu-caret {
    color: #64748b;
    font-size: 0.7rem;
    line-height: 1;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    padding: 8px;
    z-index: 1200;
}

.user-menu-dropdown.open {
    display: block;
}

.user-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 8px;
}

.user-menu-row label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.user-menu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.user-menu-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.view-as-select {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.user-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sign-out-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.sign-out-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.analyst-filter-container {
    display: contents;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 80px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-top: 3px solid #e2e8f0;
}

.stat-card.positive { border-top-color: #22c55e; }
.stat-card.negative { border-top-color: #ef4444; }

.stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-card.positive .stat-value { color: #16a34a; }
.stat-card.negative .stat-value { color: #dc2626; }

.stat-card.has-tooltip,
.detail-stat.has-tooltip,
.portfolio-stat.has-tooltip {
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s;
}

.stat-card.has-tooltip:hover,
.stat-card.has-tooltip:focus,
.detail-stat.has-tooltip:hover,
.portfolio-stat.has-tooltip:hover {
    background-color: #f8fafc;
}

.stat-card.has-tooltip .stat-label::after,
.detail-stat.has-tooltip .detail-stat-label::after,
.portfolio-stat.has-tooltip .portfolio-stat-label::after {
    content: ' ▾';
    font-size: 0.55rem;
    opacity: 0.6;
}

.stat-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: min(340px, calc(100vw - 24px));
    white-space: normal;
    z-index: 100;
    font-size: 0.8rem;
}

.stat-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #e2e8f0;
}

.stat-tooltip::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid white;
}

.detail-stat.has-tooltip .stat-tooltip {
    left: 0;
    transform: none;
}

.stat-card.has-tooltip:hover .stat-tooltip,
.stat-card.has-tooltip:focus .stat-tooltip,
.detail-stat.has-tooltip:hover .stat-tooltip,
.detail-stat.has-tooltip:focus .stat-tooltip,
.portfolio-stat.has-tooltip:hover .stat-tooltip,
.portfolio-stat.has-tooltip:focus .stat-tooltip {
    display: block;
}

.stat-card.has-tooltip:focus-visible,
.detail-stat.has-tooltip:focus-visible,
.portfolio-stat.has-tooltip:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#pnlCard .stat-tooltip {
    left: 0;
    transform: none;
}

#sharpeCard .stat-tooltip {
    right: 0;
    left: auto;
    transform: none;
}

.stat-tooltip-divider {
    border-top: 1px solid #cbd5e1;
    margin: 5px 0;
}

.stat-tooltip-note {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    padding-bottom: 4px;
}

.stat-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
}

.stat-tooltip-row:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

.stat-tooltip-label {
    color: #64748b;
    font-weight: 500;
}

.stat-tooltip-value {
    font-weight: 600;
}

.stat-tooltip-value.positive { color: #16a34a; }
.stat-tooltip-value.negative { color: #dc2626; }

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-top: 3px solid #e2e8f0;
    align-items: flex-end;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.label-with-hint {
    position: relative;
    cursor: help;
}

.hint-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #1e293b;
    color: #f8fafc;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 4px;
}

.label-with-hint:hover .hint-tooltip {
    display: block;
}

.btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #64748b;
    transition: all 0.15s;
    height: 28px;
}

.toggle-btn:hover { background: #f1f5f9; }
.toggle-btn.active {
    background: #64748b;
    color: white;
    border-color: #64748b;
}

.sig-filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sig-filter-group input[type="number"] {
    width: 36px;
    padding: 4px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    text-align: center;
    background: white;
    color: #1e293b;
}

.sig-filter-group .sig-unit {
    font-size: 0.7rem;
    color: #64748b;
}

select, input[type="text"], input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color: #1e293b;
    min-width: 120px;
    height: 28px;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
}

/* Multi-select dropdown */
.multi-select {
    position: relative;
}

.multi-select-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.75rem;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
    min-width: 120px;
}

.multi-select-btn:hover {
    background: #f8fafc;
}

.multi-select-btn svg {
    margin-left: auto;
    color: #64748b;
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.multi-select-dropdown.show {
    display: block;
}

#subsectorSelect .multi-select-dropdown {
    left: auto;
    right: 0;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #1e293b;
}

.multi-select-item:hover {
    background: #f1f5f9;
}

.multi-select-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #2563eb;
}

.multi-select-actions {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
}

.multi-select-actions button {
    flex: 1;
    padding: 4px 8px;
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
}

.multi-select-actions button:hover {
    background: #e2e8f0;
}

/* Dropdown items (radio-style for market cap) */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.72rem;
    color: #1e293b;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-item input[type="radio"] {
    width: 12px;
    height: 12px;
    accent-color: #2563eb;
    margin: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.custom-range {
    flex-wrap: wrap;
}

.cap-range-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    width: 100%;
    padding-left: 18px;
}

.cap-range-inputs input {
    width: 50px;
    padding: 2px 4px;
    font-size: 0.68rem;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
}

.cap-range-inputs span {
    color: #64748b;
    font-size: 0.68rem;
}

.cap-dropdown {
    min-width: 140px;
    padding: 4px 0;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    min-height: calc(100vh - 180px);
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-bottom: 40px;
}

.table-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: nowrap;
}

.toolbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.toolbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.export-status {
    max-width: 180px;
    color: #b91c1c;
    font-size: 0.7rem;
    line-height: 1.2;
}

.toolbar-sort-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.toolbar-sort-select {
    padding: 4px 8px;
    font-size: 0.72rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #1e293b;
    cursor: pointer;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.export-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

#attributionTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#attributionTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#attributionTable th {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    text-align: center;
    padding: 8px 6px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

#attributionTable th.col-ticker {
    text-align: left;
}

#attributionTable th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

#attributionTable th.sortable:hover {
    background: #e2e8f0;
}

#attributionTable th.sortable::after {
    content: '↕';
    margin-left: 4px;
    opacity: 0.3;
    font-size: 0.6rem;
}

#attributionTable th.sortable.active::after {
    content: '↓';
    opacity: 1;
}

#attributionTable th.sortable.active.asc::after {
    content: '↑';
}

.expand-btn {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 0.6rem;
    color: #64748b;
    cursor: pointer;
    margin-left: 4px;
    line-height: 1;
}

.expand-btn:hover {
    background: #e2e8f0;
}

.col-expandable.hidden,
td.col-expandable.hidden {
    display: none;
}

#attributionTable td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.75rem;
    text-align: center;
}

#attributionTable td.col-ticker {
    text-align: left;
}

/* Position Range Bar */
.col-position-range {
    width: 140px;
    min-width: 140px;
}

.pos-range-container {
    position: relative;
    height: 16px;
    background: #f1f5f9;
    border-radius: 3px;
}

.pos-range-zero {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #cbd5e1;
}

.pos-range-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 2px;
    opacity: 0.7;
}

.pos-range-bar.pos-bar-long {
    background: #22c55e;
}

.pos-range-bar.pos-bar-short {
    background: #ef4444;
}

.pos-range-avg {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 2px;
    background: #1e293b;
    border-radius: 1px;
    transform: translateX(-1px);
}

.pos-range-label-min,
.pos-range-label-max {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: #64748b;
    display: none;
}

.pos-range-label-min { left: 2px; }
.pos-range-label-max { right: 2px; }

.pos-range-container:hover .pos-range-label-min,
.pos-range-container:hover .pos-range-label-max {
    display: block;
}

#attributionTable tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

#attributionTable tbody tr:hover {
    background: #f8fafc;
}

#attributionTable tbody tr.selected {
    background: #eff6ff;
}

.col-ticker { width: 200px; }
.col-region { width: 45px; text-align: center; }
.col-alpha { width: 65px; text-align: right; }
.col-alpha-bar { width: 80px; }
.col-pnl { width: 65px; text-align: right; }
.col-position { width: 60px; text-align: right; }
.col-days { width: 45px; text-align: right; }
.col-beta { width: 50px; text-align: right; }

/* Ticker cell layout (name + BB ticker) */
#attributionTable td.ticker-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ticker-name {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.ticker-bb {
    font-size: 0.65rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-issue-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
}

.region-chip {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.region-chip.UK { background: #dbeafe; color: #1d4ed8; }
.region-chip.EU { background: #fef3c7; color: #b45309; }
.region-chip.US { background: #dcfce7; color: #166534; }

/* Direction indicators for paper portfolio */
.dir-long {
    font-size: 0.65rem;
    font-weight: 700;
    color: #16a34a;
}
.dir-short {
    font-size: 0.65rem;
    font-weight: 700;
    color: #dc2626;
}
.col-direction { text-align: center; width: 40px; }
.col-analyst { width: 60px; font-size: 0.75rem; color: #64748b; }

.value-positive { color: #16a34a; font-weight: 600; }
.value-negative { color: #dc2626; font-weight: 600; }

.alpha-bar-container {
    display: flex;
    align-items: center;
    height: 14px;
}

.alpha-bar {
    height: 8px;
    border-radius: 2px;
    min-width: 2px;
}

.alpha-bar.positive { background: #22c55e; }
.alpha-bar.negative { background: #ef4444; }

/* Detail Panel */
.detail-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 12px;
    padding-bottom: 40px;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.detail-panel.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.detail-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    font-size: 1.5rem;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.15s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 10px;
}

.detail-stat {
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 8px;
}

.detail-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.detail-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.chart-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
}

.chart-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
}

.chart-box > div:last-child {
    height: 220px;
}

/* Chart Header & Icons */
.chart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
}

.chart-header h3 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0;
    flex: 1;
}

.chart-icons {
    display: flex;
    gap: 4px;
}

.chart-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.chart-icon:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Settings Popover */
.settings-popover {
    position: absolute;
    top: 32px;
    right: 0;
    z-index: 100;
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 140px;
}

.settings-popover.hidden { display: none; }

.settings-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.settings-row label {
    font-size: 0.7rem;
    color: #475569;
    width: 28px;
}

.settings-row input {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    width: 70px;
}

.settings-row input:focus {
    outline: none;
    border-color: #2563eb;
}

.settings-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.settings-actions button {
    flex: 1;
    padding: 5px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    transition: all 0.15s;
}

.settings-actions button:first-child {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.settings-actions button:hover { opacity: 0.9; }

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-modal.hidden { display: none; }

.fullscreen-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
}

.fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.fullscreen-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.fullscreen-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.15s;
}

.fullscreen-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.fullscreen-axis-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 16px;
}

.fullscreen-axis-settings label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.fullscreen-axis-settings input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.8rem;
}

.fullscreen-axis-settings button {
    padding: 5px 10px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    transition: all 0.15s;
}

.fullscreen-axis-settings button:first-of-type {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.fullscreen-axis-settings button:hover { opacity: 0.9; }

.fullscreen-body {
    padding: 20px;
}

/* Empty state */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Detail ticker subtitle */
.detail-ticker {
    font-size: 0.8rem;
    color: #64748b;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Toolbar buttons */
.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #64748b;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

#dataChecksBtn span {
    font-weight: 700;
}

#dataChecksBtn.has-issues {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

#dataChecksBtn.has-issues:hover {
    background: #fee2e2;
}

/* Generic Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal.hidden { display: none; }

.hidden { display: none; }

.modal-content {
    background: white;
    border-radius: 12px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-large {
    width: 95%;
    max-width: 1100px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.15s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-body {
    padding: 16px 20px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

/* Idea Exposure Modal */
.idea-exposure-modal .idea-exposure-content {
    width: 99vw;
    max-width: none;
    height: 96vh;
    max-height: none;
    display: flex;
    flex-direction: column;
    border: 1px solid #dbe3ee;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.idea-exposure-header {
    align-items: flex-start;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.idea-exposure-header h3 {
    letter-spacing: 0;
}

.idea-exposure-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
}

.idea-exposure-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.idea-exposure-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.idea-exposure-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.idea-exposure-control-label {
    flex-shrink: 0;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.idea-exposure-analyst-group {
    flex-wrap: wrap;
}

.idea-exposure-date-control {
    margin-left: auto;
}

.idea-exposure-date-control input[type="date"] {
    height: 32px;
    min-width: 138px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 8px;
    background: #ffffff;
    color: #1e293b;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
}

.idea-exposure-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
}

.idea-exposure-stat {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.idea-exposure-stat-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0;
}

.idea-exposure-stat-value {
    display: block;
    font-size: 1.4rem;
    line-height: 1.15;
    font-weight: 700;
    color: #1e293b;
}

.idea-exposure-stat-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.25;
}

.idea-exposure-stat-sub .long { color: #16a34a; }
.idea-exposure-stat-sub .short { color: #dc2626; }
.idea-exposure-stat-sub .net { color: #2563eb; }
.idea-exposure-stat-sub .warn { color: #f59e0b; }

.idea-exposure-split {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

.idea-exposure-panel {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.idea-exposure-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.idea-exposure-panel-header.long {
    background: linear-gradient(90deg, #f0fdf4, #ffffff);
    border-left: 3px solid #22c55e;
}

.idea-exposure-panel-header.short {
    background: linear-gradient(90deg, #fef2f2, #ffffff);
    border-left: 3px solid #ef4444;
}

.idea-exposure-panel-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
}

.idea-exposure-panel-header.long .idea-exposure-direction { color: #16a34a; }
.idea-exposure-panel-header.short .idea-exposure-direction { color: #dc2626; }

.idea-exposure-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.idea-exposure-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.idea-exposure-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 0.72rem;
    table-layout: fixed;
}

.idea-exposure-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 9px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
}

.idea-exposure-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.idea-exposure-table th.sortable:hover {
    background: #e2e8f0;
}

.idea-exposure-table th.sortable::after {
    content: '↕';
    margin-left: 4px;
    opacity: 0.35;
    font-size: 0.6rem;
}

.idea-exposure-table th.sortable.active::after {
    content: '↓';
    opacity: 1;
}

.idea-exposure-table th.sortable.active.asc::after {
    content: '↑';
}

.idea-exposure-table th.right,
.idea-exposure-table td.right {
    text-align: right;
}

.idea-exposure-table th:nth-child(1),
.idea-exposure-table td:nth-child(1) {
    width: 22%;
}

.idea-exposure-table th:nth-child(2),
.idea-exposure-table td:nth-child(2) {
    width: 17%;
}

.idea-exposure-table th:nth-child(3),
.idea-exposure-table td:nth-child(3) {
    width: 15%;
}

.idea-exposure-table th:nth-child(4),
.idea-exposure-table td:nth-child(4) {
    width: 15%;
}

.idea-exposure-table th:nth-child(5),
.idea-exposure-table td:nth-child(5) {
    width: 10%;
}

.idea-exposure-table th:nth-child(6),
.idea-exposure-table td:nth-child(6) {
    width: 10%;
}

.idea-exposure-table th:nth-child(7),
.idea-exposure-table td:nth-child(7) {
    width: 11%;
}

#ideaExposureShortTable th:nth-child(1),
#ideaExposureShortTable td:nth-child(1) {
    width: 17%;
}

#ideaExposureShortTable th:nth-child(2),
#ideaExposureShortTable td:nth-child(2) {
    width: 12%;
}

#ideaExposureShortTable th:nth-child(3),
#ideaExposureShortTable td:nth-child(3) {
    width: 16%;
}

#ideaExposureShortTable th:nth-child(4),
#ideaExposureShortTable td:nth-child(4) {
    width: 11%;
}

#ideaExposureShortTable th:nth-child(5),
#ideaExposureShortTable td:nth-child(5) {
    width: 13%;
}

#ideaExposureShortTable th:nth-child(6),
#ideaExposureShortTable td:nth-child(6) {
    width: 9%;
}

#ideaExposureShortTable th:nth-child(7),
#ideaExposureShortTable td:nth-child(7) {
    width: 9%;
}

#ideaExposureShortTable th:nth-child(8),
#ideaExposureShortTable td:nth-child(8) {
    width: 13%;
}

.idea-exposure-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
}

.idea-exposure-table tr:hover {
    background: #f8fafc;
}

.idea-exposure-ticker {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.idea-exposure-ticker-code {
    min-width: 58px;
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 800;
}

.idea-exposure-ticker-name {
    max-width: 86px;
    overflow: hidden;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.idea-exposure-bucket-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 2px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.idea-exposure-bucket-chip.MAX_LONG,
.idea-exposure-bucket-chip.FULL_LONG,
.idea-exposure-bucket-chip.HALF_LONG {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.idea-exposure-bucket-chip.MAX_SHORT,
.idea-exposure-bucket-chip.FULL_SHORT,
.idea-exposure-bucket-chip.HALF_SHORT {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.idea-exposure-work-inline {
    margin-left: 5px;
    overflow: hidden;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.idea-exposure-liq-binding {
    color: #f59e0b;
    font-weight: 800;
}

.idea-exposure-si-fallback {
    color: #f59e0b;
    font-weight: 800;
}

.idea-exposure-si-compact {
    display: none;
}

.idea-exposure-cap-chip {
    display: inline-flex;
    align-items: center;
    height: 16px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
}

.idea-exposure-diff-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 2px 6px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1.35;
}

.idea-exposure-modal .idea-exposure-diff-chip.positive {
    color: #16a34a;
}

.idea-exposure-modal .idea-exposure-diff-chip.negative {
    color: #dc2626;
}

.idea-exposure-modal .idea-exposure-diff-chip.neutral {
    color: #64748b;
}

.idea-exposure-diff-quiet {
    font-weight: 700;
}

.idea-exposure-row {
    cursor: pointer;
}

.idea-exposure-row:hover td {
    background: #f8fafc;
}

.idea-exposure-modal .positive { color: #16a34a; }
.idea-exposure-modal .negative { color: #dc2626; }
.idea-exposure-modal .neutral { color: #64748b; }
.idea-exposure-modal .warn { color: #f59e0b; }

.idea-exposure-dtc-warn {
    color: #f59e0b;
    font-weight: 800;
}

.idea-exposure-empty {
    padding: 22px 10px !important;
    color: #94a3b8;
    text-align: center;
}

@media (max-width: 1720px) {
    .idea-exposure-modal .idea-exposure-checkpoint-inline {
        display: none;
    }

    .idea-exposure-modal .idea-exposure-si-input {
        display: none;
    }

    .idea-exposure-modal .idea-exposure-si-compact {
        display: inline;
    }
}

@media (max-width: 1320px) {
    .idea-exposure-modal .idea-exposure-table th,
    .idea-exposure-modal .idea-exposure-table td {
        padding-right: 7px;
        padding-left: 7px;
    }

    .idea-exposure-modal .idea-exposure-work-inline,
    .idea-exposure-modal .idea-exposure-ticker-name {
        display: none;
    }
}

@media (max-width: 980px) {
    .idea-exposure-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .idea-exposure-split {
        grid-template-columns: 1fr;
    }

    .idea-exposure-table-wrap {
        min-height: 280px;
    }

}

@media (max-width: 560px) {
    .idea-exposure-modal .idea-exposure-content {
        width: 98vw;
        height: 92vh;
        max-height: 92vh;
    }

    .idea-exposure-body {
        padding: 12px;
        overflow: auto;
    }

    .idea-exposure-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .idea-exposure-control-group {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .idea-exposure-date-control {
        margin-left: 0;
    }

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

    .idea-exposure-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Sector Overview */
.sector-overview-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sector-overview-tab {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sector-overview-tab:hover {
    color: #1e293b;
}

.sector-overview-tab.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.sector-overview-grid {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 24px;
    align-items: start;
}

.sector-table-container {
    --sector-toolbar-h: 38px;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sector-table-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: var(--sector-toolbar-h);
    padding: 0 10px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.sector-table-toolbar .btn-secondary {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.sector-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

#sectorTable > thead > tr > th {
    text-align: left;
    padding: 8px 10px;
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: var(--sector-toolbar-h);
    z-index: 1;
}

#sectorTable > thead > tr > th:not(:first-child) {
    text-align: right;
}

#sectorTable > tbody > tr > td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    line-height: 1.25;
}

#sectorTable > tbody > tr > td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#sectorTable > tbody > tr:not(.sector-expand-row):hover {
    background: #f8fafc;
}

.sector-table .sector-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-expander::before {
    content: '▸';
    display: inline-block;
    width: 14px;
    color: #64748b;
    transform: rotate(0deg);
    transition: transform 0.12s ease;
    font-size: 0.9em;
}

.row-expander.expanded::before {
    transform: rotate(90deg);
}

.sector-expand-row td {
    background: #f1f5f9;
    padding: 10px 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.expand-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.subsector-table,
.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.subsector-table th,
.subsector-table td,
.stock-table th,
.stock-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.76rem;
}

.subsector-table th,
.stock-table th {
    text-align: left;
    color: #475569;
    font-weight: 700;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
}

.subsector-table th:not(:first-child),
.subsector-table td:not(:first-child),
.stock-table th:not(:first-child),
.stock-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.subsector-table tr.clickable:hover td,
.stock-table tr:hover td {
    background: #f8fafc;
}

.subsector-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsector-expand-row td {
    padding: 10px 6px 12px;
    background: #ffffff;
}

.stock-table {
    margin-top: 10px;
}

.stock-table td {
    vertical-align: top;
}

.stock-table td:nth-child(2) {
    white-space: nowrap;
}

.subsector-table tbody tr:nth-child(even) td {
    background: #fcfdff;
}

.stock-table tbody tr:nth-child(even) td {
    background: #fcfdff;
}

.subsector-table td:first-child {
    padding-left: 14px;
}

.stock-table td:first-child,
.stock-table th:first-child {
    padding-left: 14px;
}

.stock-table td:first-child {
    font-weight: 600;
}

.stock-table td:nth-child(2) {
    color: #475569;
}

.sector-chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sector-chart-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.sector-chart-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
}

.sector-chart-box > div:last-child {
    min-height: 280px;
}

.sector-drilldown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.sector-drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sector-drilldown-breadcrumb {
    font-size: 0.8rem;
    color: #475569;
}

.sector-drilldown-breadcrumb .crumb {
    font-weight: 600;
    color: #1e293b;
}

.sector-drilldown-breadcrumb .sep {
    margin: 0 6px;
    color: #94a3b8;
}

.sector-drilldown table {
    width: 100%;
    border-collapse: collapse;
}

.sector-drilldown th,
.sector-drilldown td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
}

.sector-drilldown th {
    text-align: left;
    color: #475569;
    font-weight: 600;
}

.sector-drilldown tr.clickable:hover td {
    background: #f8fafc;
    cursor: pointer;
}

.sector-drilldown .muted {
    color: #94a3b8;
}

/* Idea Source Modal */
.idea-source-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.idea-explainer {
    display: flex;
    gap: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    padding: 14px 18px;
    border-left: 4px solid #3b82f6;
}

.idea-explainer-text {
    flex: 1;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
}

.idea-example {
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 280px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.idea-example-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.idea-example-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 6px;
}

.example-score {
    font-size: 0.7rem;
    color: #64748b;
}

.example-score b {
    color: #1e293b;
}

.example-score.example-fam {
    border-left: 1px solid #e2e8f0;
    padding-left: 10px;
}

.idea-example-result {
    font-size: 0.75rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 6px;
}

.idea-example-result .positive {
    color: #16a34a;
    font-weight: 600;
}

.idea-source-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.idea-stat-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.idea-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.idea-stat-value {
    font-size: 1rem;
    font-weight: 700;
}

.idea-stat-value.positive { color: #16a34a; }
.idea-stat-value.negative { color: #dc2626; }

.idea-source-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.idea-chart-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.idea-chart-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
}

.idea-chart-box > div:last-child {
    min-height: 300px;
}

.idea-source-correlations {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.idea-source-correlations > div:last-child {
    min-height: 200px;
}

/* Familiarity hit rate summary */
.fam-summary {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}

.fam-band {
    text-align: center;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 6px 12px;
    min-width: 70px;
}

.fam-band-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}

.fam-band-hit {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.fam-band-hit.good { color: #16a34a; }
.fam-band-hit.bad { color: #dc2626; }

.fam-band-n {
    font-size: 0.6rem;
    color: #94a3b8;
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content { grid-template-columns: 1fr; }
    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
}

/* Blotter hover info panel */
.blotter-hover-info {
    min-height: 50px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 12px;
}

.blotter-hover-info:empty {
    display: none;
}

.blotter-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.blotter-date {
    font-weight: 600;
    color: #334155;
}

.blotter-ratings {
    color: #64748b;
}

.blotter-dir {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.blotter-dir.dir-long {
    background: #dcfce7;
    color: #166534;
}

.blotter-dir.dir-short {
    background: #fee2e2;
    color: #991b1b;
}

.blotter-dir.dir-neutral {
    background: #f1f5f9;
    color: #475569;
}

.blotter-type {
    color: #94a3b8;
    font-style: italic;
}

.blotter-comment {
    color: #475569;
    line-height: 1.5;
    padding: 8px;
    background: #fff;
    border-left: 3px solid #e2e8f0;
    border-radius: 0 4px 4px 0;
}

/* Blotter entries table */
.blotter-table-container {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.blotter-table-container h3 {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 12px 0;
}

.blotter-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.blotter-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.blotter-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.blotter-table .blotter-date {
    white-space: nowrap;
    font-weight: 500;
    color: #334155;
}

.blotter-table .blotter-rating {
    text-align: center;
    font-weight: 600;
    width: 40px;
}

.blotter-table .blotter-dir {
    font-weight: 600;
    width: 60px;
}

.blotter-table .blotter-view {
    color: #475569;
    line-height: 1.5;
}

.blotter-table .audit-source {
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
}

.blotter-table .audit-reason {
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    white-space: nowrap;
}

.blotter-table tr.row-long .blotter-dir {
    color: #166534;
}

.blotter-table tr.row-short .blotter-dir {
    color: #991b1b;
}

.blotter-table tr.row-neutral .blotter-dir {
    color: #64748b;
}

.blotter-table tr.row-missing .audit-reason {
    color: #b45309;
    font-weight: 700;
}

.blotter-table tr:hover {
    background: #f8fafc;
}

.data-check-summary {
    margin-bottom: 12px;
    color: #475569;
    font-size: 0.82rem;
}

.data-check-table-container {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.data-check-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-check-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.data-check-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.data-check-table .ticker-name {
    max-width: none;
}

.data-check-count {
    font-weight: 700;
    color: #b91c1c;
}

.data-check-issues {
    color: #334155;
}

/* Help Modal */
.help-modal-body {
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.help-content {
    max-width: 720px;
    margin: 0 auto;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.help-section p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 10px 0;
}

.help-section ul, .help-section ol {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 6px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin: 10px 0;
}

.help-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f1f5f9;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.help-example {
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #cbd5e1;
    margin: 8px 0;
}

.text-long {
    color: #166534;
    font-weight: 600;
}

.text-short {
    color: #991b1b;
    font-weight: 600;
}

.marker-long {
    color: #16a34a;
    font-size: 1rem;
}

.marker-short {
    color: #dc2626;
    font-size: 1rem;
}

.marker-neutral {
    color: #64748b;
    font-size: 0.9rem;
}

/* ============================================================================
   ANALYST ATTRIBUTION MODAL
   ============================================================================ */

.analyst-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analyst-summary-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.analyst-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 140px;
    text-align: center;
    position: relative;
}

.analyst-card-rank {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
}

.analyst-card-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    font-family: 'Manrope', sans-serif;
}

.analyst-card-alpha {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.analyst-card-alpha.positive { color: #16a34a; }
.analyst-card-alpha.negative { color: #dc2626; }

.analyst-card-pct {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.analyst-card-ideas {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.analyst-table-container {
    overflow-x: auto;
}

.analyst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.analyst-table th {
    background: #f1f5f9;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.analyst-table th.sortable:hover {
    background: #e2e8f0;
}

.analyst-table th.sortable.active {
    color: #2563eb;
}

.analyst-table th.sortable::after {
    content: '';
    margin-left: 4px;
}

.analyst-table th.sortable.active.desc::after {
    content: '▼';
    font-size: 0.6rem;
}

.analyst-table th.sortable.active.asc::after {
    content: '▲';
    font-size: 0.6rem;
}

.analyst-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.analyst-table tr:hover {
    background: #f8fafc;
}

.analyst-table td.positive {
    color: #16a34a;
    font-weight: 600;
}

.analyst-table td.negative {
    color: #dc2626;
    font-weight: 600;
}

.analyst-unassigned-row {
    background: #fef3c7;
    font-style: italic;
}

.analyst-unassigned-row td {
    color: #92400e;
}

.analyst-totals-row {
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}

.analyst-totals-row td {
    font-weight: 700;
}

/* Portfolio Modal */
.portfolio-filter-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 12px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 4px;
}

.portfolio-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.portfolio-stat {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 120px;
}

.portfolio-stat-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.portfolio-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.portfolio-stat-value.positive { color: #16a34a; }
.portfolio-stat-value.negative { color: #dc2626; }

.portfolio-chart-container {
    background: white;
    border-radius: 8px;
    padding: 16px;
    min-height: 400px;
}

#portfolioChart {
    height: 380px;
}

/* =============================================================================
   ANALYST DASHBOARD STYLES
   ============================================================================= */

.analyst-code-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Performance Cards Row */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px 20px;
}

.perf-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.perf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.perf-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.perf-card-link {
    font-size: 0.75rem;
    color: #3b82f6;
    text-decoration: none;
}

.perf-card-link:hover {
    text-decoration: underline;
}

.perf-card-stats {
    display: flex;
    gap: 16px;
}

.perf-stat {
    flex: 1;
}

.perf-stat-label {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.perf-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.perf-stat-value.positive { color: #16a34a; }
.perf-stat-value.negative { color: #dc2626; }

.perf-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.perf-card-note {
    font-size: 0.75rem;
    color: #64748b;
}

.perf-bucket-table {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.perf-bucket-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.perf-bucket-table th,
.perf-bucket-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.75rem;
    text-align: right;
}

.perf-bucket-table th:first-child,
.perf-bucket-table td:first-child {
    text-align: left;
}

.perf-bucket-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

.perf-bucket-table tr:last-child td {
    border-bottom: none;
}

.perf-bucket-table tr.total td {
    background: #f8fafc;
    font-weight: 700;
    color: #1e293b;
}

/* Quick Links Card */
.quick-links-card .perf-card-header {
    border-bottom: none;
    margin-bottom: 8px;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}

.quick-link-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.quick-link-btn svg {
    color: #64748b;
}

/* Section Container */
.section-container {
    margin: 0 20px 20px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.section-count {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

.section-count.section-count-warn {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.team-view-btn {
    margin-left: auto;
    padding: 6px 12px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.team-view-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.save-btn {
    margin-left: 8px;
    padding: 6px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.save-btn:hover {
    background: #2563eb;
}

.save-btn.has-changes {
    background: #f59e0b;
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Coverage Table */
.coverage-table-wrapper {
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.coverage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.coverage-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.coverage-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.coverage-table tr:hover {
    background: #f8fafc;
}

.coverage-table .ticker-cell {
    font-weight: 600;
    color: #1e293b;
}

.coverage-table .role-cell {
    color: #64748b;
}

.coverage-table .blotter-cell {
    color: #94a3b8;
    font-size: 0.75rem;
}

.coverage-table .alpha-cell {
    font-weight: 600;
}

.coverage-table .positive { color: #16a34a; }
.coverage-table .negative { color: #dc2626; }

.coverage-table .empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
}

/* Sortable headers */
.coverage-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.coverage-table th.sortable:hover {
    background: #334155;
}
.coverage-table th.sortable::after {
    content: '';
    margin-left: 4px;
    opacity: 0.3;
}
.coverage-table th.sort-asc::after {
    content: '▲';
    opacity: 1;
}
.coverage-table th.sort-desc::after {
    content: '▼';
    opacity: 1;
}

/* Status pills */
.status-cell {
    text-align: center;
}
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-live {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}
.status-closed {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.status-expired {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* Collapsible Sections */
.live-ideas-section .section-header.collapsible,
.closed-ideas-section .section-header.collapsible,
.conviction-history-section .section-header.collapsible,
.submissions-section .section-header.collapsible {
    cursor: pointer;
    user-select: none;
}
.live-ideas-section .section-header.collapsible:hover,
.closed-ideas-section .section-header.collapsible:hover,
.conviction-history-section .section-header.collapsible:hover,
.submissions-section .section-header.collapsible:hover {
    background: rgba(255, 255, 255, 0.02);
}
.collapse-icon {
    font-size: 0.7rem;
    margin-right: 8px;
    color: #94a3b8;
}
.closed-ideas-content {
    margin-top: 12px;
}
.reason-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
.reason-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.reason-timeout {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

/* Submissions Section */
.submissions-filters {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.submissions-filters select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    background: white;
    cursor: pointer;
}

.submissions-content {
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* Submissions table - extends coverage-table */
.submissions-table {
    table-layout: fixed;
}

.submissions-table th:nth-child(1),
.submissions-table td:nth-child(1) { width: 90px; }   /* Date */
.submissions-table th:nth-child(2),
.submissions-table td:nth-child(2) { width: 110px; }  /* Ticker */
.submissions-table th:nth-child(3),
.submissions-table td:nth-child(3) { width: 44px; }   /* Analyst (#) */
.submissions-table th:nth-child(4),
.submissions-table td:nth-child(4) { width: 90px; }   /* Type */
.submissions-table th:nth-child(5),
.submissions-table td:nth-child(5) { width: auto; }   /* Idea */
.submissions-table th:nth-child(6),
.submissions-table td:nth-child(6) { width: 70px; }   /* ST */
.submissions-table th:nth-child(7),
.submissions-table td:nth-child(7) { width: 70px; }   /* LT */
.submissions-table th:nth-child(8),
.submissions-table td:nth-child(8) { width: 110px; }  /* Event Date */
.submissions-table th:nth-child(9),
.submissions-table td:nth-child(9) { width: 66px; }   /* Doc */

.submissions-table td:not(.idea-cell):not(.event-cell):not(.doc-cell) {
    white-space: nowrap;
}

.submissions-table .idea-cell {
    color: #475569;
    font-size: 0.75rem;
    white-space: normal;
    line-height: 1.45;
    padding-right: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.submissions-table .event-cell {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    color: #64748b;
}

.submissions-table .doc-cell {
    white-space: nowrap;
}

.submissions-table td {
    padding-top: 12px;
    padding-bottom: 12px;
    vertical-align: top;
}

.submissions-table td:nth-child(6),
.submissions-table td:nth-child(7) {
    vertical-align: middle;
}

.submissions-table .analyst-cell {
    font-weight: 700;
    color: #475569;
    text-align: center;
}

.submissions-table .muted {
    color: #94a3b8;
}

.submissions-table .doc-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.submissions-table .doc-link:hover {
    text-decoration: underline;
}

/* ST/LT rating pills */
.submissions-table .rating-td {
    text-align: center;
}

.submissions-table .rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    background: rgba(100, 116, 139, 0.10);
    color: #475569;
}

.submissions-table .rating-badge.positive {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.submissions-table .rating-badge.negative {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.submissions-table .type-pill {
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 10px;
    display: inline-block;
    line-height: 1;
}

.submissions-table .type-pill.type-new {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.submissions-table .type-pill.type-update {
    background: rgba(234, 179, 8, 0.15);
    color: #92400e;
}

.submissions-table .type-pill.type-meeting {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.submissions-table .type-pill.type-other {
    background: rgba(226, 232, 240, 0.6);
    color: #475569;
}

.submissions-table .rating-badge {
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.submissions-table tr.expandable {
    cursor: pointer;
}

.bbb-table {
    table-layout: fixed;
}

.bbb-table th:nth-child(1),
.bbb-table td:nth-child(1) { width: 90px; }

.bbb-table th:nth-child(2),
.bbb-table td:nth-child(2) { width: 110px; }

.bbb-table th:nth-child(3),
.bbb-table td:nth-child(3) { width: 44px; }

.bbb-table th:nth-child(4),
.bbb-table td:nth-child(4) { width: 84px; }

.bbb-table th:nth-child(n+5),
.bbb-table td:nth-child(n+5) { width: 110px; }

.bbb-table td {
    vertical-align: middle;
}

.bbb-table .analyst-cell {
    font-weight: 700;
    color: #475569;
    text-align: center;
}

.bbb-table .bbb-ev-cell {
    font-weight: 700;
    text-align: center;
}

.bbb-compact-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bbb-compact-payoff {
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
}

.bbb-compact-payoff.positive { color: #166534; }
.bbb-compact-payoff.negative { color: #b91c1c; }
.bbb-compact-payoff.neutral { color: #475569; }

.bbb-compact-prob {
    font-size: 0.66rem;
    color: #64748b;
    font-weight: 600;
}

.coverage-table .rating-cell {
    text-align: center;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 0;
    font-size: 0.74rem;
    background: rgba(100, 116, 139, 0.10);
    color: #475569;
}

.coverage-table .rating-cell.positive {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.coverage-table .rating-cell.negative {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.submission-expanded {
    background: #f8fafc;
}

.submission-expanded td {
    padding: 12px 16px;
}

.submission-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.submission-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1e293b;
}

.submission-detail-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: #64748b;
}

.submission-detail-idea {
    color: #475569;
    line-height: 1.5;
    padding: 10px 12px;
    background: white;
    border-left: 3px solid #e2e8f0;
    border-radius: 0 6px 6px 0;
}

.submission-detail-links {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
}

.submission-detail-links a {
    color: #3b82f6;
    text-decoration: none;
}

.submission-detail-links a:hover {
    text-decoration: underline;
}

.direction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.direction-badge.long {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.direction-badge.short {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.direction-badge.neutral {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* Buckets */
.buckets-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.buckets-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.bucket-group {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.bucket-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 4px;
}

.longs-group .bucket-group-label { color: #16a34a; }
.shorts-group .bucket-group-label { color: #dc2626; }

.buckets-inner {
    display: flex;
    gap: 8px;
    flex: 1;
}

.bucket {
    flex: 1;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    min-height: 120px;
    min-width: 100px;
    transition: all 0.15s;
}

.bucket.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.neutral-bucket {
    flex: 0 0 auto;
    min-width: 100px;
}

.unallocated-bucket {
    border-style: solid;
    border-color: #fbbf24;
    background: #fefce8;
    min-height: 60px;
    max-width: none;
    flex: none;
    width: 100%;
}

.bucket-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    text-align: center;
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.bucket-content {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.bucket-content.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Idea Cards */
.idea-card {
    background: white;
    border-radius: 6px;
    padding: 5px 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: grab;
    border-left: 3px solid #e2e8f0;
    transition: all 0.15s;
    width: 132px;
    flex-shrink: 0;
}

.idea-card:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.idea-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.idea-card.long {
    border-left-color: #16a34a;
}

.idea-card.short {
    border-left-color: #dc2626;
}

.idea-card.expiring-soon {
    background: #fffbeb;
    box-shadow: 0 0 0 1px #fde68a inset;
}

.idea-row1 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
}

.idea-ticker {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1e293b;
}

.idea-timer {
    font-size: 0.6rem;
    color: #94a3b8;
}

.idea-timer.warn {
    color: #b45309;
    font-weight: 700;
}

.idea-ratings {
    font-size: 0.6rem;
    font-weight: 600;
    margin-top: 2px;
}

.idea-ratings.long { color: #16a34a; }
.idea-ratings.short { color: #dc2626; }

.idea-sizing {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
    margin-top: 2px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: 0;
}

.idea-sizing span {
    display: inline-flex;
    align-items: baseline;
    min-width: 0;
    gap: 2px;
}

.idea-sizing strong {
    margin-left: 0;
    font-size: 0.6rem;
    font-weight: 800;
}

.idea-sizing strong.positive { color: #16a34a; }
.idea-sizing strong.negative { color: #dc2626; }
.idea-sizing strong.neutral { color: #64748b; }

.idea-workings-modal {
    width: min(1160px, calc(100vw - 56px));
    max-width: none;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
}

.idea-workings-modal .modal-header {
    padding: 18px 24px 16px;
    border-bottom-color: #e5e7eb;
}

.idea-workings-modal .modal-header h3 {
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: 0;
}

.idea-workings-modal .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.idea-workings-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 24px 22px;
    background: #f8fafc;
    max-height: calc(92vh - 76px);
}

.idea-workings-subtitle {
    margin-top: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.idea-workings-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.idea-workings-summary-tile {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 11px 12px;
}

.idea-workings-summary-tile span {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #64748b;
}

.idea-workings-summary-tile strong {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: 0;
    color: #0f172a;
    line-height: 1.05;
}

.idea-workings-summary-tile em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.15;
}

.idea-workings-info-grid {
    display: grid;
    grid-template-columns: 1fr 1.08fr 1.08fr;
    gap: 10px;
}

.idea-workings-info-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
}

.idea-workings-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #475569;
    margin-bottom: 8px;
}

.idea-workings-section-gap {
    margin-top: 2px;
    margin-bottom: 0;
}

.idea-workings-sizing-grid {
    margin-top: -2px;
}

.idea-workings-modal .sizing-breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.idea-workings-modal .sizing-breakdown-block {
    border-color: #dbeafe;
    border-radius: 8px;
    padding: 12px;
}

.idea-workings-modal .sizing-breakdown-heading {
    letter-spacing: 0;
    font-size: 0.68rem;
}

.idea-workings-modal .sizing-kv span {
    font-size: 0.76rem;
}

.idea-workings-modal .sizing-kv strong {
    font-size: 0.78rem;
}

.idea-workings-modal .sizing-breakdown-result {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    padding: 12px;
}

.idea-workings-empty,
.idea-workings-note {
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    padding: 9px 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

.idea-workings-note {
    margin-top: -4px;
}

.idea-workings-modal strong.positive { color: #16a34a; }
.idea-workings-modal strong.negative { color: #dc2626; }
.idea-workings-modal strong.neutral { color: #64748b; }
.idea-workings-modal strong.warn { color: #f59e0b; }

@media (max-width: 760px) {
    .idea-workings-modal {
        width: calc(100vw - 24px);
    }

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

    .idea-workings-info-grid {
        grid-template-columns: 1fr;
    }

    .idea-workings-modal .sizing-breakdown-grid,
    .idea-workings-modal .sizing-breakdown-result {
        grid-template-columns: 1fr;
    }
}

.expired-buckets-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 6px;
}

.expired-buckets-panel.hidden {
    display: none;
}

.expired-bucket-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 118px;
    padding: 6px 8px;
    background: #ffffff;
    border: 1px solid #fecaca;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
}

.expired-bucket-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.expired-bucket-ticker {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e293b;
}

.expired-bucket-score {
    font-size: 0.65rem;
    font-weight: 700;
    color: #991b1b;
}

.expired-bucket-meta {
    font-size: 0.62rem;
    color: #7f1d1d;
    white-space: nowrap;
}

/* New Entry Button */
.new-entry-btn {
    padding: 4px 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-right: auto;
    margin-left: 8px;
}

.new-entry-btn:hover {
    background: #2563eb;
}

/* Blotter Modal */
.blotter-modal {
    width: 980px;
    max-width: 95vw;
}

.readonly-input {
    background: #f8fafc !important;
    color: #334155;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Submission detail modal */
.submission-detail-modal {
    width: 980px;
    max-width: 96vw;
}

.submission-detail-modal .modal-body {
    padding: 18px 20px 20px;
}

.submission-detail-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.submission-detail-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.submission-detail-modal-kv {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-height: 54px;
}

.submission-detail-modal-kv .k {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 6px;
}

.submission-detail-modal-kv .v {
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 600;
}

.submission-detail-modal-idea {
    padding: 14px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    line-height: 1.55;
    font-size: 0.9rem;
}

.submission-detail-bbb {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 14px;
}

.submission-detail-bbb-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.submission-detail-bbb-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f172a;
}

.submission-detail-bbb-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.submission-detail-bbb-body .muted {
    color: #64748b;
    font-size: 0.8rem;
}

.bbb-detail-table-wrap,
.bbb-table-wrap {
    overflow-x: auto;
}

.bbb-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.bbb-detail-table th,
.bbb-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}

.bbb-detail-table th {
    background: #f8fafc;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.bbb-detail-table tr:last-child td {
    border-bottom: 0;
}

.bbb-detail-label {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.bbb-detail-metric {
    font-weight: 700;
    white-space: nowrap;
}

.bbb-detail-metric.positive { color: #166534; }
.bbb-detail-metric.negative { color: #b91c1c; }
.bbb-detail-metric.neutral { color: #475569; }

.bbb-detail-comment {
    color: #334155;
    line-height: 1.45;
    min-width: 280px;
}

.blotter-modal .modal-body {
    padding: 18px 20px 14px;
}

.blotter-modal form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row > .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s;
    line-height: 1.25;
}

.blotter-modal .form-group input[type="text"],
.blotter-modal .form-group input[type="date"],
.blotter-modal .form-group input[type="url"],
.blotter-modal .form-group select {
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
}

.blotter-modal .form-group select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#blotterIdea {
    min-height: unset;
    resize: none;
    overflow: hidden;
}

.char-count {
    font-weight: 400;
    color: #94a3b8;
}

.optional {
    font-weight: 400;
    color: #94a3b8;
}

/* Rating Groups */
.ratings-row {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 16px 0;
}

.rating-group {
    margin-bottom: 0;
}

.rating-group label {
    margin-bottom: 8px;
}

.rating-hint {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.7rem;
}

.rating-options {
    display: flex;
    gap: 4px;
}

.rating-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

.rating-options label:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.rating-options input[type="radio"] {
    display: none;
}

.rating-options label:has(input:checked) {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Score Preview */
.score-preview {
    text-align: center;
    padding: 10px 16px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 16px;
}

.direction-text {
    font-weight: 700;
}

.direction-text.long {
    color: #16a34a;
}

.direction-text.short {
    color: #dc2626;
}

.direction-text.neutral {
    color: #64748b;
}

.direction-text.close {
    color: #b45309;
}

.event-date-text {
    display: inline-block;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.close-warning {
    margin: -8px 0 16px;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 6px;
    color: #92400e;
    font-size: 0.82rem;
    line-height: 1.25;
}

.close-warning.hidden {
    display: none;
}

.initial-bucket-group {
    margin: 0 0 8px;
}

.initial-bucket-picker {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.initial-bucket-picker.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.bucket-chip {
    border: 1px solid #dbe3ef;
    background: #ffffff;
    color: #475569;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 6px;
    cursor: pointer;
}

.bucket-chip.short {
    background: #fff1f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.bucket-chip.long {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.bucket-chip.neutral {
    background: #f1f5f9;
    color: #475569;
}

.bucket-chip.active {
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.bucket-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.initial-bucket-hint {
    margin-top: 6px;
    font-size: 0.72rem;
    color: #64748b;
}

.ticker-assist {
    margin-top: 6px;
}

.ticker-search-results {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    max-height: 190px;
    overflow: auto;
}

.ticker-search-results.hidden {
    display: none;
}

.ticker-result {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    padding: 7px 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ticker-result:last-child {
    border-bottom: 0;
}

.ticker-result:hover {
    background: #f8fafc;
}

.ticker-result .ticker {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
}

.ticker-result .meta {
    font-size: 0.68rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticker-result-empty {
    padding: 8px 9px;
    font-size: 0.72rem;
    color: #64748b;
}

.ticker-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #166534;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 9px;
}

.ticker-selected-chip.hidden {
    display: none;
}

.sizing-preview-card {
    margin: 6px 0 4px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 8px;
    padding: 10px 12px;
}

.sizing-preview-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    font-weight: 800;
    margin-bottom: 6px;
}

.sizing-preview-status {
    font-size: 0.8rem;
    color: #0f172a;
    font-weight: 700;
}

.sizing-preview-breakdown {
    margin-top: 8px;
    font-size: 0.74rem;
    color: #334155;
    line-height: 1.35;
}

.sizing-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 8px;
}

.sizing-breakdown-block {
    border: 1px solid #dbeafe;
    background: #ffffff;
    border-radius: 8px;
    padding: 9px 10px;
}

.sizing-breakdown-heading {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    font-weight: 700;
    margin-bottom: 6px;
}

.sizing-breakdown-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sizing-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.sizing-kv span {
    color: #64748b;
    font-size: 0.72rem;
}

.sizing-kv strong {
    color: #0f172a;
    font-size: 0.73rem;
    font-weight: 700;
    text-align: right;
}

.sizing-kv strong.warn {
    color: #b45309;
}

.sizing-fallback-warning {
    margin-bottom: 8px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
}

/* Sizing workings waterfall (shared component: js/sizing-workings.js) */
.sizing-wf {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 10px 12px 8px;
}

.sizing-wf-row {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) 128px;
    gap: 10px;
    align-items: center;
    min-height: 30px;
    border-radius: 6px;
    cursor: pointer;
}

.sizing-wf-row.static {
    cursor: default;
}

.sizing-wf-row:hover {
    background: #f8fafc;
}

.sizing-wf-row:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.sizing-wf.dense .sizing-wf-row {
    min-height: 24px;
    grid-template-columns: 164px minmax(0, 1fr) 112px;
}

.sizing-wf.dense .sizing-wf-binding:not(.warn) {
    display: none;
}

.sizing-wf-lab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
    font-size: 0.72rem;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
    min-width: 0;
}

.sizing-wf-lab-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sizing-wf-caret {
    color: #94a3b8;
    font-size: 0.55rem;
    flex: 0 0 auto;
    transition: transform 0.12s ease;
}

.sizing-wf-caret.spacer {
    visibility: hidden;
}

.sizing-wf-row[aria-expanded="true"] .sizing-wf-caret {
    transform: rotate(90deg);
}

.sizing-wf-mult {
    font-size: 0.62rem;
    color: #64748b;
    font-weight: 700;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 6px;
    flex: 0 0 auto;
}

.sizing-wf-binding {
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 999px;
    padding: 1px 6px;
    background: #f1f5f9;
    color: #475569;
    flex: 0 0 auto;
}

.sizing-wf-binding.warn {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.sizing-wf-track {
    position: relative;
    height: 100%;
    min-height: 28px;
}

.sizing-wf.dense .sizing-wf-track {
    min-height: 22px;
}

.sizing-wf-grid {
    position: absolute;
    inset: 0;
}

.sizing-wf-grid i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #eef2f7;
}

.sizing-wf-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    border-radius: 0 4px 4px 0;
}

.sizing-wf.dense .sizing-wf-bar {
    height: 12px;
}

.sizing-wf-bar.total { background: #3b82f6; }
.sizing-wf-bar.final { background: #1d4ed8; }
.sizing-wf-bar.up { background: #16a34a; }

.sizing-wf-bar.down {
    background: #dc2626;
    border-radius: 4px 0 0 4px;
}

.sizing-wf-bar.zero {
    background: #94a3b8;
    width: 2px;
    border-radius: 1px;
}

.sizing-wf-conn {
    position: absolute;
    width: 1px;
    top: -8px;
    height: 14px;
    background: #cbd5e1;
}

.sizing-wf-delta {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.64rem;
    font-weight: 700;
    white-space: nowrap;
}

.sizing-wf-delta.up { color: #16a34a; }
.sizing-wf-delta.down { color: #dc2626; }
.sizing-wf-delta.zero { color: #94a3b8; }

.sizing-wf-val {
    text-align: right;
    font-size: 0.72rem;
    color: #0f172a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-right: 4px;
    white-space: nowrap;
}

.sizing-wf-val .usd {
    color: #64748b;
    font-weight: 600;
    font-size: 0.65rem;
    margin-left: 5px;
}

.sizing-wf-band {
    position: absolute;
    top: 50%;
    height: 9px;
    transform: translateY(-50%);
    border-left: 1.5px solid #94a3b8;
    border-right: 1.5px solid #94a3b8;
}

.sizing-wf-band::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5px;
    transform: translateY(-50%);
    background: #94a3b8;
}

.sizing-wf-band-lab {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    color: #64748b;
    white-space: nowrap;
}

.sizing-wf-xaxis {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) 128px;
    gap: 10px;
    margin-top: 2px;
}

.sizing-wf.dense .sizing-wf-xaxis {
    grid-template-columns: 164px minmax(0, 1fr) 112px;
}

.sizing-wf-ticks {
    position: relative;
    height: 14px;
    font-size: 0.6rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.sizing-wf-ticks i {
    position: absolute;
    transform: translateX(-50%);
    font-style: normal;
}

.sizing-wf-detail {
    margin: 4px 4px 10px;
}

.sizing-wf-detail-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.sizing-wf-detail-inner.nochart {
    grid-template-columns: 1fr;
}

.sizing-wf-detail-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sizing-wf-detail-head {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    margin-bottom: 3px;
}

.sizing-wf-curve {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 8px 4px;
    align-self: start;
}

.sizing-wf-ladder {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 14px 6px 6px;
}

.sizing-wf-ladder-col {
    flex: 1;
    text-align: center;
}

.sizing-wf-ladder-val {
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 2px;
}

.sizing-wf-ladder-bar {
    border-radius: 4px 4px 0 0;
    background: #e2e8f0;
    margin: 0 10px;
}

.sizing-wf-ladder-lab {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-top: 3px;
}

.sizing-wf-ladder-col.active .sizing-wf-ladder-val,
.sizing-wf-ladder-col.active .sizing-wf-ladder-lab {
    color: #1d4ed8;
    font-weight: 700;
}

.sizing-wf-ladder-col.active .sizing-wf-ladder-bar {
    background: #1d4ed8;
}

.sizing-wf-result {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    align-items: baseline;
}

.sizing-wf-result .sizing-kv {
    padding: 0;
    gap: 8px;
}

.sizing-wf-direction {
    display: inline-block;
    border-radius: 999px;
    padding: 0 7px;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-right: 6px;
    vertical-align: 1px;
}

.sizing-wf-direction.long {
    background: #dcfce7;
    color: #166534;
}

.sizing-wf-direction.short {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 760px) {
    .sizing-wf-row,
    .sizing-wf-xaxis {
        grid-template-columns: 118px minmax(0, 1fr) 92px;
    }

    .sizing-wf-detail-inner {
        grid-template-columns: 1fr;
    }
}

.sizing-breakdown-result {
    margin-top: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 8px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sizing-preview-note {
    margin-top: 6px;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.3;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: -14px;
    background: linear-gradient(to top, rgba(255,255,255,1) 70%, rgba(255,255,255,0));
}

.btn-cancel {
    padding: 8px 20px;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-submit {
    padding: 8px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-submit:hover {
    background: #2563eb;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .blotter-modal {
        width: 96vw;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }

    .ratings-row {
        padding: 10px 12px;
    }

    .initial-bucket-picker {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }

    .quick-links-card {
        grid-column: span 2;
    }

    .buckets-row {
        flex-wrap: wrap;
    }

    .bucket-group {
        flex-basis: 100%;
    }

    .neutral-bucket {
        max-width: none;
    }
}

/* =============================================================================
   DASHBOARD V2 - Tabbed layout
   ============================================================================= */

.dashboard-v2 {
    max-width: 1600px;
}

/* V2 Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* V2 Performance cards - two cards only, no Quick Links */
.dashboard-cards-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.new-entry-btn-header {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.new-entry-btn-header:hover {
    background: #2563eb;
}

/* V2 Buckets Section */
.buckets-section-v2 {
    margin-bottom: 20px;
}

/* V2 Tabs Section */
.tabs-section {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tabs-bar {
    display: flex;
    gap: 0;
}

.tabs-bar .tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.tabs-bar .tab:hover {
    color: #1e293b;
    background: rgba(0,0,0,0.02);
}

.tabs-bar .tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tab-filters select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    background: white;
    cursor: pointer;
}

.tab-filters select:focus {
    outline: none;
    border-color: #3b82f6;
}

.tab-content {
    display: none;
    padding: 16px;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

/* Monthly Review tab */
.monthly-review-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monthly-review-page-section {
    padding: 16px;
}

.monthly-review-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.monthly-review-title {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 700;
}

.monthly-review-subtitle {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.monthly-review-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.monthly-review-controls select {
    min-width: 132px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
}

.monthly-review-controls select:focus {
    outline: none;
    border-color: #3b82f6;
}

.mini-refresh-btn {
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.mini-refresh-btn:hover {
    background: #dbeafe;
}

.monthly-review-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.monthly-review-kpi {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.monthly-review-kpi span {
    display: block;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.monthly-review-kpi strong {
    display: block;
    margin-top: 4px;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 800;
}

.monthly-review-kpi em {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 600;
}

.monthly-review-kpi strong.positive,
.monthly-review-table .positive,
.monthly-review-sector-bar .positive {
    color: #16a34a;
}

.monthly-review-kpi strong.negative,
.monthly-review-table .negative,
.monthly-review-sector-bar .negative {
    color: #dc2626;
}

.monthly-review-kpi strong.neutral,
.monthly-review-table .neutral,
.monthly-review-sector-bar .neutral {
    color: #64748b;
}

.monthly-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    gap: 12px;
}

.monthly-review-panel {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.monthly-review-panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.monthly-review-panel-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 800;
}

.monthly-review-panel-header span {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.monthly-review-sector-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.monthly-review-segmented {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #f8fafc;
}

.monthly-review-segmented button {
    padding: 4px 8px;
    border: 0;
    border-right: 1px solid #dbe3ef;
    background: transparent;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 800;
    cursor: pointer;
}

.monthly-review-segmented button:last-child {
    border-right: 0;
}

.monthly-review-segmented button.active {
    background: #eff6ff;
    color: #2563eb;
}

.monthly-review-table-wrap {
    overflow: auto;
    max-height: 320px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.monthly-review-table-wrap.large {
    max-height: 380px;
}

.monthly-review-table {
    min-width: 760px;
}

.monthly-review-table-wrap:not(.large) .monthly-review-table {
    min-width: 0;
}

.monthly-review-table th,
.monthly-review-table td {
    padding: 7px 9px;
    white-space: nowrap;
}

.sizing-review-table {
    min-width: 840px;
}

.monthly-review-bars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.monthly-review-sector-bar {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.monthly-review-sector-bar:hover .monthly-review-sector-bar-top span {
    color: #2563eb;
}

.monthly-review-sector-bar-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
}

.monthly-review-sector-track {
    height: 7px;
    margin-top: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.monthly-review-sector-fill {
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}

.monthly-review-sector-fill.positive {
    background: #22c55e;
}

.monthly-review-sector-fill.negative {
    background: #ef4444;
}

.monthly-review-sector-fill.neutral {
    background: #94a3b8;
}

.monthly-review-sector-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 600;
}

.monthly-review-sector-modal {
    max-width: 860px;
}

.monthly-review-modal-meta {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.monthly-review-breakdown-table {
    min-width: 720px;
}

.monthly-review-breakdown-table tfoot td {
    border-top: 1px solid #dbe3ef;
    background: #f8fafc;
    font-weight: 800;
}

.monthly-review-sector-return-link {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-bottom: 1px dotted currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
}

.monthly-review-sector-return-link.positive {
    color: #16a34a;
}

.monthly-review-sector-return-link.negative {
    color: #dc2626;
}

.monthly-review-sector-return-link.neutral {
    color: #64748b;
}

.monthly-review-sector-return-link:hover {
    color: #2563eb;
}

.monthly-review-sector-return-modal {
    max-width: 980px;
}

.monthly-review-return-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.monthly-review-return-summary > div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
}

.monthly-review-return-summary span {
    display: block;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.monthly-review-return-summary strong {
    display: block;
    margin-top: 3px;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 800;
}

.monthly-review-return-formula {
    margin-bottom: 10px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.monthly-review-return-breakdown-table {
    min-width: 860px;
}

.monthly-review-return-breakdown-table tfoot td {
    border-top: 1px solid #dbe3ef;
    background: #f8fafc;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .monthly-review-grid,
    .monthly-review-kpis {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .monthly-review-toolbar,
    .monthly-review-controls,
    .monthly-review-sector-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .monthly-review-controls select,
    .mini-refresh-btn {
        width: 100%;
    }

    .monthly-review-grid,
    .monthly-review-kpis {
        grid-template-columns: 1fr;
    }

    .monthly-review-return-summary {
        grid-template-columns: 1fr 1fr;
    }
}

/* History tab type badges */
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.positive {
    background: #dcfce7;
    color: #16a34a;
}

.type-badge.negative {
    background: #fee2e2;
    color: #dc2626;
}

.type-badge.neutral {
    background: #f1f5f9;
    color: #64748b;
}

.type-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

/* V2 Responsive */
@media (max-width: 1200px) {
    .header-v2 {
        flex-wrap: wrap;
    }

    .header-stats-compact {
        order: 3;
        flex-basis: 100%;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
    }
}

@media (max-width: 768px) {
    .header-stats-compact {
        flex-direction: column;
        gap: 12px;
    }

    .header-stat-group {
        flex-wrap: wrap;
    }

    .tabs-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }

    .tabs-bar {
        overflow-x: auto;
    }

    .tab-filters {
        justify-content: flex-end;
    }

    .submission-detail-bbb-header {
        flex-direction: column;
    }

    .submission-detail-bbb-summary {
        justify-content: flex-start;
    }

}

/* =============================================================================
   PEER REVIEW TAB
   ============================================================================= */

.review-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

.review-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-card {
    position: relative;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 40px 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.review-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.review-card.reviewed {
    opacity: 0.55;
    border-left: 3px solid #22c55e;
    cursor: default;
}

.review-card.dismissed {
    opacity: 0.62;
    border-left: 3px solid #94a3b8;
}

.review-card.self-blocked {
    opacity: 0.72;
    border-left: 3px solid #94a3b8;
}

.review-card.self-blocked:hover {
    box-shadow: none;
}

.review-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    line-height: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.review-dismiss-btn:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.review-dismiss-btn:focus-visible {
    outline: 2px solid #fca5a5;
    outline-offset: 1px;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.review-card-ticker {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.review-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.review-own-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.review-card-idea {
    font-size: 0.78rem;
    color: #334155;
    line-height: 1.5;
    margin: 4px 0;
}

.review-card-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #475569;
}

.review-card.expanded .review-card-details {
    display: block;
}

.review-comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    align-items: stretch;
}

.review-comment-top {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.review-comment-bps {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-comment-bps label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.review-comment-bps input {
    height: 34px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: inherit;
}

.review-comment-bps input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.review-model-hint {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.35;
    color: #64748b;
}

.review-model-hint strong {
    color: #334155;
    font-weight: 700;
}

.review-comment-top .review-model-hint {
    flex: 1 1 220px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    display: flex;
    align-items: center;
}

.review-comment-form textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: inherit;
    resize: none;
    min-height: 54px;
}

.review-comment-form textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.review-comment-form button {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.review-comment-form button:hover {
    background: #2563eb;
}

.review-card-existing-review {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #166534;
    line-height: 1.4;
}

.review-card-existing-review strong {
    color: #15803d;
}

.review-card-self-note {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.35;
}

.review-card-dismissed-note {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.4;
}

/* Ideas audit modal: humanized sizing snapshot + collapsible raw lineage */
.audit-event-summary {
    margin-bottom: 12px;
}

.audit-raw-lineage {
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.audit-raw-lineage summary {
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.audit-raw-lineage h4 {
    margin: 10px 0 4px;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-raw-lineage pre {
    max-height: 240px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.66rem;
    line-height: 1.4;
}
