/* 月損益表，以及財務儀表板最上面的「本月損益」。 */

/* 「虛收／實收」切換：兩顆並排的按鈕，現在選的那顆填色。 */
.fin-basis {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}

.fin-basis-btn {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
}

.fin-basis-btn[aria-pressed="true"] {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.fin-basis-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.dash-notice + .dash-notice,
.fin-basis + .dash-notice {
    margin-top: 8px;
}

/* 儀表板的四個數字：營收、進貨、費用、月淨利。 */
.fin-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 8px;
}

@media (max-width: 900px) {
    .fin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.fin-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
}

.fin-kpi-label {
    font-size: 13px;
    color: #6b7280;
}

.fin-kpi strong {
    font-size: 22px;
    color: #111827;
    overflow-wrap: anywhere;
}

.fin-kpi small {
    font-size: 12px;
    color: #6b7280;
}

/* 月淨利是負的：和收支記錄的淨額同一個警示色。 */
.fin-kpi-alert {
    background: #fff5f5;
    border-color: #fecaca;
}

.fin-kpi-alert strong {
    color: #b91c1c;
}

.fin-link {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

/* 財務儀表板「本月營收依通路」：橫條和上面的合計文字之間留一點空間 */
.fin-channel-ranks {
    margin-top: 14px;
}

/* 訂單列表：沒選通路的訂單 */
.order-channel-none {
    color: #9ca3af;
}

/* 月損益表 */
.pnl-scroll {
    overflow-x: auto;
    margin-top: 8px;
}

.pnl-table {
    min-width: 640px;
}

.pnl-table th[scope="row"] {
    text-align: left;
    font-weight: 400;
    background: #ffffff;
}

.pnl-num {
    text-align: right;
    white-space: nowrap;
}

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

/* 主要的幾列（營業收入、費用、其他收入）粗體；毛利、月淨利再加上底色。 */
.pnl-main th[scope="row"],
.pnl-main td {
    font-weight: 600;
}

.pnl-total th[scope="row"],
.pnl-total td {
    font-weight: 700;
    background: #f3f4f6;
}

.pnl-main th[scope="row"] {
    font-weight: 600;
}

/* 各分類的明細列：縮排、字小、顏色淡一點。 */
.pnl-sub th[scope="row"] {
    padding-left: 28px;
    color: #4b5563;
    font-size: 13px;
}

.pnl-sub td {
    color: #4b5563;
    font-size: 13px;
}

.pnl-none {
    color: #6b7280;
}

.pnl-negative td,
.pnl-negative th[scope="row"] {
    color: #b91c1c;
}
