/* profitAndLoss.css */

.profit-loss-report-wrapper {
    font-family: var(--font-serif-report); /* Defined in dashboardStyles.css or root */
    font-size: 11pt;
    line-height: 1.4;
    color: #000;
    padding: 20px;
    border: 1px solid #ccc;
    background-color: #fff;
    max-width: 1200px; /* Maximum width for readability */
    margin: 0 auto; /* Center the content */
}

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

.profit-loss-report-wrapper .report-subtitle {
    font-size: 10pt;
    text-align: center;
    margin-bottom: 25px;
    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: 10px;
    white-space: nowrap;
}
.profit-loss-report-wrapper .pl-table td.amount-column {
    width: 15%;
    text-align: right;
    padding-right: 10px;
}

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

.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 #000; /* 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: 8px;
    padding-bottom: 8px;
}

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

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

.pnl-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
}
.pnl-comparison-select {
    padding: 5px 10px;
    border: 1px solid #d0cbc5;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: #faf8f5;
    cursor: pointer;
    color: #1a1a1a;
}
.pnl-comparison-select:focus { outline: none; border-color: #5b6eae; }

/* Collapsible section headings */
.pl-collapsible {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.pl-collapsible:hover { background: #faf8f5; }
.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: 6px 10px;
    text-align: right;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #717e96;
    border-bottom: 2px solid #d0cbc5;
    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: #1a1a1a; }

.pnl-change-positive { color: #38a169; }
.pnl-change-negative { color: #c53030; }

/* 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: #faf8f5; }

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