/* Finance layouts use the agency panel's shared primitives and spacing. */
.finance-icon{display:inline-block;width:22px;height:22px;flex:0 0 22px;background-color:currentColor;-webkit-mask:var(--finance-icon) center/contain no-repeat;mask:var(--finance-icon) center/contain no-repeat;color:inherit;vertical-align:middle}
.icon-wallet{--finance-icon:url(/assets/icons/wallet.svg)}
.icon-chart-line-up{--finance-icon:url(/assets/icons/chart-line-up.svg)}
.icon-note-pencil{--finance-icon:url(/assets/icons/note-pencil.svg)}
.icon-clock-counter-clockwise{--finance-icon:url(/assets/icons/clock-counter-clockwise.svg)}
.icon-shield-check{--finance-icon:url(/assets/icons/shield-check.svg)}
.icon-files{--finance-icon:url(/assets/icons/files.svg)}
.finance-receipt-field{display:grid;gap:12px;min-width:0}
.finance-panel .finance-receipt-field input[type=file]{height:auto;min-height:var(--panel-action-height);max-width:100%;font-size:13px}
.finance-row-actions{display:flex;align-items:center;gap:var(--panel-section-gap)}
.finance-stack{display:flex;flex-direction:column;gap:var(--panel-section-gap)}
.finance-panel .heading,.finance-panel .card,.finance-panel .stats,.finance-panel .panel-hero{margin:0}
.finance-panel .ledger-hero .hero-copy{max-width:52%}
.finance-panel .ledger-hero>img{left:2%;bottom:0;width:46%;height:96%;object-fit:contain;object-position:left bottom}
.finance-panel .stats,.finance-panel .form-grid{gap:var(--panel-section-gap)}
.finance-panel .heading{align-items:center;flex-wrap:nowrap}
.finance-panel .heading>div{min-width:0}
.finance-panel .heading>.button{flex-shrink:0}
.finance-panel .brand{gap:12px;width:auto}
.finance-panel .brand>.finance-icon{width:38px;height:38px;flex-basis:38px;color:var(--purple)}
.finance-panel .brand small{font-size:12px}
.finance-panel .welcome{margin-inline-start:auto;margin-left:0}
.finance-panel .header-left form{margin:0}
.finance-panel .header-left .text-link{color:var(--muted)}
.finance-panel .sidebar-bottom{margin-top:auto}
.finance-panel .panel-nav a{white-space:nowrap}
.finance-panel .card-heading h2{display:flex;align-items:center;gap:10px}
.finance-filter{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:var(--panel-section-gap);align-items:end}
.filter-actions{grid-column:1/-1;align-items:center}
.finance-panel .actions{gap:var(--panel-section-gap);align-items:center}
.finance-panel .button,.finance-panel .text-link{min-height:var(--panel-action-height)}
.finance-panel .button .finance-icon,.finance-panel .text-link .finance-icon{width:18px;height:18px;flex-basis:18px}
.finance-panel .field{font-weight:400;align-content:start}
.finance-panel .field>small{font-size:12px}
.finance-panel .field input,.finance-panel .field select{height:var(--panel-action-height);min-height:var(--panel-action-height)}
.finance-panel .field select{appearance:none;-webkit-appearance:none;padding-inline-end:44px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747b83' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:18px;background-position:left 16px center}
.finance-panel .field input[dir=ltr]{text-align:left}
.finance-panel .field input[data-money]::placeholder{direction:rtl;text-align:right}
.finance-panel .field small:empty{display:none}
.finance-small{font-size:13px}
.finance-notice{padding:16px 20px;border:1px solid #d5e7dc;background:#f0f7f3;color:#326348;border-radius:var(--radius);overflow-wrap:anywhere}
.finance-notice.error{border-color:#f2d6d6;background:#fff1f1;color:#8e3030}
.finance-empty{display:flex;align-items:center;flex-direction:column;gap:12px;text-align:center}
.finance-empty>.finance-icon{width:36px;height:36px;flex-basis:36px;color:var(--purple)}
.finance-empty p{font-size:14px}
.finance-panel .table-wrap{max-width:100%;border-radius:8px;overscroll-behavior-inline:contain}
.finance-panel table caption{text-align:start}
.finance-panel .finance-description{min-width:180px;max-width:380px;white-space:normal;overflow-wrap:anywhere}
.finance-description strong{font-weight:600}
.finance-badge{display:inline-flex;align-items:center;min-height:28px;padding:2px 10px;border-radius:8px;font-size:12px;white-space:nowrap}
.finance-badge.income{color:#326348;background:#f0f7f3}
.finance-badge.expense{color:#8e3030;background:#fff1f1}
.finance-pagination{display:flex;justify-content:space-between;align-items:center;gap:var(--panel-section-gap);padding-top:var(--panel-section-gap);font-size:14px}
.previous-caret{display:flex;transform:rotate(180deg)}
.previous-caret svg{width:18px;height:18px}
.finance-entry-card{max-width:1120px;width:100%}
.finance-entry-form{display:grid;gap:var(--panel-section-gap)}
.finance-entry-form .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.finance-date{grid-column:1/-1;padding:0;border:0;margin:0;min-width:0}
.finance-date legend{padding:0 0 8px;font-size:14px}
.finance-date-fields{display:grid;grid-template-columns:1fr 1.4fr 1fr;gap:var(--panel-section-gap)}
.finance-full{grid-column:1/-1}
.finance-save-note{display:flex;gap:10px;align-items:flex-start;color:var(--muted);font-size:13px}
.finance-save-note .finance-icon{width:18px;height:18px;flex-basis:18px;margin-top:3px}
.audit-entry{padding:var(--panel-section-gap) 0;border-bottom:1px solid var(--line)}
.audit-entry:first-of-type{padding-top:0}
.audit-entry:last-of-type{border-bottom:0;padding-bottom:0}
.audit-entry summary{display:flex;align-items:center;gap:16px;flex-wrap:wrap;cursor:pointer;list-style:none;padding-inline-end:24px;position:relative}
.audit-entry summary::-webkit-details-marker{display:none}
.audit-entry summary:after{content:'';position:absolute;inset-inline-end:3px;width:8px;height:8px;border-inline-end:1.6px solid currentColor;border-block-end:1.6px solid currentColor;transform:rotate(45deg)}
.audit-entry[open] summary:after{transform:rotate(225deg)}
.audit-entry summary strong{flex:1;min-width:160px;font-size:15px;overflow-wrap:anywhere}
.audit-entry summary span,.audit-entry time{font-size:13px;color:var(--muted)}
.audit-entry .table-wrap{margin-top:var(--panel-section-gap)}
.audit-entry td{white-space:pre-wrap;overflow-wrap:anywhere;min-width:130px;max-width:420px}
.finance-audit-meta{display:flex;flex-wrap:wrap;gap:var(--panel-section-gap);align-items:center;font-size:13px;color:var(--muted);padding-top:16px}
.finance-audit-meta .text-link{margin-inline-start:auto}
.skip-link{position:fixed;inset-block-start:12px;inset-inline-start:12px;z-index:20;background:#fff;padding:10px 20px;border:2px solid var(--blue);border-radius:12px;transform:translateY(-200%)}
.skip-link:focus{transform:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.finance-auth .auth-brand .finance-icon{width:40px;height:40px;flex-basis:40px;color:#4d004d}
.finance-auth .auth-security .finance-icon{width:16px;height:16px;flex-basis:16px}
.finance-auth .auth-title{font-size:26px;line-height:1.5;margin:22px 0 8px;letter-spacing:0}
.finance-auth .auth-return{margin-top:16px}
.finance-auth .auth-story-banner .auth-art{position:static;width:min(100%,300px);margin:0;max-width:100%;border-radius:28px}
.finance-auth .auth-story-banner{overflow:hidden}
.finance-auth .auth-story-banner .auth-brand{position:relative;z-index:1}
@media(max-width:1100px){.finance-panel .welcome{display:none}.finance-filter{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 .finance-panel .panel-nav{display:flex;overflow-x:auto;gap:8px;scrollbar-width:thin}
 .finance-panel .panel-nav a{padding:10px 12px;font-size:12px;flex-shrink:0}
 .finance-panel .panel-nav .finance-icon{width:18px;height:18px;flex-basis:18px}
 .finance-panel .sidebar{border-inline-end:0;border-block-end:1px solid var(--line)}
 .finance-panel header{padding:0 16px;gap:12px}
 .finance-panel .brand{padding:0;gap:8px}
 .finance-panel .brand>.finance-icon{width:28px;height:28px;flex-basis:28px}
 .finance-panel .brand span{font-size:17px}
 .finance-panel .brand small{font-size:10px}
 .finance-panel .header-left{flex-direction:column;gap:0;align-items:flex-end}
 .finance-panel .header-left .text-link{font-size:12px;min-height:34px}
 .finance-panel .heading h1{font-size:21px}
 .finance-panel .heading .subtitle{font-size:12px}
 .finance-panel .heading>.button{font-size:12px;padding:10px 12px;gap:6px;white-space:normal;max-width:46%}
 .finance-panel .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .finance-panel .stat{padding:16px}
 .finance-panel .stat strong{font-size:20px;overflow-wrap:anywhere}
 .finance-panel .stat .note{font-size:10px}
 .finance-panel .stat-top{gap:8px}
 .finance-panel .stat-top .finance-icon{width:18px;height:18px;flex-basis:18px}
 .finance-panel .panel-hero{min-height:164px;padding:24px}
 .finance-panel .panel-hero h2{font-size:20px}
 .finance-panel .form-grid{grid-template-columns:minmax(0,1fr)}
 .finance-panel .field:first-child{grid-column:auto}
 .finance-date-fields{gap:12px;grid-template-columns:minmax(0,.8fr) minmax(0,1.3fr) minmax(0,1fr)}
 .finance-panel .finance-date-fields select{padding-inline-start:10px;padding-inline-end:28px;background-position:left 8px center}
 .finance-panel .finance-pagination{flex-wrap:wrap}
 .finance-pagination .actions{margin-inline-start:auto}
 .audit-entry summary{gap:8px;align-items:flex-start}
 .audit-entry summary strong{flex-basis:100%}
 .finance-audit-meta{gap:12px}
 .finance-audit-meta .text-link{margin:0}
 .finance-auth .auth-title{font-size:23px}
 .finance-auth .auth-story-banner .auth-art{position:absolute;inset:0;width:100%;height:100%;max-width:none;border-radius:0}
}
@media(forced-colors:active){.finance-panel .field select{appearance:auto;background-image:none}.finance-icon{background:CanvasText}}
@media print{.finance-panel .workspace{display:block;margin:0;padding:0}.finance-panel .heading,.finance-panel .stats{display:flex}.finance-panel .heading .button,.finance-filter,.finance-panel .panel-hero,.finance-panel .sidebar,.finance-panel header,.finance-panel footer,.finance-panel .actions,.finance-panel .text-link{display:none}.finance-panel .card{break-inside:avoid}.finance-panel .panel-content{max-width:none;padding:0}}

/* Auth uses the same spacing and control rhythm as the panel. */
.finance-auth .finance-auth-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--panel-section-gap);margin-top:var(--panel-section-gap)}
.finance-auth .finance-auth-heading .auth-title{margin:0;min-width:0}
.finance-auth .finance-auth-heading .text-link{flex-shrink:0}
.finance-auth .finance-auth-form{display:grid;gap:var(--panel-section-gap);margin-top:var(--panel-section-gap)}
.finance-auth .finance-auth-form label{display:grid;gap:8px;margin:0}
.finance-auth .finance-auth-form input{margin:0;height:var(--panel-action-height);min-height:var(--panel-action-height)}
.finance-auth .finance-auth-form>button{margin:0;min-height:var(--panel-action-height)}
.finance-auth .finance-auth-resend{margin-top:var(--panel-section-gap);display:flex;justify-content:center}
.finance-auth .finance-auth-resend>.text-link{width:auto;margin:0;background:transparent;color:var(--panel-action-primary);font-weight:400}
.finance-auth .finance-auth-resend>.text-link:hover{background:transparent;text-decoration:underline;text-underline-offset:4px}
.finance-auth .finance-otp{text-align:center;letter-spacing:.35em;font-size:23px}
.finance-auth .auth-amin-link{display:flex;width:fit-content;margin-inline:auto;font-size:12px;color:#756c7e}
.finance-auth .auth-card-footer{margin-top:var(--panel-section-gap)}
.finance-auth .auth-story-banner{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:var(--panel-section-gap);min-height:650px;background:#e8ddea;padding:32px}
.finance-auth .auth-story-banner .auth-art{position:absolute;inset:0;width:100%;height:100%;max-width:none;aspect-ratio:auto;border-radius:0;margin:0;pointer-events:none}
.finance-auth .auth-story-banner .auth-art::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(244,235,246,.94) 0%,rgba(244,235,246,.78) 27%,rgba(235,219,239,.08) 57%,rgba(35,12,43,.5) 100%)}
.finance-auth .auth-story-banner .auth-construction{display:block;width:100%;height:100%;object-fit:cover;object-position:44% center}
.finance-auth .auth-story-banner .story-copy{margin:0 0 auto;z-index:1}
.finance-auth .auth-story-banner .story-footer{position:relative;z-index:1;color:#fff}
.finance-auth .auth-story-banner .status-dot{background:#e8c8ed}
@media(max-width:800px){
 .finance-auth .auth-story-banner{min-height:184px;padding:24px;gap:16px}
 .finance-auth .auth-story-banner .auth-art{display:block}
 .finance-auth .auth-story-banner .auth-construction{object-position:center 55%;width:100%;height:100%;mask-image:none}
 .finance-auth .auth-story-banner .auth-art::after{background:linear-gradient(270deg,rgba(244,235,246,.97),rgba(244,235,246,.87) 40%,rgba(244,235,246,.12))}
 .finance-auth .auth-story-banner .story-copy{display:block}
 .finance-auth .auth-story-banner .story-copy h1{font-size:23px;margin:0}
 .finance-auth .auth-story-banner .story-footer{display:none}
 .finance-auth .finance-auth-heading{gap:12px}
}

/* Account settings reuse the panel controls and spacing. */
.finance-account-note{padding-bottom:var(--panel-section-gap)}
.finance-badge.archived{background:var(--canvas);color:var(--muted)}
.finance-panel .finance-row-actions form{margin:0}
.finance-panel .card-heading{gap:var(--panel-section-gap);flex-wrap:wrap;align-items:center}
.finance-panel .field>label{font-weight:400}
@media(max-width:700px){.finance-panel .finance-row-actions{gap:var(--panel-section-gap)}.finance-panel .card-heading>.text-link{font-size:12px}}

/* Each account owns its values and copy controls, including on narrow screens. */
.finance-account-list{display:grid;gap:var(--panel-section-gap)}
.finance-account-item{display:grid;gap:var(--panel-section-gap);min-width:0;border:1px solid var(--line);border-radius:var(--radius);padding:var(--panel-section-gap)}
.finance-account-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--panel-section-gap)}
.finance-account-heading h3{margin:0;font-size:16px;overflow-wrap:anywhere;min-width:0}
.finance-account-details{display:grid;gap:var(--panel-section-gap);margin:0;min-width:0}
.finance-account-detail{display:grid;grid-template-columns:minmax(110px,.65fr) minmax(0,2fr) auto;align-items:center;gap:var(--panel-section-gap);min-width:0}
.finance-account-detail dt{font-size:13px;color:var(--muted)}
.finance-account-detail dd{margin:0;min-width:0;overflow-wrap:anywhere;font-size:14px}
.finance-account-detail dd small{display:block;font-size:12px}
.finance-panel .finance-account-actions{flex-wrap:wrap}
.finance-panel button.finance-copy-field{background:transparent;border:0;border-radius:4px;padding:0;cursor:pointer;font:inherit;color:var(--panel-action-primary);display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.finance-panel button.finance-copy-field:hover{text-decoration:underline;text-underline-offset:4px}
.finance-panel button.finance-copy-field:focus-visible{outline:2px solid currentColor;outline-offset:4px}
.finance-legacy-note{font-size:13px;line-height:1.9;color:var(--muted)}
.finance-copy-status{overflow-wrap:anywhere;margin:0}
.finance-copy-status:empty{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.finance-clipboard-fallback{position:fixed;inset:0 auto auto -10000px;opacity:0}
.finance-account-copy-action{display:flex;align-items:center;justify-content:flex-end}
.finance-panel .finance-account-note{padding-bottom:0;margin:0}
.finance-panel [aria-labelledby="accounts-title"]{display:grid;gap:var(--panel-section-gap)}
.finance-panel [aria-labelledby="accounts-title"]>.card-heading{margin:0}
@media(max-width:700px){
 .finance-account-detail{grid-template-columns:minmax(0,1fr) auto;row-gap:0}
 .finance-account-detail dt{grid-column:1;grid-row:1}
 .finance-account-detail dd:not(.finance-account-copy-action){grid-column:1;grid-row:2}
 .finance-account-detail .finance-account-copy-action{grid-column:2;grid-row:1/3}
 .finance-account-actions>.button{flex:1 1 auto}
}
@media print{.finance-copy-field,.finance-copy-status,.finance-account-actions{display:none!important}}

/* Searchable pickers share the native field and panel focus rhythm. */
.finance-picker{position:relative;min-width:0}
.finance-combobox-control{position:relative;min-width:0}
.finance-panel .finance-combobox-control input{width:100%;padding-inline-end:48px}
.finance-panel .finance-combobox-toggle{position:absolute;inset-block:0;inset-inline-end:0;display:flex;align-items:center;justify-content:center;width:44px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer}
.finance-combobox-toggle svg{width:18px;height:18px}
.finance-combobox-toggle[hidden],.finance-combobox-list[hidden]{display:none}
.finance-combobox-toggle:focus-visible{outline:2px solid var(--panel-action-primary);outline-offset:-3px}
.finance-combobox-list{position:absolute;z-index:5;inset-inline:0;top:calc(100% - 1px);max-height:240px;overflow:auto;overscroll-behavior:contain;list-style:none;padding:4px;margin:0;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 6px 20px #00000014;font-size:14px;font-weight:400}
.finance-combobox-list [role=option]{display:flex;align-items:center;min-height:var(--panel-action-height);padding:8px 12px;border-radius:4px;cursor:pointer;overflow-wrap:anywhere;white-space:normal}
.finance-combobox-list [role=option]:hover,.finance-combobox-list [aria-selected=true]{background:var(--canvas);color:var(--panel-action-primary)}
.finance-combobox-empty{padding:12px;color:var(--muted);white-space:normal}
.finance-panel .finance-entry-counterparty{color:var(--panel-action-primary);font-weight:500;white-space:normal;overflow-wrap:anywhere}
