/* ============ Historical P&L (historical-pnl.js) ============ */

/* Add Previous Month sheet */
.hp-intro { margin: 2px 0 10px; font-size: 0.85em; color: var(--muted); }
.hp-q { font-weight: 700; font-size: 0.95em; color: var(--text); margin: 4px 0 8px; }
.view-toggle.hp-kind { display: flex; margin: 0 0 4px; }
.view-toggle.hp-kind button { flex: 1; }
.hp-dup, .hp-warn, .hp-error {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 0.85em; line-height: 1.4;
}
.hp-dup { background: var(--lavender-wash); color: var(--text); }
.hp-dup .link-btn { display: block; margin-top: 4px; color: var(--plum); font-weight: 700; font-size: 1em; }
.hp-warn { background: var(--warning-soft); color: var(--gold); font-weight: 500; }
.hp-error { background: var(--expense-soft); color: var(--red); }
.hp-preview {
  margin-top: 16px; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
}
.hp-glance { font-size: 0.78em; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.hp-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 0.9em; color: var(--text-soft); }
.hp-line small { color: var(--muted); font-size: 0.85em; }
.hp-line b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp-line.strong { font-weight: 700; color: var(--text); border-top: 1px solid var(--divider); margin-top: 4px; padding-top: 8px; }
.hp-line.strong:first-child { border-top: none; margin-top: 0; padding-top: 5px; }
.hp-line.strong b { color: var(--brand-ink); }
.hp-line b.neg { color: var(--red); }
.hp-note { font-size: 0.78em; color: var(--muted); margin-top: 4px; }
.hp-save.warn { background: var(--gold); color: #fff; }
.hp-delete { background: none; color: var(--red); font-size: 0.9em; margin-top: 10px; }

/* P&L page: tip, setup costs line, actions */
.hp-tip {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px 14px;
  border-radius: 16px; background: var(--lavender-wash); border: 1px solid var(--border);
  font-size: 0.88em; color: var(--text-soft); line-height: 1.4;
}
.hp-tip[hidden] { display: none; }
.hp-tip-text { flex: 1; min-width: 0; }
.hp-tip-text b { display: block; color: var(--text); }
.hp-tip-text .link-btn { margin-top: 6px; color: var(--plum); font-weight: 700; font-size: 1em; }
.hp-tip-close { width: auto; margin: 0; padding: 2px 6px; background: none; color: var(--muted); font-size: 0.95em; }
.hp-setup-line {
  margin: -6px 0 14px; padding: 0 4px; font-size: 0.85em; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px;
}
.hp-setup-line b { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.hp-setup-line[hidden] { display: none; }
.hp-actions { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.hp-actions .hp-add-btn { flex: 1; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.hp-actions .hp-add-btn svg { width: 16px; height: 16px; }
.hp-actions .link-btn { flex-shrink: 0; color: var(--plum); font-weight: 600; }
.pl-row .hp-tag, .hp-item .hp-tag {
  display: inline-block; font-size: 0.72em; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--lavender-wash); color: var(--plum); vertical-align: 1px;
}
.pc-line.hp-setup .lbl, .pc-line.hp-setup .pc-fig { color: var(--muted); }

/* Previous months screen */
.hp-screen-intro { font-size: 0.88em; color: var(--muted); margin: -4px 2px 14px; line-height: 1.4; }
.hp-month { margin-bottom: 16px; }
.hp-month h3 { margin: 0 2px 8px; font-size: 1em; font-weight: 800; color: var(--text); }
.hp-item {
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-float-sm);
}
.hp-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hp-item-head b { color: var(--text); }
.hp-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 0.84em; margin-bottom: 8px; }
.hp-figs span { display: block; color: var(--muted); font-size: 0.9em; }
.hp-figs b { color: var(--text); font-variant-numeric: tabular-nums; }
.hp-item .row-actions { justify-content: flex-end; }
.hp-actions .link-btn[hidden] { display: none; }
