/* Transactions, tasks, sources, settings, and global drag-and-drop. */

/* drag a file anywhere */
body.dragging::after {
  content: 'Drop to upload — Quotient will read it and show what changes';
  position: fixed; inset: 12px; z-index: 120; display: grid; place-items: center;
  border: 2px dashed var(--brand-2); border-radius: 20px; background: rgba(233, 242, 236, .86);
  font-size: 16px; font-weight: 600; color: var(--brand); pointer-events: none;
}

.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 9px; color: var(--muted); width: 14px; height: 14px; }
.search .input { padding-left: 28px; width: 240px; }
.gap8 { gap: 8px; }

/* transactions */
.tx-table td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.tx-pick .select { max-width: 300px; }
.tx-why { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.tx-why .pill { flex: none; height: 20px; font-size: 11px; }

/* tasks */
.task-group { margin-bottom: 26px; }
.task-group h3 { font-size: 14px; }
.task-list { overflow: hidden; }
.task-row { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.task-row:last-child { border-bottom: 0; }
.task-title { font-weight: 500; font-size: 14px; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); flex: none; margin-top: 1px;
  display: grid; place-items: center; color: #fff; transition: all .12s;
}
.task-check:hover { border-color: var(--brand-2); background: var(--brand-tint); }
.task-row.done .task-check { background: var(--brand-2); border-color: var(--brand-2); }
details.resolved { margin-top: 18px; }
details.resolved summary { cursor: pointer; }

/* sources */
.doc-row { cursor: pointer; }
.file-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.acct-row:last-child { border-bottom: 0; }
.bank-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.bank-ico.broken { background: var(--amber-tint); color: var(--amber); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.src-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.src-group .eyebrow + .src-row { border-top: 0; }
.hb-brand { padding: 10px 12px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: 13px; }

/* settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-grid .audit { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 14px 0 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.audit-list { max-height: 420px; overflow: auto; padding: 8px 0; }
.audit-row { display: flex; gap: 14px; align-items: baseline; padding: 9px 20px; font-size: 13px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row .who { width: 140px; flex: none; color: var(--ink-2); font-weight: 500; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }

/* reserve policy */
.rsv { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.rsv-opts { display: flex; flex-direction: column; gap: 8px; }
.rsv-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.rsv-opt:hover { border-color: var(--line-2); }
.rsv-opt.on { border-color: var(--brand-2); background: var(--brand-tint); }
.rsv-opt input[type=radio] { accent-color: var(--brand); margin-top: 3px; }
.rsv-why { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.rsv-math { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rsv-total { border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 2px; font-weight: 600; }
.rsv-rec { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); font-size: 12.5px; line-height: 1.45; }
.rsv-rec .ico { flex: none; margin-top: 2px; }
.rsv-card { grid-column: 1 / -1; }
@media (max-width: 1100px) { .rsv { grid-template-columns: 1fr; } }

/* forecast confidence */
.cf-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cf-card { padding: 18px 20px; }
.cf-big { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cf-big.green { color: var(--green); } .cf-big.yellow { color: var(--amber); } .cf-big.red { color: var(--red); }
.cf-mix { display: flex; gap: 2px; border-radius: 4px; overflow: hidden; background: var(--sunken); }
.cf-mix span { display: block; height: 100%; }
.cf-mixrows { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-size: 12.5px; }
.cf-mixrows > div { display: flex; align-items: center; gap: 8px; }
.cf-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); font-size: 12.5px; color: var(--ink-2); }
.cf-note .ico { flex: none; margin-top: 1px; }
.cf-potential { background: linear-gradient(180deg, var(--brand-tint), var(--surface) 80%); border-color: var(--brand-tint-2); }

.cf-months { display: flex; gap: 14px; align-items: stretch; }
.cf-year { width: 120px; flex: none; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); }
.cf-year.on { border-color: var(--brand-2); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand-2); }
.cf-yl { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.cf-ys { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.cf-ys.green, .cf-score.green { color: var(--green); } .cf-ys.yellow, .cf-score.yellow { color: var(--amber); } .cf-ys.red, .cf-score.red { color: var(--red); }
.cf-cols { flex: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 170px; }
.cf-col { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 4px; padding: 6px 4px 4px; border-radius: 10px; border: 1px solid transparent; min-width: 0; }
.cf-col:not(:disabled):hover { background: var(--surface-2); border-color: var(--line); }
.cf-col.on { background: var(--brand-tint); border-color: var(--brand-2); }
.cf-col:disabled { cursor: default; opacity: .7; }
.cf-score { font-size: 12.5px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; min-height: 16px; }
.cf-stack { display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 2px 2px; overflow: hidden; min-height: 4px; }
.cf-stack i { display: block; min-height: 2px; }
.cf-ml { font-size: 11.5px; color: var(--muted); text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.cf-ml b { font-size: 9.5px; font-weight: 600; color: var(--brand-2); text-transform: uppercase; letter-spacing: .06em; }
.cf-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.cf-legend span { display: inline-flex; align-items: center; gap: 6px; }

.cf-whatif { display: flex; align-items: center; gap: 10px; min-height: 52px; box-sizing: border-box; padding: 8px 14px; margin-bottom: 10px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--bg); font-size: 13px; position: sticky; top: 8px; z-index: 5; box-shadow: 0 -10px 0 var(--bg); }
.cf-whatif.on { border-style: solid; border-color: var(--brand-2); background: var(--brand-tint); color: var(--brand); }
.cf-actions { overflow: hidden; }
.cf-act { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cf-act:last-child { border-bottom: 0; }
.cf-pick { padding-top: 2px; } .cf-pick input { accent-color: var(--brand); width: 15px; height: 15px; }
.cf-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); flex: none; }
.cf-title { font-weight: 500; font-size: 14px; }
.cf-impact { width: 140px; text-align: right; flex: none; color: var(--brand-2); }
.cf-impact strong { font-size: 16px; }
.cf-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; width: 190px; }
.cf-how { margin-top: 20px; }
.cf-how summary { cursor: pointer; }
@media (max-width: 1200px) { .cf-summary { grid-template-columns: 1fr 1fr; } .cf-potential { grid-column: 1 / -1; } .cf-btns { width: auto; } }

/* supporting items vs the plan */
.fit-panel, .over-banner { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--amber); background: var(--amber-tint); color: var(--ink); }
.fit-panel > .row > .ico, .over-banner > .ico { color: var(--amber); flex: none; margin-top: 1px; }
.over-banner { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
.fit-months { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-2, var(--muted)); font-variant-numeric: tabular-nums; }
.fit-months em { font-style: normal; color: var(--amber); font-weight: 600; }
.card > .over-banner { margin: 14px 20px 0; }

