/* Comfortable reading sizes for finance, independent of the app's compact tables. */
.finance-toolbar,
.finance-summary,
.finance-business-tabs,
.finance-account-grid,
.finance-payroll,
.finance-entries,
.finance-pending-account {
  font-size: 15px;
  line-height: 1.65;
}

.finance-toolbar button,
.finance-business-tabs button,
.finance-add-buttons button {
  min-height: 50px;
  padding: 12px 20px;
  font-size: 15px;
  gap: 10px;
}
.finance-toolbar svg,
.finance-business-tabs svg,
.finance-add-buttons svg { width: 20px; height: 20px; }
.finance-save-state { font-size: 13px; color: #5d708e; margin: 14px 0 24px; }
.finance-summary article { padding: 28px; }
.finance-summary article > span { font-size: 15px; color: #526789; }
.finance-summary strong { font-size: clamp(29px, 2.5vw, 39px); line-height: 1.4; }
.finance-summary small { font-size: 13px; color: #607493; }
.finance-account-head h2,
.finance-payroll h2 { font-size: 21px; line-height: 1.5; }
.finance-account-head span,
.finance-account-card small,
.finance-payroll small { font-size: 13px; color: #607493; line-height: 1.6; }
.finance-account-card dl > div { font-size: 15px; margin: 18px 0; }
.finance-account-card dt { color: #526789; }
.finance-account-net dd { font-size: 25px; }
.finance-payroll-total strong { font-size: 31px; }
.finance-link { min-height: 44px; font-size: 14px; }
.finance-pending-account { padding: 20px 24px; font-size: 15px; }
.finance-pending-account button { min-height: 44px; font-size: 14px; padding: 10px 16px; }

.finance-entries { padding: 28px; container: finance-ledger / inline-size; }
.finance-entries > .panel-head { gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #e5ecf6; }
.finance-entries h2 { font-size: 25px; line-height: 1.5; margin: 6px 0 10px; }
.finance-entries .eyebrow,
.finance-payroll .eyebrow { font-size: 12px; }
.finance-entries small { font-size: 13px; color: #607493; line-height: 1.65; }
.finance-add-buttons { gap: 12px; }
.finance-list-bar { gap: 16px; margin: 24px 0 20px; justify-content: flex-start; }
.finance-list-bar > div { padding: 5px; gap: 4px; border-radius: 14px; }
.finance-list-bar button { min-height: 44px; padding: 10px 18px; font-size: 14px; color: #526789; }
.finance-list-bar select { min-height: 50px; min-width: 190px; font-size: 15px; padding-left: 16px; }
.finance-list-bar > span { margin-left: auto; font-size: 13px; color: #5d708e; }

.finance-table { border: 1px solid #e2e9f4; border-radius: 16px; }
.finance-table table { min-width: 1200px; border-collapse: collapse; }
.finance-table th { padding: 18px 22px; background: #f3f6fc; color: #526789; font-size: 14px; font-weight: 700; white-space: nowrap; }
.finance-table td { padding: 20px 22px; font-size: 15px; line-height: 1.6; vertical-align: middle; }
.finance-table tbody tr { transition: background-color .15s; }
.finance-table tbody tr:nth-child(even) { background: #fafbfe; }
.finance-table tbody tr:hover { background: #f1f6ff; }
.finance-table .finance-date { min-width: 135px; white-space: nowrap; color: #526789; }
.finance-table .finance-description { min-width: 260px; max-width: 560px; }
.finance-description > strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.65; }
.finance-entry-business { margin-top: 6px; font-size: 13px; color: #607493; }
.finance-category,
.finance-account-tag { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-width: 84px; min-height: 36px; padding: 8px 16px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: normal; }
.finance-category { color: #526789; }
.finance-table .finance-amount { min-width: 145px; font-size: 17px; font-weight: 800; text-align: right; }
.finance-table th:nth-child(5),
.finance-table th:nth-child(6) { text-align: right; }
/* Each action has its own balanced, centered button and visible boundary. */
.finance-table th:nth-child(1),
.finance-table th:nth-child(3),
.finance-table th:nth-child(4),
.finance-table th:nth-child(7),
.finance-table td:nth-child(1),
.finance-table td:nth-child(3),
.finance-table td:nth-child(4) { text-align: center; }
.finance-row-actions { display: flex; flex-wrap: wrap; justify-content: center; min-width: 250px; width: auto; gap: 10px; align-items: center; padding: 0; background: none; border: 0; border-radius: 0; }
.finance-row-actions button { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; min-height: 44px; min-width: 76px; padding: 11px 16px; border: 1px solid #d9e4f5; font-size: 13px; line-height: 1.4; font-weight: 600; border-radius: 11px; cursor: pointer; white-space: nowrap; background: #fff; color: #526789; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.finance-row-actions svg { width: 16px; height: 16px; flex-shrink: 0; }
.finance-row-actions [data-finance-edit] { background: #edf3ff; color: #2463ff; border-color: #d2e0ff; }
.finance-row-actions [data-finance-split] { background: #fff; color: #526789; }
.finance-row-actions [data-finance-remove] { background: #fff6f6; color: #b74754; border-color: #f0d9dd; }
.finance-row-actions button:hover { background: #e4edff; border-color: #aec8ff; box-shadow: 0 3px 8px #183b700a; }
.finance-row-actions [data-finance-remove]:hover { background: #ffe8eb; border-color: #e8b3bd; }
.finance-toolbar button:focus-visible,
.finance-business-tabs button:focus-visible,
.finance-entries button:focus-visible,
.finance-pending-account button:focus-visible { outline: 3px solid #acc7ff; outline-offset: 3px; }
.finance-help { font-size: 13px; line-height: 1.8; color: #607493; margin-top: 22px; }
.finance-entry-modal label,
.finance-category-field > span { font-size: 14px; }
.finance-entry-modal input,
.finance-entry-modal select,
.finance-entry-modal .primary { min-height: 50px; font-size: 15px; }
.finance-category-trigger { font-size: 15px !important; }
.finance-category-search input { min-height: 44px !important; font-size: 14px !important; }
.finance-category-panel [role=option] { min-height: 48px; font-size: 14px; }
.finance-new-category { min-height: 44px; font-size: 14px !important; }
.finance-new-category-fields button { min-height: 44px; font-size: 14px; }
.finance-new-category-fields label,
.finance-new-category-fields small,
.finance-new-category-fields [role=alert] { font-size: 13px; }

/* Use the available panel width, including laptops with the sidebar open. */
@container finance-ledger (max-width: 1100px) {
  .finance-table { border: 0; border-radius: 0; overflow: visible; }
  .finance-table table { display: block; min-width: 0; }
  .finance-table thead { display: none; }
  .finance-table tbody { display: grid; gap: 16px; }
  .finance-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 20px; border: 1px solid #dce5f4; border-radius: 16px; background: #fff; }
  .finance-table td { display: block; min-width: 0 !important; max-width: none !important; padding: 0; border: 0; }
  .finance-table .finance-date,
  .finance-table .finance-description,
  .finance-table .finance-manage,
  .finance-table .finance-empty { grid-column: 1 / -1; }
  .finance-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: #607493; }
  .finance-table td:nth-child(1), .finance-table td:nth-child(3), .finance-table td:nth-child(4) { text-align: left; }
  .finance-table .finance-amount { text-align: left; font-size: 17px; overflow-wrap: anywhere; white-space: normal; }
  .finance-row-actions { width: 100%; min-width: 0; justify-content: flex-start; margin-top: 4px; gap: 10px; }
  .finance-row-actions button { min-height: 44px; flex: 1 1 auto; }
}
/* On phones, keep the same readable cards with a compact toolbar. */
@media (max-width: 900px) {
  .finance-entries { padding: 20px; }
  .finance-entries h2 { font-size: 22px; }
  .finance-add-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .finance-add-buttons button { padding: 12px; }
  .finance-add-buttons button:last-child { grid-column: 1 / -1; }
  .finance-list-bar > div { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .finance-list-bar button { padding: 10px 6px; font-size: 13px; }
  .finance-list-bar select { width: 100%; }
  .finance-list-bar > span { margin-left: 0; }
  .finance-table { border: 0; border-radius: 0; overflow: visible; }
  .finance-table table { display: block; min-width: 0; }
  .finance-table thead { display: none; }
  .finance-table tbody { display: grid; gap: 16px; }
  .finance-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 20px; border: 1px solid #dce5f4; border-radius: 16px; background: #fff; }
  .finance-table td { display: block; min-width: 0 !important; max-width: none !important; padding: 0; border: 0; }
  .finance-table .finance-date,
  .finance-table .finance-description,
  .finance-table .finance-manage,
  .finance-table .finance-empty { grid-column: 1 / -1; }
  .finance-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: #607493; }
  .finance-table td:nth-child(1), .finance-table td:nth-child(3), .finance-table td:nth-child(4) { text-align: left; }
  .finance-table .finance-amount { text-align: left; font-size: 17px; overflow-wrap: anywhere; white-space: normal; }
  .finance-row-actions { width: 100%; min-width: 0; justify-content: flex-start; margin-top: 4px; gap: 10px; }
  .finance-row-actions button { min-height: 44px; flex: 1 1 auto; }
  .finance-toolbar > div { flex-wrap: wrap; }
  .finance-summary article { padding: 22px; }
  .finance-summary strong { font-size: 31px; }
}
@media (max-width: 480px) {
  .finance-account-head { align-items: flex-start; flex-direction: column; }
  .finance-account-card dl > div { flex-wrap: wrap; gap: 6px; }
  .finance-payroll-total { margin-left: 0; width: 100%; }
  .finance-pending-account { padding: 18px; }
  .finance-pending-account span { align-items: flex-start; }
  .finance-pending-account button { white-space: normal; text-align: left; }
  .finance-business-tabs { gap: 10px; }
  .finance-business-tabs button { font-size: 14px; }
  .finance-table tbody tr { padding: 16px; }
}

/* One clear entry point for transaction actions. */
.finance-row-actions{min-width:112px}
.finance-row-actions button[data-finance-manage]{min-width:112px;gap:14px;background:#fff;border-color:#d5e1f5;color:#315b9a;padding:11px 18px}
.finance-row-actions button[data-finance-manage]:hover{background:#edf3ff;border-color:#a9c3ff}
.finance-row-actions button[data-finance-manage] span:last-child{font-size:20px;line-height:16px}
.finance-action-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;margin:0 0 18px;background:#f2f6ff;border-radius:14px;color:#60718e;font-size:13px}
.finance-action-summary strong{font-size:20px;color:#193b70;white-space:nowrap}
.finance-action-menu{display:grid;gap:10px}
.finance-action-menu button{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid #e1e8f3;border-radius:14px;background:#fff;text-align:left;color:#245bd8;cursor:pointer;font:inherit}
.finance-action-menu button:hover{background:#f5f8ff;border-color:#bcd0f7}
.finance-action-menu button>svg{width:22px;height:22px;flex-shrink:0}
.finance-action-menu button>span:nth-child(2){flex:1;min-width:0}
.finance-action-menu strong{display:block;font-size:15px;line-height:1.6}
.finance-action-menu small{display:block;margin-top:3px;font-size:13px;line-height:1.6;color:#75839c}
.finance-action-menu .finance-action-danger{color:#bb4656}
.finance-action-menu .finance-action-danger:hover{background:#fff7f8;border-color:#efcbd1}
