/* Client dossier and cash accounting, matching the studio's warm palette. */
[hidden] { display: none !important; }
.finance-nav { display: grid; gap: .45rem; }
.finance-nav a { display: flex; align-items: center; justify-content: space-between; padding: .85rem; border-radius: 12px; color: inherit; text-decoration: none; font-weight: 600; font-size: .85rem; }
.finance-nav a:hover, .finance-nav a[aria-current="page"] { background: #b9844821; color: #8b542c; }
.finance-nav a span { font-size: .65rem; letter-spacing: .12em; }
.finance-note { color: #807266; font-size: .8rem; line-height: 1.7; }
.finance-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.finance-stat { display: flex; flex-direction: column; justify-content: space-between; gap: .65rem; padding: 1.3rem; background: linear-gradient(135deg, #fffdf9, #f7f2ea); border: 1px solid #d8cabb88; border-radius: 18px; box-shadow: 0 4px 15px #503b2410; min-width: 0; }
.finance-stat > span { color: #7c6958; font-size: .74rem; font-weight: 600; }
.finance-stat strong { color: #9c693f; font: 400 clamp(1.35rem, 2.4vw, 2.25rem)/1.15 "Antic Didone", Georgia, serif; overflow-wrap: anywhere; }
.finance-stat small { font-size: .68rem; color: #8b8075; line-height: 1.5; }
.client-profile { display: flex; align-items: center; gap: 1.2rem; padding: 1.4rem 0 .5rem; }
.client-avatar { display: grid; place-items: center; width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%; background: #ead7b3; color: #9c693f; font: 1.6rem Georgia, serif; }
.client-profile h3 { margin: 0 0 .5rem; font-size: 1.8rem; }
.client-profile p { margin: .35rem 0; font-size: .82rem; color: #807266; overflow-wrap: anywhere; }
.client-profile .meta-pill { display: inline-block; margin-top: .5rem; background: #f0e3c8; }
.history-shell .history-scroll-list { max-height: none; overflow: visible; }
.visit-card { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 1.2rem; align-items: center; padding: 1.4rem .65rem; border-bottom: 1px solid #d8cabb70; }
.visit-card:last-child { border-bottom: 0; }
.visit-dot { width: 9px; height: 9px; border-radius: 50%; background: #b58251; box-shadow: 0 0 0 5px #b5825115; align-self: start; margin-top: .4rem; }
.visit-main h4 { font-size: .87rem; line-height: 1.6; margin: .4rem 0; }
.visit-main p { font-size: .75rem; margin: .3rem 0; color: #8b8075; }
.visit-main .eyebrow { font-size: .67rem; }
.visit-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.visit-badges .status-badge, .visit-badges .meta-pill { font-size: .62rem; padding: .4rem .6rem; white-space: normal; }
.visit-money { display: flex; flex-direction: column; gap: .35rem; text-align: right; min-width: 135px; }
.visit-money strong { color: #966638; font-size: 1.25rem; }
.visit-money small { font-size: .72rem; color: #807266; }
.visit-actions { display: flex; flex-direction: column; gap: .5rem; }
.visit-actions button { font-size: .72rem; min-height: 2.4rem; }
.payment-entry { margin: 1rem 0; border: 1px solid #d8cabb; border-radius: 16px; padding: 1.4rem; background: #fcf8f1; min-width: 0; }
.payment-entry legend { color: #966638; padding: 0 .5rem; font-weight: 600; }
.payment-entry > p { margin: 0 0 1rem; font-size: .82rem; color: #807266; }
.payment-entry small { font-size: .72rem; line-height: 1.6; color: #807266; }
.payment-preview { margin: 1rem 0; padding: .9rem; border-radius: 10px; background: #e8dcc650; font-size: .83rem; font-weight: 600; color: #81582e; }
.view-panel.accounting-page.is-active { display: grid; gap: 1.2rem; }
.accounting-page .finance-stats { margin: 0; }
.accounting-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-top: 1.25rem; }
.accounting-filters .field { flex: 1 1 155px; min-width: 0; }
.accounting-filters button { margin-bottom: 0; }
.accounting-charts { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 1.2rem; }
.accounting-charts > article { min-width: 0; }
.accounting-charts h3 { font-size: 1.15rem; margin: .5rem 0 1.5rem; }
.chart-scroll { overflow-x: auto; }
.chart-scroll svg { display: block; width: 100%; height: 240px; }
.chart-scroll svg text { font: 10px Montserrat, sans-serif; fill: #887968; }
.daily-chart details { font-size: .75rem; color: #807266; margin-top: .75rem; }
.daily-chart summary { cursor: pointer; }
.daily-values { max-height: 240px; overflow: auto; margin-top: .75rem; }
.daily-values > div { display: flex; justify-content: space-between; padding: .5rem; border-bottom: 1px solid #e6ded2; }
.method-item { margin: 1rem 0; }
.method-item > div:first-child { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; }
.method-item i { display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-radius: 50%; }
.method-track { height: 7px; background: #eee6d9; border-radius: 5px; overflow: hidden; margin: .6rem 0 .3rem; }
.method-track span { display: block; height: 100%; border-radius: inherit; }
.method-item small { font-size: .68rem; color: #807266; }
.finance-table-wrap { overflow-x: auto; }
.finance-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .78rem; }
.finance-table th { color: #887968; font-size: .68rem; font-weight: 600; padding: 1rem .7rem; background: #f4ede3; white-space: nowrap; }
.finance-table td { padding: 1rem .7rem; border-bottom: 1px solid #e6ded2; line-height: 1.5; }
.finance-table .money-cell { font-weight: 600; color: #986137; text-align: right; white-space: nowrap; }
.finance-table .meta-pill { font-size: .65rem; white-space: nowrap; }
#accountingPagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding-top: 1rem; font-size: .75rem; }
#expensePagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem; padding-top: 1rem; font-size: .75rem; }
#expenseRows td { overflow-wrap: anywhere; }
.history-shell > .section-header { margin: .5rem .25rem 1rem; }
@media (max-width: 1200px) {
  .finance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-charts { grid-template-columns: minmax(0, 1fr); }
  .visit-card { grid-template-columns: 10px minmax(0, 1fr) auto; gap: .85rem; }
  .visit-actions { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .finance-stats { gap: .6rem; }
  .finance-stat { padding: 1rem .8rem; border-radius: 12px; }
  .finance-stat strong { font-size: 1.55rem; }
  .client-profile { align-items: flex-start; gap: .8rem; }
  .client-profile h3 { font-size: 1.4rem; }
  .client-avatar { width: 52px; height: 52px; font-size: 1.1rem; }
  .visit-card { grid-template-columns: 8px minmax(0, 1fr); }
  .visit-money { grid-column: 2; text-align: left; }
  .visit-actions { grid-column: 2; }
  .payment-entry { padding: .9rem; }
  .payment-entry .form-grid { grid-template-columns: minmax(0, 1fr); }
  .accounting-filters { flex-direction: column; align-items: stretch; }
  .accounting-filters .field { flex-basis: auto; }
}

/* Client selection opens a compact dossier, with the hierarchy of a client card. */
.client-dossier { max-width: 1180px; margin-inline: auto; }
.dossier-back { display: inline-block; margin: 0 0 1rem .2rem; color: #8b7969; font-size: .76rem; text-decoration: none; }
.dossier-back:hover { color: #9c693f; text-decoration: underline; }
.dossier-header { padding: 1.5rem; border: 1px solid #dfd4c6; border-radius: 20px; background: #fffdf9e8; box-shadow: 0 5px 20px #503b2408; }
.dossier-header-main { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; }
.dossier-header .client-profile { padding: 0; flex: 1; min-width: 0; }
.dossier-header .client-avatar { width: 68px; height: 68px; background: #edddbd; }
.dossier-header .client-profile h3 { max-width: none; font-family: "Antic Didone", Georgia, serif; font-size: 1.9rem; font-weight: 400; color: #665b4f; line-height: 1.15; }
.dossier-identity { min-width: 0; }
.dossier-identity p { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; font-size: .74rem; color: #9b9084; }
.dossier-identity svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; flex-shrink: 0; }
.dossier-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }
.dossier-actions > a, .dossier-actions > button { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; min-height: 2.7rem; border-radius: 9px; padding: .7rem 1rem; font-size: .76rem; white-space: nowrap; }
.dossier-actions .ghost-button { color: #a17948; border: 1px solid #e9d9b6; background: #f5ead2; box-shadow: none; }
.dossier-actions .primary-button { background: #b97b3d; border: 1px solid #b97b3d; color: white; box-shadow: 0 3px 8px #a66c3220; }
.dossier-actions svg, .visit-view svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dossier-badges { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.2rem; }
.dossier-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .8rem; border-radius: 30px; font-size: .68rem; line-height: 1.5; }
.dossier-badge > span { font-size: .9rem; line-height: 1; }
.dossier-badge.is-signed { color: #6b886d; background: #e7f0df; }
.dossier-badge.is-unsigned { color: #8a7b68; background: #f2ede5; }
.dossier-badge.is-skin { color: #9a7b45; background: #f4e9d0; }
.client-dossier .client-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin: 1.2rem 0 .7rem; }
.client-dossier .dossier-stat { gap: .45rem; justify-content: flex-start; min-height: 122px; padding: 1.15rem 1.3rem; border-radius: 17px; background: #fffdf9cc; box-shadow: 0 3px 12px #503b2405; }
.client-dossier .dossier-stat strong { font-size: 2rem; color: #a27e5c; line-height: 1.15; }
.client-dossier .dossier-stat > span { color: #9c8e7e; font-weight: 400; font-size: .75rem; }
.client-dossier .dossier-stat small { margin-top: auto; color: #a6998c; font-size: .65rem; }
.dossier-summary-note { margin: .5rem .25rem 1rem; font-size: .68rem; }
.dossier-summary-note:empty { display: none; }
.dossier-visits { margin-top: 1.65rem; }
.dossier-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 .25rem .8rem; }
.dossier-section-heading h3 { margin: 0; font: 600 .69rem/1.5 Montserrat, sans-serif; text-transform: uppercase; letter-spacing: .16em; color: #9c8d7c; }
.dossier-refresh { background: none; border: 0; color: #a18a70; padding: .4rem; font: 400 .7rem Montserrat, sans-serif; cursor: pointer; }
.dossier-refresh:hover { text-decoration: underline; }
.dossier-filter-panel { margin: 0 .2rem .8rem; }
.dossier-filter-panel summary { width: fit-content; cursor: pointer; font-size: .7rem; color: #a18a70; }
.dossier-filter-panel .history-filters { margin: .8rem 0; padding: 1rem; background: #fffdf9b0; border: 1px solid #dfd4c6; border-radius: 12px; }
.dossier-timeline { background: #fffdf9d9; border: 1px solid #dfd4c6; border-radius: 18px; overflow: hidden; padding: .6rem 1.25rem 0; box-shadow: 0 5px 20px #503b2405; }
.dossier-timeline .table-body { gap: 0; }
.dossier-timeline .history-scroll-list { max-height: none; overflow: visible; padding-right: 0; }
.dossier-timeline .visit-card { padding: 1.1rem .15rem; gap: 1rem; grid-template-columns: 12px minmax(0, 1fr) auto auto; }
.dossier-timeline .visit-dot { margin-top: .45rem; background: #bc8a56; width: 8px; height: 8px; }
.dossier-timeline .visit-main h4 { margin: 0 0 .25rem; color: #746453; font-size: .84rem; font-weight: 600; }
.dossier-timeline .visit-main p { margin: .2rem 0; color: #a29484; font-size: .7rem; }
.dossier-timeline .visit-main .visit-signer { font-size: .66rem; color: #b1a493; }
.dossier-timeline .visit-money { min-width: 115px; gap: .25rem; }
.dossier-timeline .visit-money strong { font-size: .95rem; font-weight: 500; color: #a18465; }
.dossier-timeline .visit-money small { font-size: .64rem; color: #a6998a; }
.dossier-timeline .visit-actions { flex-direction: row; grid-column: auto; align-items: center; }
.dossier-timeline .visit-view { min-width: 64px; min-height: 40px; color: #9e9487; background: #f9f7f2; border: 1px solid #e8e1d7; border-radius: 8px; box-shadow: none; }
.dossier-timeline .table-pagination { margin: .3rem -1.25rem 0; border-top: 1px solid #e8e1d7; background: transparent; font-size: .72rem; }
.dossier-timeline .pagination-summary { font-size: .72rem; }
.dossier-timeline .empty-state { background: transparent; border: none; padding: 2rem .5rem; font-size: .8rem; }
@media (max-width: 1050px) {
  .dossier-header-main { flex-wrap: wrap; }
  .dossier-header .client-profile { flex-basis: 100%; }
  .dossier-actions { margin-left: 86px; }
  .dossier-email { display: none; }
}
@media (max-width: 650px) {
  .dossier-header { padding: 1.1rem; }
  .dossier-header .client-avatar { width: 52px; height: 52px; }
  .dossier-header .client-profile h3 { font-size: 1.6rem; }
  .dossier-actions { margin-left: 0; width: 100%; }
  .dossier-actions > a, .dossier-actions > button { flex: 1; font-size: .7rem; }
  .dossier-badges { gap: .45rem; }
  .dossier-badge { font-size: .62rem; padding: .45rem .65rem; }
  .client-dossier .client-stats { gap: .55rem; }
  .client-dossier .dossier-stat { min-height: 115px; padding: .85rem .65rem; }
  .client-dossier .dossier-stat strong { font-size: 1.4rem; }
  .client-dossier .dossier-stat > span { font-size: .64rem; }
  .client-dossier .dossier-stat small { font-size: .57rem; }
  .dossier-timeline { padding-inline: .9rem; }
  .dossier-timeline .visit-card { grid-template-columns: 8px minmax(0, 1fr) auto; gap: .6rem; }
  .dossier-timeline .visit-money { grid-column: 2; text-align: left; flex-direction: row; flex-wrap: wrap; column-gap: .6rem; }
  .dossier-timeline .visit-actions { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }
  .dossier-timeline .visit-view { min-width: 48px; }
  .dossier-timeline .table-pagination { margin-inline: -.9rem; gap: .4rem; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .client-dossier .client-stats { grid-template-columns: 1fr; }
  .client-dossier .dossier-stat { min-height: auto; }
}
