/* profitAndLoss.css */

.profit-loss-report-wrapper {
    font-family: var(--liq-font-display);
    font-size: 11pt;
    line-height: 1.4;
    color: var(--liq-text);
    padding: 12px;
    border: 1px solid var(--liq-border);
    background-color: var(--liq-surface);
    max-width: 1200px; /* Maximum width for readability */
    margin: 0 auto; /* Center the content */
}

.profit-loss-report-wrapper .report-title { /* Qualify with wrapper */
    font-size: 14pt;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

.profit-loss-report-wrapper .report-subtitle {
    font-size: 10pt;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

.profit-loss-report-wrapper .pl-table {
    width: 100%;
    border-collapse: collapse;
}

.profit-loss-report-wrapper .pl-table td {
    padding: 3px 2px; /* Tighter padding */
    border: none; /* No internal cell borders */
    vertical-align: top;
}

.profit-loss-report-wrapper .pl-table td.description-column {
    width: 65%;
}
.profit-loss-report-wrapper .pl-table td.label-column { /* For right-aligned total labels */
    width: 20%;
    text-align: right;
    font-weight: bold;
    padding-right: 8px;
    white-space: nowrap;
}
.profit-loss-report-wrapper .pl-table td.amount-column {
    width: 15%;
    text-align: right;
    padding-right: 8px;
}

.profit-loss-report-wrapper .pl-section-heading {
    font-weight: bold;
    font-size: 11pt; /* Consistent with body of report */
    padding-top: 8px;
    padding-bottom: 3px;
}

.profit-loss-report-wrapper .pl-account-item {
    padding-left: 25px !important; /* Indentation */
}

.profit-loss-report-wrapper .pl-total-line td.amount-column {
    font-weight: bold;
    border-bottom: 1px solid var(--liq-text); /* Underline for the amount */
    padding-bottom: 1px;
}

.profit-loss-report-wrapper .pl-gross-profit-row td {
    font-weight: bold;
}
.profit-loss-report-wrapper .pl-gross-profit-row.whitespace-row td { /* For spacing */
    padding-top: 5px;
    padding-bottom: 5px;
}

.profit-loss-report-wrapper .pl-net-income-line td {
    font-weight: bold;
    border-top: 1px solid var(--liq-text);
    padding-top: 4px;
    border-bottom: 2.5px double var(--liq-text);
    padding-bottom: 4px;
}

/* === Interactive P&L Enhancements === */

.pnl-controls {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
    padding: 0 2px;
}
.pnl-comparison-select {
    padding: 5px 10px;
    border: 1px solid var(--liq-border);
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--liq-font-body);
    background: var(--liq-bg);
    cursor: pointer;
    color: var(--liq-text);
}
.pnl-comparison-select:focus { outline: none; border-color: var(--liq-accent); }

/* Collapsible section headings */
.pl-collapsible {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.pl-collapsible:hover { background: var(--liq-bg); }
.pl-chevron {
    display: inline-block;
    font-size: 10px;
    margin-right: 6px;
    transition: transform 0.2s ease;
}
.pl-chevron.collapsed { transform: rotate(-90deg); }

/* Comparison columns */
.profit-loss-report-wrapper .pl-table th {
    padding: 4px 8px;
    text-align: right;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #717e96;
    border-bottom: 2px solid var(--liq-border);
    white-space: nowrap;
}
.profit-loss-report-wrapper .pl-table th.description-column { text-align: left; }
.profit-loss-report-wrapper .pl-table th.sortable-header:hover { color: var(--liq-text); }

.pnl-change-positive { color: var(--liq-profit); }
.pnl-change-negative { color: var(--liq-loss); }
.pnl-change-new { color: var(--liq-accent); font-style: italic; }

/* Sparkline cells */
.pl-sparkline-cell {
    width: 70px;
    min-width: 70px;
    padding: 2px 4px !important;
    vertical-align: middle;
}

/* Account rows hover */
.pl-account-row:hover td { background: var(--liq-bg); }

/* Interactive table adjustments */
.pl-interactive td.description-column { width: auto; }
.pl-interactive td.amount-column { white-space: nowrap; }