/* Compact personal-finance workspace, aligned with Sigma's dark dashboard. */
.pf-panel { display: grid; gap: 9px; padding: 0 10px 10px; }
.pf-heading-actions, .pf-form-actions, .pf-panel-footer, .pf-section-heading { display: flex; align-items: center; gap: 8px; }
.pf-heading-actions { justify-content: flex-end; flex-wrap: wrap; }
.pf-heading-actions .panel-link { font-size: 9px; white-space: nowrap; }
.pf-inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.pf-inline-field select, .pf-inline-field input { min-height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 10px; }
.pf-content { display: grid; gap: 10px; min-width: 0; }
.pf-empty { display: grid; min-height: 100px; place-items: center; padding: 16px; color: var(--muted); text-align: center; font-size: 11px; }
.pf-feedback { padding: 8px 10px; border: 1px solid rgba(110,227,164,.22); border-radius: 8px; background: rgba(110,227,164,.06); color: #c9ebd5; font-size: 10px; line-height: 1.5; }
.pf-feedback[data-kind="error"] { border-color: rgba(240,128,130,.32); background: rgba(240,128,130,.08); color: #ffd0cf; }
.pf-hint, .pf-muted { color: var(--muted); font-size: 9px; line-height: 1.5; }
.pf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.pf-metric { display: grid; gap: 4px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, rgba(20,33,26,.94), rgba(14,23,18,.92)); }
.pf-metric span { color: var(--muted); font-size: 9px; }
.pf-metric strong { overflow-wrap: anywhere; color: var(--text); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-metric small { color: var(--quiet); font-size: 8px; }
.pf-split { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(240px,.8fr); gap: 9px; }
.pf-subpanel { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,20,16,.56); }
.pf-section-heading { justify-content: space-between; }
.pf-section-heading h3, .pf-subpanel h3 { margin: 0; color: #e1eee5; font-size: 11px; }
.pf-list { display: grid; gap: 5px; }
.pf-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(18,29,23,.68); }
.pf-row-main { display: grid; min-width: 0; gap: 3px; }
.pf-row-main strong { overflow: hidden; color: #e4eee7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-main small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.pf-row-value { color: #dcebe1; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pf-positive { color: var(--green) !important; }
.pf-negative { color: var(--red) !important; }
.pf-chart { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,20,16,.56); }
.pf-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.pf-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(8px,1fr); align-items: end; gap: 5px; height: 110px; padding: 7px 2px 0; border-bottom: 1px solid var(--line-2); }
.pf-bar-group { display: grid; grid-template-rows: 1fr auto; align-items: end; height: 100%; min-width: 0; gap: 4px; }
.pf-bar-pair { display: flex; height: 100%; align-items: end; justify-content: center; gap: 2px; }
.pf-bar { width: min(10px, 40%); min-height: 2px; border-radius: 3px 3px 0 0; background: #58c888; }
.pf-bar.expense { background: #d78276; }
.pf-bar-date { overflow: hidden; color: var(--quiet); font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pf-legend { display: flex; gap: 10px; color: var(--muted); font-size: 8px; }
.pf-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pf-legend i { width: 7px; height: 7px; border-radius: 2px; background: #58c888; }
.pf-legend .expense i { background: #d78276; }
.pf-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.pf-table th, .pf-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.pf-table th { color: var(--quiet); font-size: 8px; font-weight: 650; letter-spacing: .04em; white-space: nowrap; }
.pf-table td { color: #dbe6df; }
.pf-table tr:last-child td { border-bottom: 0; }
.pf-table td:last-child, .pf-table th:last-child { text-align: right; }
.pf-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 19px; padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 999px; color: #bed2c4; font-size: 8px; white-space: nowrap; }
.pf-chip[data-state="active"], .pf-chip[data-state="ready"] { border-color: rgba(110,227,164,.24); color: #a7edc0; }
.pf-chip[data-state="partial"], .pf-chip[data-state="draft"] { border-color: rgba(233,199,120,.24); color: #efd797; }
.pf-progress { overflow: hidden; width: 100%; height: 6px; border-radius: 999px; background: #26352d; }
.pf-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#48b878,#91e7a6); }
.pf-goals { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.pf-goal { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18,29,23,.68); }
.pf-goal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pf-goal h3 { overflow: hidden; margin: 0; color: #e2eee6; font-size: 10px; text-overflow: ellipsis; }
.pf-goal-metrics { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }
.pf-advice-summary { padding: 11px; border: 1px solid rgba(110,227,164,.18); border-radius: 9px; background: linear-gradient(120deg, rgba(45,112,73,.13), rgba(14,23,18,.7)); color: #e1eee5; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.pf-advice-card { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18,29,23,.7); }
.pf-advice-card h3 { margin: 0; color: #e5efe8; font-size: 10px; }
.pf-advice-card p { margin: 0; color: #b8c7bd; font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.pf-source-list { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,20,16,.52); }
.pf-form label { display: grid; min-width: 0; gap: 5px; color: #bbc9bf; font-size: 9px; }
.pf-form input, .pf-form select, .pf-form textarea { width: 100%; min-width: 0; min-height: 34px; padding: 7px 9px; border: 1px solid #35463b; border-radius: 7px; background: #0a120e; color: var(--text); font-size: 10px; }
.pf-form textarea { resize: vertical; }
.pf-form input:focus, .pf-form select:focus, .pf-form textarea:focus { border-color: var(--accent); outline: 2px solid rgba(110,227,164,.13); outline-offset: 1px; }
.pf-form .pf-wide, .pf-form fieldset.pf-wide { grid-column: 1 / -1; }
.pf-form fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.pf-form legend { padding: 0 4px; color: #dce8e0; font-size: 9px; }
.pf-form .pf-check { display: flex; align-items: center; gap: 7px; min-height: 28px; }
.pf-form .pf-check input { width: 15px; min-height: 15px; accent-color: var(--accent); }
.pf-form .button { justify-self: start; }
.pf-form-actions { grid-column: 1 / -1; }
.pf-custom-range { display: flex; align-items: end; gap: 7px; padding: 0 2px; flex-wrap: wrap; }
.pf-custom-range label { display: grid; flex: 1 1 115px; min-width: 90px; gap: 4px; color: var(--muted); font-size: 8px; }
.pf-custom-range label.pf-wide { flex: 1 1 100%; }
.pf-custom-range input, .pf-custom-range select { min-height: 30px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 9px; }
.pf-custom-range input, .pf-custom-range select { width: 100%; }
.pf-panel-footer { justify-content: space-between; flex-wrap: wrap; padding-top: 3px; }
.pf-panel-footer .button { min-height: 30px; }
.pf-preferences-form { max-width: 620px; }
.pf-preferences-form .pf-hint { grid-column: 1 / -1; }
.pf-contribution-form { margin-top: 8px; }
.pf-advice-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }
.pf-allocation-bucket-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(18,29,23,.7); }
.pf-allocation-bucket-meta { display: grid; gap: 3px; min-width: 0; }
.pf-allocation-bucket-meta strong { overflow: hidden; color: #e2eee6; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pf-allocation-bucket-meta small { color: var(--muted); font-size: 8px; }
.pf-allocation-bucket-values { color: #cfe0d4; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }
.pf-icon-action { min-height: 30px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 6px; background: transparent; color: #c6d4ca; cursor: pointer; font-size: 8px; }
.pf-icon-action:hover { border-color: rgba(110,227,164,.28); color: var(--accent); }
.pf-trade-link { justify-self: start; }
.pf-form fieldset .pf-check input { flex: 0 0 16px; }
@media (max-width: 760px) {
  .pf-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pf-split { grid-template-columns: 1fr; }
  .pf-heading-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .pf-panel { padding-right: 7px; padding-left: 7px; }
  .pf-grid { gap: 5px; }
  .pf-metric { padding: 8px; }
  .pf-metric strong { font-size: 13px; }
  .pf-heading-actions { gap: 5px; }
  .pf-heading-actions .button { min-height: 30px; }
  .pf-form { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
  .pf-form .pf-wide, .pf-form fieldset { grid-column: auto; }
  .pf-form fieldset { grid-template-columns: 1fr; }
  .pf-goals { grid-template-columns: 1fr; }
  .pf-custom-range { flex-wrap: wrap; }
  .pf-allocation-bucket-row { grid-template-columns: minmax(0,1fr) auto; }
  .pf-allocation-bucket-values { grid-column: 1; text-align: left; }
  .pf-allocation-bucket-row > .pf-icon-action { grid-column: 2; grid-row: 1 / span 2; }
  .pf-table { min-width: 530px; }
}

/* Feature modules */
.pf-goal-grid, .pf-advice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.pf-goal-card { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18,29,23,.68); color: inherit; text-decoration: none; transition: border-color .18s ease, background .18s ease; }
.pf-goal-card:hover, .pf-goal-card:focus-visible { border-color: rgba(110,227,164,.45); background: rgba(24,42,31,.9); }
.pf-goal-card p { margin: 0; color: var(--muted); font-size: 9px; }
.pf-progress { overflow: hidden; width: 100%; height: 6px; border-radius: 999px; background: #26352d; }
.pf-progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#48b878,#91e7a6); }
.pf-advice-card { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18,29,23,.68); }
.pf-advice-card > strong { color: #e4eee7; font-size: 10px; }
.pf-advice-card p { margin: 0; color: #bac9bf; font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.pf-advice-card small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.pf-inline-warning { padding: 8px 10px; border-left: 2px solid #d8ad59; background: rgba(216,173,89,.08); color: #e9d5a3; font-size: 9px; }
.pf-report-row { display: grid; width: 100%; color: inherit; text-align: left; text-decoration: none; }
.pf-report-row:hover { border-color: rgba(110,227,164,.35); }
.pf-source-list { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-section-heading > div { display: grid; gap: 3px; min-width: 0; }
.pf-section-heading > div strong { color: #e4eee7; font-size: 10px; }
.pf-section-heading > div small { color: var(--muted); font-size: 8px; }
.viewer-mode [data-admin-only] { display: none !important; }
@media (max-width: 560px) {
  .pf-goal-grid, .pf-advice-grid { grid-template-columns: 1fr; }
}
