/* Finance module: shared Fluency Hub tokens and existing form components. */
.fin-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  min-width: 0;
}
.fin-toolbar > * { min-width: 0; max-width: 100%; }
.fin-toolbar .input[type="month"] { width: auto; flex: 0 1 195px; }
.fin-toolbar .select { width: auto; flex: 1 1 170px; max-width: 240px; }
.fin-toolbar .btn { flex-shrink: 0; }
.fin-toolbar > strong { font-size: 15px; letter-spacing: -.2px; }

.fin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.fin-summary > * { min-width: 0; }
.fin-summary .stats-card { padding: 20px; gap: 13px; }
.fin-summary .stats-card > div { min-width: 0; }
.fin-summary .stat-value {
  font-size: clamp(21px, 2.05vw, 27px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.fin-summary .stat-label { line-height: 1.6; }
.fin-summary .stats-card:nth-child(2) .stat-icon { color: var(--green); background: var(--sage-soft); }

.fin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.fin-card { min-width: 0; display: flex; flex-direction: column; gap: 17px; }
.fin-card.card-pad { padding: 23px; }
.fin-card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.fin-card-head > div { min-width: 0; flex: 1 1 140px; }
.fin-card-head h3 { margin: 0 0 6px; overflow-wrap: anywhere; }
.fin-card-head p { margin: 0; color: var(--muted); font-size: 12px; }
.fin-card-head .chip { flex-shrink: 0; }
.fin-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.fin-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.fin-meta .icon { width: 14px; height: 14px; flex-basis: 14px; }
.fin-amount { color: var(--ink); font-size: 29px; font-weight: 700; line-height: 1.25; letter-spacing: -.8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-amount small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; font-weight: 450; letter-spacing: 0; }
.fin-amount.paid { color: var(--green); }
.fin-amount.overdue { color: #a75760; }
.fin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); }
.fin-actions .btn { min-width: 0; }
.fin-policy { padding: 14px 16px; border: 1px solid #e1e3f4; border-radius: 10px; background: #f7f7fd; color: #777d9b; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.fin-policy strong { color: var(--accent-dark); font-weight: 650; }
.fin-policy p { margin-bottom: 8px; }
.fin-policy p:last-child { margin-bottom: 0; }

.fin-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; min-width: 0; margin: 5px 0 0; }
.fin-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 65px; padding: 10px 3px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.4; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.fin-day:hover { background: var(--accent-soft); border-color: #d4d4ef; }
.fin-day:has(input:checked) { background: var(--accent-soft); border-color: #b6b6e9; color: var(--accent-dark); }
.fin-day:has(input:focus-visible) { outline: 3px solid #9c9cf0; outline-offset: 3px; }
.fin-day input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.fin-day input:focus-visible { outline-offset: 2px; }
.fin-plan-fields { display: grid; gap: 17px; min-width: 0; margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcff; }
.fin-plan-fields .form-field { margin-bottom: 0; }
.fin-plan-fields > h3 { font-size: 14px; margin: 0; }
.fin-preview { margin-top: 18px; padding: 17px 18px; border: 1px solid #dce9df; border-radius: 11px; background: var(--sage-soft); color: #607e6a; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.fin-preview h3, .fin-preview strong { color: var(--green); }
.fin-preview h3 { margin: 0 0 8px; font-size: 14px; }
.fin-preview p { margin: 7px 0 0; }
.fin-preview ul { margin: 8px 0 0; padding-left: 19px; }
.fin-preview .fin-amount { margin: 5px 0; color: var(--green); font-size: 26px; }
.fin-preview:empty, .fin-error:empty { display: none; }
.fin-error { margin: 12px 0; padding: 11px 14px; border: 1px solid #edcfd3; border-radius: 8px; background: #fff4f5; color: #a1535c; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }

.fin-schedule { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; min-width: 0; }
.fin-occurrence { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.fin-occurrence:first-child { padding-top: 0; }
.fin-occurrence:last-child { padding-bottom: 0; border-bottom: 0; }
.fin-occurrence > time { flex: 0 0 54px; padding: 9px 5px; border: 1px solid #e3e3f4; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; line-height: 1.5; text-align: center; }
.fin-occurrence > time strong { display: block; color: inherit; font-size: 20px; line-height: 1.2; letter-spacing: -.4px; }
.fin-occurrence-info { flex: 1 1 150px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.fin-occurrence-info > strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.fin-occurrence-info > small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.fin-occurrence-info p { margin: 4px 0 0; }
.fin-occurrence .fin-actions { width: 100%; margin-top: 2px; padding-top: 10px; border-top: 0; }
.fin-occurrence .btn { flex-shrink: 0; }
.fin-timeline { position: relative; display: grid; gap: 0; padding-left: 23px; margin: 16px 0 0; border-left: 1px solid #ddddf1; }
.fin-timeline > * { position: relative; min-width: 0; padding: 0 0 20px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fin-timeline > *::before { content: ""; position: absolute; top: 6px; left: -28px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: #a3a3e2; box-shadow: 0 0 0 1px #ddddf1; }
.fin-timeline > *:last-child { padding-bottom: 0; }
.fin-timeline strong { color: var(--ink); font-weight: 600; }
.fin-timeline small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.fin-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.fin-next-item { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafafe; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.fin-next-item > strong { display: block; margin: 5px 0 3px; color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.25px; font-variant-numeric: tabular-nums; }
.fin-next-item > small { display: block; font-size: 11px; }
.fin-next-item:first-child { border-color: #e1e1f6; background: var(--accent-soft); }
.fin-next-item:first-child > strong { color: var(--accent); }
.fin-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 200px; padding: 30px 24px; border: 1px dashed #d9ddeb; border-radius: 14px; background: var(--surface); color: var(--muted); text-align: center; }
.fin-empty > .icon { width: 30px; height: 30px; color: #a3a3d2; margin-bottom: 4px; }
.fin-empty h3 { margin: 0; font-size: 17px; }
.fin-empty p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.8; }
.fin-empty .btn { margin-top: 8px; }
.fin-list > .fin-empty { grid-column: 1 / -1; }
.fin-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.fin-note strong { color: #69748c; font-weight: 600; }
.fin-note .icon { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }

@media (max-width: 1090px) {
  .fin-summary { gap: 12px; }
  .fin-summary .stats-card { padding: 17px 14px; gap: 10px; }
  .fin-summary .stat-value { font-size: 22px; }
  .fin-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .fin-toolbar { gap: 8px; margin-bottom: 19px; }
  .fin-summary { gap: 10px; }
  .fin-summary .stats-card { align-items: flex-start; }
  .fin-summary .stat-value { font-size: 21px; }
  .fin-summary .stat-label { font-size: 11px; }
  .fin-card.card-pad { padding: 21px; }
  .fin-next { gap: 9px; }
  .fin-next-item { padding: 13px; }
  .fin-next-item > strong { font-size: 16px; }
}
@media (max-width: 480px) {
  .fin-toolbar .input[type="month"] { flex: 1 1 140px; width: 0; }
  .fin-toolbar .select { flex: 1 1 100%; max-width: none; }
  .fin-toolbar .btn { padding-left: 12px; padding-right: 12px; }
  .fin-summary { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-bottom: 23px; }
  .fin-summary .stats-card { flex-direction: row; align-items: center; padding: 16px 18px; gap: 14px; }
  .fin-summary .stat-value { font-size: 25px; }
  .fin-summary .stat-label { font-size: 12px; }
  .fin-list { gap: 13px; }
  .fin-card.card-pad { padding: 19px; }
  .fin-card-head { gap: 10px; }
  .fin-amount { font-size: 27px; }
  .fin-meta { gap: 7px 11px; }
  .fin-actions > .btn { flex: 1 1 120px; }
  .fin-policy { padding: 13px 14px; }
  .fin-plan-fields { padding: 14px 12px; gap: 15px; }
  .fin-days { gap: 4px; }
  .fin-day { min-height: 61px; padding: 9px 2px; font-size: 10px; border-radius: 7px; }
  .fin-preview { padding: 15px; }
  .fin-occurrence { gap: 10px; }
  .fin-occurrence-info { flex-basis: 140px; }
  .fin-occurrence > .btn { margin-left: 64px; }
  .fin-next { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fin-next-item { padding: 14px 16px; }
  .fin-next-item > strong { font-size: 19px; }
}
@media print {
  .fin-toolbar, .fin-actions { display: none; }
  .fin-card, .fin-next-item, .fin-occurrence { break-inside: avoid; }
  .fin-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.fin-card { gap: 12px; }
.fin-card p { margin: 0; }
.fin-card-head h2 { margin: 0; font-size: 20px; }
.fin-card-head .eyebrow { margin-bottom: 5px; }
.fin-policy { margin-top: 22px; }
