/* Fastpost Management Hub — app additions.
   Load order in _Layout.cshtml: modernist.css, fastpost-hub.css, then this file.
   Only things the design handoff does not cover live here. */

/* Local system fonts only. The design specifies Archivo, but no external font may be loaded. */
:root {
  --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: var(--font-heading);
}

/* Narrow screens: when the rail stacks above the page, don't stretch its row to fill the screen height. */
.hub-shell { align-content: flex-start; }

/* Segmented control built from links instead of radios (used for the 30/60-day switch, no JS). */
.seg a.seg-opt { color: var(--color-text); text-decoration: none; }
.seg a.seg-opt[aria-current="page"] { background: var(--color-accent); color: var(--color-bg); }
.seg a.seg-opt:not([aria-current="page"]):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt.seg-period { min-width: 84px; }
.seg-opt.seg-wide { min-width: 110px; }
.seg-wrap { flex-wrap: wrap; }

/* A label for a group of radios (the design uses .field > label for single inputs). */
.field > .field-label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.label-optional { color: var(--color-neutral-600); }
select.input { appearance: auto; }

/* Server-side validation summary (ModelOnly). */
.validation-summary-errors { color: var(--color-accent-700); font-size: 14px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }

/* Page action buttons that are forms (e.g. Generate upcoming expenses). */
.page-actions form { margin: 0; display: inline-flex; }

/* Read-only record details (Details and Delete pages — not in the handoff). */
.detail-list {
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr; margin: 0;
  border-top: var(--hub-rule-strong);
}
.detail-list dt, .detail-list dd { margin: 0; padding: 12px 8px; border-bottom: var(--hub-rule); font-size: 14px; }
.detail-list dt { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hub-muted); }
.detail-list dd { font-variant-numeric: tabular-nums; }
.detail-list .pre-line { white-space: pre-line; }
@media (max-width: 560px) {
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { border-bottom: 0; padding-bottom: 0; }
}

/* Minimum table widths from the handoff (tables scroll inside .table-wrap below these). */
.table.ledger { min-width: 620px; }
.table.table-list { min-width: 980px; }
.table.table-rules { min-width: 900px; }
.table th.col-num { text-align: right; }
.table .col-date { white-space: nowrap; }
.cell-stack a { color: inherit; }
.cell-title { display: inline-flex; align-items: center; gap: 6px; }
.type-cell { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hub-muted); white-space: nowrap; }
tr.is-paused { color: var(--hub-muted); }
.amount-out { font-weight: 400; }

/* Forecast: starting cash entry, collapsed by default. */
.starting-cash { border-top: var(--hub-rule-strong); border-bottom: var(--hub-rule); }
.starting-cash > summary {
  cursor: pointer; padding: 14px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  list-style: none;
}
.starting-cash > summary::-webkit-details-marker { display: none; }
.starting-cash > summary .section-title::before { content: "+ "; color: var(--color-accent-700); }
.starting-cash[open] > summary .section-title::before { content: "− "; }
.starting-cash-body { display: flex; flex-direction: column; gap: 20px; padding: 4px 0 24px; max-width: 800px; }
.section-sub { font-size: 13px; color: var(--hub-muted); }

/* Balance chart (Dashboard): pieces the handoff drew with inline styles. */
.fc-tick { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.fc-low-mark { position: absolute; display: flex; align-items: center; gap: 6px; transform: translate(-4px, -4px); pointer-events: none; }
.fc-low-mark.is-left { flex-direction: row-reverse; transform: translate(calc(-100% + 4px), -4px); }
.fc-low-dot { width: 8px; height: 8px; background: var(--color-accent-700); flex: none; }
.fc-low-label { font-size: 12px; font-weight: 600; color: var(--color-accent-800); white-space: nowrap; background: var(--color-bg); padding: 0 4px; }
.db-mark.is-lower span { top: 12px; }
.fc-cols { position: absolute; inset: 0; display: flex; }
.fc-cols > span { flex: 1; min-width: 0; }
.fc-cols > span:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.db-payroll .text-muted { font-size: 14px; }

/* Recurring expense details: upcoming dates list. */
.occurrence-list { display: flex; flex-direction: column; max-width: 520px; border-bottom: var(--hub-rule); }
.occurrence-amount { font-weight: 600; }

/* Sign-in page (_AuthLayout): a single centered panel, no navigation. */
.auth-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 48px; }
.auth-panel { width: min(420px, 100%); display: flex; flex-direction: column; gap: 28px; }
.auth-error {
  padding: 12px 14px; font-size: 14px; font-weight: 600;
  background: var(--color-accent-100); border: 1px solid var(--color-accent-300); color: var(--color-accent-800);
}

/* Audit history: keep line breaks in descriptions and filter fields side by side. */
.pre-line { white-space: pre-line; }
.list-toolbar .field { margin: 0; }