/* confidence, design pass Nov 16 */
.cf-card .label.row { display: flex; color: var(--ink-2); }
.cf-big { font-size: 30px; }
.cf-potential { background: #F1F7F3; border-color: #CFE3D6; }
.cf-strip { margin-top: 16px; padding: 14px 20px; display: flex; gap: 18px; align-items: flex-end; }
.cf-strip-l { width: 128px; flex: none; display: flex; flex-direction: column; gap: 2px; align-self: center; }
.cf-strip-l .info { margin-top: 4px; }
.cf-strip .cf-months { flex: 1; gap: 8px; }
.cf-strip .cf-year { width: 84px; padding: 8px 10px; border-radius: 10px; }
.cf-strip .cf-ys { font-size: 20px; }
.cf-strip .cf-year .xs { display: none; }
.cf-strip .cf-cols { height: 92px; gap: 6px; }
.cf-strip .cf-col { padding: 3px 3px 2px; border-radius: 8px; }
.cf-strip .cf-score { font-size: 11.5px; min-height: 14px; }
.cf-strip .cf-ml { font-size: 11px; }
.cf-strip + .cf-legend, .cf-legend { display: none; }
.cf-whatif:not(.on) { display: none; }
.cf-act.rl-row { align-items: center; padding: 10px 16px; border-bottom: 0; }
.cf-rk { width: 22px; height: 22px; position: relative; flex: none; }
.cf-rk .nb { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); border-radius: 6px; background: var(--sunken); transition: opacity .15s; }
.cf-rk input { position: absolute; inset: 3px; margin: 0; width: 16px; height: 16px; opacity: 0; transition: opacity .15s; accent-color: var(--brand); }
.cf-act:hover .cf-rk .nb, .cf-rk:has(input:checked) .nb { opacity: 0; }
.cf-act:hover .cf-rk input, .cf-rk input:checked, .cf-rk input:focus-visible { opacity: 1; }
.cf-act .rl-title { white-space: normal; }
.cf-impact { width: 120px; }
.cf-impact strong { font-size: 15px; }
.cf-impact .muted { color: var(--muted); }

