/* ── Costs (version D) ──────────────────────────────────────────────────────
   A strip of the four headline figures, the tools as a table (not a wall of
   uneven cards), then the views as tabs over shared tables (table.css).
   Money always carries its currency code (lib/money.js, DESIGN.md §3). */

#tab-costs > .strip, #tab-costs > .dt-head { margin-top: 0; }
/* Adding a vendor, editing a price and the cost settings are Administration
   only, as the server enforces (PRICING-DOCS, 2026-10-15; /api/costs/config,
   2026-10-16); IT and Management never see the way in, and a note says why. */
body:not([data-role="administration"]) #addVendorBtn,
body:not([data-role="administration"]) [data-empty-action="add-vendor"] { display: none !important; }
body:not([data-role="administration"]) [data-tool-edit],
body:not([data-role="administration"]) #adminConfigSave { display: none !important; }
.admin-readonly-note { display: none; }
body:not([data-role="administration"]) .admin-readonly-note { display: block; }
.settings-card .admin-readonly-note { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
#tab-costs .notice { margin-bottom: var(--sp-3); }
.costs-onboarding { margin-bottom: var(--sp-3); }
.costs-onboarding[hidden], #costsError[hidden], #costsTrendEmptyState[hidden] { display: none; }
#costsError { margin-bottom: var(--sp-3); padding: 0; }
.costs-tools-wrap { max-height: 360px; margin-bottom: var(--sp-5); }
.tier-chip { display: inline-flex; padding: 0 6px; border-radius: var(--radius-xs); font-size: var(--fs-12); line-height: 18px; color: var(--text-2); background: var(--sunken); }
.cost-flag { font-size: var(--fs-12); font-weight: 600; color: var(--warn); }
.cost-waste-num { color: var(--warn); font-weight: 600; }

/* Tabs on the left, actions on the right of the same underline row; the
   feed-status menu drops out of it. */
.costs-subtab-row { flex-wrap: wrap; overflow: visible; }
.costs-actions { margin-left: auto; }
.costs-status-note { font-size: var(--fs-12); color: var(--text-3); }
.costs-status-note:empty { display: none; }
.feed-status-wrap { position: relative; }
.feed-status-dot:not(.mk) { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
/* One row per feed: its shape mark, name, note, last good delivery. */
.feed-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border-sub); }
.feed-row:last-child { border-bottom: 0; }
.feed-row > .mk { margin-top: 5px; }
.feed-row-main { flex: 1; min-width: 0; }
.feed-row-name { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.feed-row-kind { font-weight: 400; font-size: var(--fs-12); color: var(--text-3); }
.feed-row-note { font-size: var(--fs-12); color: var(--text-3); }
.feed-row-when { font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-empty { margin: 0; padding: 10px 12px; font-size: var(--fs-12); color: var(--text-3); }
.feed-status-menu {
    display: none;
    position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-menu);
    min-width: 340px; max-height: 420px; overflow-y: auto;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow-2);
}
.feed-status-menu.open { display: block; animation: menu-in var(--dur-enter) var(--ease-out); }

.costs-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.costs-filter-row .control { width: auto; min-height: 32px; font-size: var(--fs-13); }
.costs-filter-row input.control { flex: 1 1 200px; max-width: 320px; }

/* Totals row under People and Divisions. */
.dt tfoot th, .dt tfoot td {
    height: var(--row-h);
    padding: 0 10px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
}
.dt tfoot th:first-child { padding-left: 14px; }
.dt tfoot td.dt-num { text-align: right; font-variant-numeric: tabular-nums; }
.dt tfoot td:last-child { padding-right: 14px; }
.dt tfoot[hidden] { display: none; }

.costs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 0; font-size: var(--fs-12); color: var(--text-3); }
.costs-foot[hidden] { display: none; }
.costs-month { margin-top: var(--sp-3); }
.costs-month[hidden] { display: none; }
.costs-month-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.costs-month-head .section-title { margin: 0; }
.costs-month-head .icon-btn { margin-left: auto; }
#costsSubpanel-savings .strip { margin-bottom: var(--sp-3); }
#costsSubpanel-savings .sec-charts-row { grid-template-columns: minmax(0, 1fr); }
#costsSubpanel-trend .sec-chart-card .chart-canvas, #costsSubpanel-savings .sec-chart-card .chart-canvas { height: 200px; }
