/* ===================================================================
   BALANCE SHEET TRENDS — 5-View Tabbed Architecture
   Reuses plt-* utility classes from keyPLTrends.css for shared elements
   (metric cards, chart cards, tabs, insights, comparison table).
   This file only contains BS-specific styles.
   =================================================================== */

.bs-trends-module {
    font-family: var(--liq-font-body);
    background: var(--liq-bg);
    padding: 0;
}

/* ===================================================================
   HEADER
   =================================================================== */

.bs-trends-header {
    background: linear-gradient(to bottom, #FFFFFF 0%, #FAFAF9 100%);
    border-bottom: 1px solid var(--liq-border);
    padding: 1.5rem 1.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bs-trends-title-section h2 {
    font-family: var(--liq-font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--liq-text);
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.03em;
}

.bs-trends-period {
    font-size: 0.875rem;
    color: var(--liq-text-secondary);
    font-family: var(--liq-font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bs-trends-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===================================================================
   HERO — Assets Headline
   =================================================================== */

.bs-trends-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 60%, #283548 100%);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin: 1.25rem 1.75rem 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.bs-trends-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 40%;
    height: 180%;
    background: radial-gradient(ellipse at 80% 20%, rgba(30, 64, 175, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.bs-trends-hero-main { position: relative; z-index: 1; }

.bs-trends-hero-label {
    font-family: var(--liq-font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.bs-trends-hero-value {
    font-family: var(--liq-font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.bs-trends-hero-context {
    font-family: var(--liq-font-body);
    font-size: 0.875rem;
    opacity: 0.7;
    line-height: 1.5;
}

.bs-trends-hero-context strong { opacity: 1; color: #93C5FD; }

.bs-trends-hero-visual {
    position: relative;
    z-index: 1;
    min-width: 120px;
}

.bs-trends-hero-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.bs-trends-hero-bar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.bs-trends-hero-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bs-trends-hero-bar-dot.assets { background: #60A5FA; }
.bs-trends-hero-bar-dot.liabilities { background: #F87171; }
.bs-trends-hero-bar-dot.equity { background: #6EE7B7; }

.bs-trends-hero-bar-amount {
    font-family: var(--liq-font-mono);
    font-weight: 600;
    font-size: 0.8125rem;
}

/* ===================================================================
   FISCAL NOTE
   =================================================================== */

.bs-trends-fiscal-note {
    text-align: center;
    padding: 0 1.75rem 1.5rem;
    font-family: var(--liq-font-body);
    font-size: 0.75rem;
    color: var(--liq-text-muted);
    font-style: italic;
    line-height: 1.5;
}

/* ===================================================================
   MOVEMENTS VIEW — Transaction-Level Analysis
   =================================================================== */

.bst-movers-section {
    margin: 1.25rem 1.75rem 0;
    background: #FFFFFF;
    border: 1px solid var(--liq-border);
    border-radius: 12px;
    overflow: hidden;
}

.bst-movers-section > .plt-chart-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--liq-border);
}

.bst-movers-table {
    max-height: 600px;
    overflow-y: auto;
}

.bst-mover-row {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.bst-mover-row:last-child { border-bottom: none; }

.bst-mover-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.bst-mover-header:hover { background: rgba(0,0,0,0.02); }

.bst-mover-expand-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--liq-text-muted);
    transition: transform 0.2s;
}

.bst-mover-expand-icon.open { transform: rotate(90deg); }

.bst-mover-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--liq-text-secondary);
    font-family: var(--liq-font-mono);
}

.bst-mover-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bst-mover-account {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--liq-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bst-mover-type {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.bst-mover-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.bst-mover-net {
    font-family: var(--liq-font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
}

.bst-mover-net.positive { color: #16A34A; }
.bst-mover-net.negative { color: #DC2626; }

.bst-mover-count {
    font-size: 0.6875rem;
    color: var(--liq-text-muted);
    font-family: var(--liq-font-mono);
}

.bst-mover-detail {
    background: #FAFAF9;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.75rem 1.25rem 1rem;
    animation: bstSlideDown 0.2s ease-out;
}

@keyframes bstSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bst-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--liq-text-secondary);
}

.bst-detail-stats strong {
    color: var(--liq-text);
    font-family: var(--liq-font-mono);
}

.bst-detail-more {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--liq-text-muted);
    font-style: italic;
}

/* Transaction tables (shared between movers + significant) */
.bst-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.bst-tx-table thead th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    font-weight: 600;
    color: var(--liq-text-secondary);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 1;
}

.bst-tx-table thead th.num { text-align: right; }

.bst-tx-table tbody td {
    padding: 0.35rem 0.5rem;
    color: var(--liq-text);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    font-family: var(--liq-font-body);
    vertical-align: top;
}

.bst-tx-table tbody td.num {
    text-align: right;
    font-family: var(--liq-font-mono);
    font-size: 0.6875rem;
    white-space: nowrap;
}

.bst-tx-table tbody tr:hover { background: rgba(59, 130, 246, 0.04); }

/* Anomaly styling */
.bst-anomaly-row {
    background: rgba(239, 68, 68, 0.04) !important;
}

.bst-anomaly-row:hover { background: rgba(239, 68, 68, 0.08) !important; }

.bst-anomaly-badge {
    display: inline-block;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #FEE2E2;
    color: #DC2626;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.bst-anomaly-multiple {
    font-weight: 700;
    color: #DC2626;
    font-family: var(--liq-font-mono);
}

.bst-anomaly-section {
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.bst-anomaly-section .plt-chart-title svg {
    vertical-align: middle;
}

/* Significant transactions wrapper */
.bst-sig-table-wrap {
    max-height: 500px;
    overflow-y: auto;
    padding: 0 0.25rem;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 768px) {
    .bs-trends-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    .bs-trends-hero {
        margin: 1rem;
        padding: 1.25rem;
        flex-direction: column;
        gap: 1rem;
    }
    .bs-trends-hero-value { font-size: 2rem; }
    .bst-movers-section { margin: 1rem; }
    .bst-mover-name { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
    .bst-mover-stats { flex-direction: column; align-items: flex-end; gap: 0.15rem; }
    .bst-sig-table-wrap { overflow-x: auto; }
    .bst-detail-stats { flex-direction: column; gap: 0.25rem; }
}

/* ===================================================================
   PRINT
   =================================================================== */

@media print {
    .bs-trends-module { background: white; }
    .bs-trends-hero {
        background: #1E293B;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