/* transactions, design pass Nov 16 */
.tx-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 110px 230px 64px 108px; gap: 12px; align-items: center; }
.tx-row .tray { justify-self: end; }
.tx-who { min-width: 0; }
.tx-amt { text-align: right; font-weight: 500; }
.tx-line.select { height: 28px; font-size: 12.5px; }
.tx-mapped { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tx-fold { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #F1F7F3; border-color: #CFE3D6; }
.tx-fold-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; color: var(--brand-2); flex: none; }

/* ---------- reports ---------- */
.rp-wrap { display: flex; gap: 0; min-height: calc(100vh - 60px); margin: -24px -28px -64px; }
.rp-list { width: 210px; flex: none; padding: 18px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.rp-item { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.rp-item:hover { background: var(--sunken); }
.rp-item.on { background: var(--brand-tint); }
.rp-item .rp-name { font-weight: 500; }
.rp-stage { flex: 1; min-width: 0; padding: 28px 32px 64px; background: #EFEEE9; overflow: auto; }
.rp-paper { max-width: 680px; margin: 0 auto; background: #fff; border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 30px rgba(16, 24, 20, .08); padding: 44px 52px; font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 1.6; color: #1C1F22; }
.rp-org { font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rp-title { font-family: inherit; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 4px 0 2px; }
.rp-sub { color: var(--muted); }
.rp-sec h2 { font-family: var(--font); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin: 22px 0 8px; }
.rp-text { border-radius: 6px; margin: 0 -8px; padding: 4px 8px; outline: none; transition: background .15s, box-shadow .15s; }
.rp-text[contenteditable="true"]:hover { background: #FAFAF8; }
.rp-text[contenteditable="true"]:focus { background: #fff; box-shadow: 0 0 0 1.5px var(--brand-2); }
.rp-table { width: 100%; border-collapse: collapse; font-family: var(--font); font-size: 12.5px; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.rp-table th, .rp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.rp-table th { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.rp-table td:first-child, .rp-table th:first-child { text-align: left; }
.rp-table tr.tot td { font-weight: 600; }
.src-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.src-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #EEF0F2; color: #3D4349; font-family: var(--font); font-size: 11.5px; font-weight: 500; text-decoration: none; cursor: pointer; }
.src-chip:hover { background: var(--brand-tint); color: var(--brand-ink); }
@media (max-width: 1240px) {
  .rp-wrap { flex-direction: column; }
  .rp-list { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .rp-list .eyebrow { width: 100%; }
  .rp-stage { padding: 20px 16px 48px; }
  .rp-paper { padding: 28px 24px; }
}
@media print {
  @page { margin: 18mm; }
  body { background: #fff !important; }
  .rail, .chat, .chat-strip, .topbar, .rp-list, .noprint, .toasts, .undo-float { display: none !important; }
  .app { display: block !important; height: auto !important; overflow: visible !important; }
  .main, .page, .page-inner, .rp-wrap, .rp-stage { display: block !important; overflow: visible !important; height: auto !important; padding: 0 !important; margin: 0 !important; background: #fff !important; min-height: 0 !important; }
  .rp-paper { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .rp-text { padding: 0; margin: 0; }
}

/* One-time highlight when a link sends you to a specific card (e.g. Dashboard "cushion" → Confidence) */
.q-flash { position: relative; box-shadow: 0 0 0 2px var(--brand-2, #5BB749), 0 0 0 6px rgba(91, 183, 73, .18); background: #F3F9F4; transition: box-shadow .4s ease, background .4s ease; }
@media (prefers-reduced-motion: reduce) { .q-flash { transition: none; } }

/* Reports list: delete on hover, with an in-page confirmation */
.rp-row { position: relative; display: flex; align-items: center; border-radius: 10px; }
.rp-row .rp-item { flex: 1; min-width: 0; padding-right: 36px; }
.rp-del { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3, #8A8F94); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.rp-row:hover .rp-del, .rp-del:focus-visible { opacity: 1; }
.rp-del:hover { background: #FBEAE6; color: var(--red); }
.rp-confirm { width: 260px; padding: 4px 2px; display: flex; flex-direction: column; gap: 4px; }
.rp-del-yes { background: var(--red); border-color: var(--red); color: #fff; }
.rp-del-yes:hover { filter: brightness(.95); }
