/* r545 · finance: floating action menu */
.fw-menu{position:relative}
.fw-menu>.fw-menu-content{position:fixed;left:0;top:0;z-index:1400;box-sizing:border-box;display:grid;gap:2px;margin:0;padding:6px;min-width:200px;max-width:min(320px,calc(100vw - 16px));border:1px solid #e3e9f2;border-radius:12px;background:#fff;box-shadow:0 14px 34px rgba(15,23,42,.14),0 2px 6px rgba(15,23,42,.06);visibility:hidden}
.fw-menu[open]>.fw-menu-content[data-placed]{visibility:visible;animation:fw545-pop .12s ease-out}
@keyframes fw545-pop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.fw-menu>.fw-menu-content>button,.fw-menu>.fw-menu-content>.btn{display:flex;align-items:center;width:100%;min-height:36px;margin:0!important;padding:8px 12px!important;border:0!important;border-radius:8px!important;background:transparent!important;box-shadow:none!important;color:#1f3550!important;font-family:inherit;font-size:14px!important;font-weight:500!important;line-height:1.35!important;text-align:left;justify-content:flex-start;white-space:nowrap;cursor:pointer}
.fw-menu>.fw-menu-content>button:hover:not(:disabled),.fw-menu>.fw-menu-content>.btn:hover:not(:disabled){background:#f1f5fa!important}
.fw-menu>.fw-menu-content>button:disabled{opacity:.5;cursor:default}
.fw-menu[open]>summary{background:#f4f7fb;border-color:#adc3de}
.detail-actions>.fw-menu>summary{box-sizing:border-box;display:inline-flex;align-items:center;gap:8px;height:40px;min-height:40px;padding:0 14px;border:1px solid #dce4ee;border-radius:10px;background:#fff;color:#2f465e;font-size:14px;font-weight:600}
.detail-actions>.fw-menu>summary>span{display:inline-block;width:7px;height:7px;font-size:0;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}

/* r545 · finance dialogs: centred, sized to their content */
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-kicker{min-height:0;padding:0;border-radius:0;background:none;color:#7a889c;font-size:11px;font-weight:700;letter-spacing:.07em}
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-title{font-size:21px;line-height:1.25;font-weight:700;letter-spacing:-.02em}
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-description{font-size:13px;color:#66758b}
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-head-copy{gap:5px}
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-head{padding:0}
.bottom-sheet-overlay .bottom-sheet:has(.fw-sheet-registers)>.bottom-sheet-footer{display:none}
@media (min-width:761px){
  body .bottom-sheet-overlay:has(.fw-sheet){align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet){--fw545-w:560px;width:min(var(--fw545-w),100%);height:auto;max-height:min(900px,calc(100dvh - 48px));margin:0;padding:24px;gap:20px;border-radius:18px;grid-template-rows:auto minmax(0,1fr) auto;box-shadow:0 30px 80px rgba(15,23,42,.24)}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet)>.bottom-sheet-handle{display:none}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet)>.bottom-sheet-head{grid-row:1}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet)>.bottom-sheet-body{grid-row:2;scrollbar-gutter:auto}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet)>.bottom-sheet-footer{grid-row:3;padding:0}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet):not(:has(>.bottom-sheet-footer)){grid-template-rows:auto minmax(0,1fr)}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet-create){--fw545-w:520px}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet-client){--fw545-w:620px}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet-registers){--fw545-w:1200px;height:min(900px,calc(100dvh - 48px));grid-template-rows:auto minmax(0,1fr)}
}

/* new invoice: choose client */
.bottom-sheet-body .fw-sheet-create{display:grid;gap:16px}
.bottom-sheet-body .fw-sheet-create>.fw-primary{width:100%;min-height:44px;border-radius:10px;font-size:14px}
.bottom-sheet-body .fw-sheet-create>.fw-primary:disabled{cursor:default;opacity:.45}
.bottom-sheet-body .fw-sheet-create>p{margin:0;color:#7a889c;font-size:13px}

/* client card */
.bottom-sheet-body>.drawer-content.fw-sheet-client{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.bottom-sheet-body>.drawer-content.fw-sheet-client>:not(.btn-secondary){grid-column:1/-1}
.bottom-sheet-body>.drawer-content.fw-sheet-client>dl{display:grid;grid-template-columns:none;grid-template-rows:auto auto;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0 10px;margin:0 0 4px}
.bottom-sheet-body>.drawer-content.fw-sheet-client>dl>dt{margin:0;padding:12px 14px 4px;border-radius:12px 12px 0 0;background:#f4f7fb;color:#66758b;font-size:12px;font-weight:500;line-height:1.35}
.bottom-sheet-body>.drawer-content.fw-sheet-client>dl>dd{margin:0;padding:0 14px 13px;border-radius:0 0 12px 12px;background:#f4f7fb;color:#18263a;font-size:17px;font-weight:700;line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bottom-sheet-body>.drawer-content.fw-sheet-client>dl>dd:last-of-type{font-size:14px;padding-top:3px;white-space:normal}
.bottom-sheet-body>.drawer-content.fw-sheet-client>dl>dd.negative{color:#c23b48}
.bottom-sheet-body>.drawer-content.fw-sheet-client>.btn-primary{width:100%;min-height:44px}
.bottom-sheet-body>.drawer-content.fw-sheet-client>.btn-secondary{width:100%;min-height:40px}
.bottom-sheet-body>.drawer-content.fw-sheet-client>p{margin:0}

/* small finance forms (payment, reversal, adjustment) */
.bottom-sheet-body>.drawer-content.fw-sheet-form{gap:14px}

/* registers and invoices */
.bottom-sheet-body .register-panel.fw-sheet-registers{gap:14px;align-content:start}
.bottom-sheet-body .fw-sheet-registers>.fw-register-steps{padding:4px;border-radius:12px;background:#f4f7fb;gap:4px}
.bottom-sheet-body .fw-sheet-registers>.fw-register-steps li{justify-content:center;padding:8px 10px;border-radius:9px;font-size:13px}
.bottom-sheet-body .fw-sheet-registers>.fw-register-steps li.active{background:#fff;box-shadow:0 1px 3px rgba(27,53,91,.1)}
.bottom-sheet-body .fw-sheet-registers>.fw-register-steps li>span{width:22px;height:22px;font-size:12px}
.bottom-sheet-body .fw-sheet-registers>.fw-disclosure{border-radius:12px}
.bottom-sheet-body .fw-sheet-registers>.fw-disclosure>summary{padding:12px 14px;font-size:14px;color:#0b5fcc;list-style:none}
.bottom-sheet-body .fw-sheet-registers>.fw-disclosure>summary::-webkit-details-marker{display:none}
.bottom-sheet-body .fw-sheet-registers>.fw-disclosure>summary::before{content:"+";display:inline-block;width:16px;font-weight:700}
.bottom-sheet-body .fw-sheet-registers>.fw-disclosure[open]>summary::before{content:"−"}
.bottom-sheet-body .fw-sheet-registers .register-create{border:0;padding:0;background:none}
.bottom-sheet-body .fw-sheet-registers .register-list{gap:6px}
.bottom-sheet-body .fw-sheet-registers .register-list>button{padding:11px 14px;border-radius:10px;border-color:#e3e9f2;transition:border-color .12s,background .12s}
.bottom-sheet-body .fw-sheet-registers .register-list>button:hover:not(.active){border-color:#bcd0ea;background:#fafcff}
.bottom-sheet-body .fw-sheet-registers .register-list>button.active{border-color:#2f7fe6;background:#f0f6ff;box-shadow:0 0 0 1px #2f7fe6 inset}
.bottom-sheet-body .fw-sheet-registers .table-pagination{padding:4px 0 0;border:0}
.bottom-sheet-body .fw-sheet-registers .register-detail{align-content:start;gap:16px;padding:20px;border:1px solid #e3e9f2;border-radius:14px;background:#fff}
.bottom-sheet-body .fw-sheet-registers .register-detail .detail-head{align-items:center}
.bottom-sheet-body .fw-sheet-registers .register-detail .detail-head h3{margin:0 0 4px;font-size:17px;font-weight:700}
.bottom-sheet-body .fw-sheet-registers .register-detail .detail-head>strong{font-size:20px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.bottom-sheet-body .fw-sheet-registers .register-detail .detail-actions{align-items:center;gap:8px}
.bottom-sheet-body .fw-sheet-registers .document-list>button,.bottom-sheet-body .fw-sheet-registers .document-list>div>button{padding:0;border:0;background:none;color:#0b5fcc;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.bottom-sheet-body .fw-sheet-registers .document-list{align-items:flex-start}
.bottom-sheet-body .fw-sheet-registers .document-list>div{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid #e9eef5;border-radius:10px}
.bottom-sheet-body .fw-sheet-registers .line-list article{padding:10px 14px;border-color:#edf1f6;border-radius:10px}

/* invoice form */
.bottom-sheet-body .fw-sheet-registers .invoice-editor{gap:16px;padding:20px;border:1px solid #dbe6f5;border-radius:14px;background:#f8fbff}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>h3{font-size:17px;font-weight:700}
.bottom-sheet-body .fw-sheet-registers .invoice-editor :is(label){display:grid;gap:6px;color:#4a5b73;font-size:12px;font-weight:600}
.bottom-sheet-body .fw-sheet-registers .invoice-editor input{min-height:40px;padding:9px 12px;border:1px solid #d3deeb;border-radius:9px;background:#fff;color:#18263a;font-size:14px;font-weight:400;transition:border-color .12s,box-shadow .12s}
.bottom-sheet-body .fw-sheet-registers .invoice-editor input:focus{outline:0;border-color:#2f7fe6;box-shadow:0 0 0 3px rgba(47,127,230,.15)}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.issuer-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:end;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.issuer-form>.fw-button{justify-self:start}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines{gap:8px;padding:12px;border:1px solid #e3e9f2;border-radius:12px;background:#fff}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article,.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>.fw545-line-head{display:grid;grid-template-columns:minmax(0,1fr) 96px 72px 120px 40px;gap:8px;align-items:center}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>.fw545-line-head{padding:0 2px 2px;color:#7a889c;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article>input:nth-of-type(2),.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article>input:nth-of-type(4){text-align:right;font-variant-numeric:tabular-nums}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article>.btn{width:40px;min-width:40px;height:40px;min-height:40px;padding:0!important;justify-content:center;border-color:transparent!important;background:transparent!important;color:#8a97a9!important;font-size:16px}
.bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article>.btn:hover:not(:disabled){background:#fdecee!important;color:#c23b48!important}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions:has(>strong){justify-content:space-between}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions:has(>strong)>.btn{min-height:36px;padding:0 4px!important;border-color:transparent!important;background:transparent!important;box-shadow:none!important;color:#0b5fcc!important}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions:has(>strong)>.btn:hover:not(:disabled){text-decoration:underline}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions>strong{font-size:17px;font-variant-numeric:tabular-nums}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions:last-child{padding-top:4px;border-top:1px solid #e3e9f2}
.bottom-sheet-body .fw-sheet-registers .invoice-editor>.detail-actions:last-child>.btn-primary{min-width:220px}
.bottom-sheet-body .fw-sheet-registers .invoice-editor~.line-list,.bottom-sheet-body .fw-sheet-registers .issuer-form~.line-list{display:none}
.bottom-sheet-body .fw-sheet-registers form.issuer-form{padding:20px;border:1px solid #dbe6f5;border-radius:14px;background:#f8fbff;gap:12px}

@media (min-width:1001px){
  .bottom-sheet-overlay .bottom-sheet>.bottom-sheet-body:has(>.register-panel.fw-sheet-registers>.register-detail){overflow:hidden}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail){height:100%;grid-template-columns:minmax(300px,360px) minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr) auto;column-gap:20px;row-gap:12px;align-items:start}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>*{grid-column:1;min-width:0}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.fw-register-steps{grid-column:1/-1;grid-row:1}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>p{grid-row:2}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.fw-disclosure{grid-row:3;max-height:46vh;overflow:auto}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.register-list{grid-row:4;align-self:stretch;min-height:0;overflow-y:auto;padding:2px 4px 2px 2px;align-content:start}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.table-pagination{grid-row:5;flex-wrap:wrap;gap:8px}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.table-pagination .table-pagination__summary label{display:none}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail)>.register-detail{grid-column:2;grid-row:2/6;align-self:stretch;min-height:0;overflow-y:auto;overscroll-behavior:contain}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail) .register-create{grid-template-columns:1fr 1fr}
  .bottom-sheet-body .register-panel.fw-sheet-registers:has(>.register-detail) .register-create>:nth-child(n+3){grid-column:1/-1}
}
@media (max-width:760px){
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet)>.bottom-sheet-head{flex-direction:row;align-items:flex-start}
  .bottom-sheet-overlay .bottom-sheet:has(.fw-sheet) .bottom-sheet-title{font-size:19px}
  .bottom-sheet-body>.drawer-content.fw-sheet-client>dl{grid-auto-flow:row;grid-template-rows:none;grid-template-columns:1fr auto;gap:8px 12px}
  .bottom-sheet-body>.drawer-content.fw-sheet-client>dl>:is(dt,dd){padding:0;background:none;border-radius:0}
  .bottom-sheet-body>.drawer-content.fw-sheet-client>dl>dd{font-size:15px;text-align:right}
  .bottom-sheet-body>.drawer-content.fw-sheet-client{grid-template-columns:1fr}
  .bottom-sheet-body .fw-sheet-registers .invoice-editor>.issuer-form{grid-template-columns:1fr}
  .bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>.fw545-line-head{display:none}
  .bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article{grid-template-columns:1fr 1fr 40px}
  .bottom-sheet-body .fw-sheet-registers .invoice-edit-lines>article>input:first-child{grid-column:1/-1}
}
.bottom-sheet-body .fw-sheet-registers form.issuer-form input,.bottom-sheet-body .fw-sheet-registers .register-create input{min-height:40px;padding:9px 12px;border:1px solid #d3deeb;border-radius:9px;background:#fff;color:#18263a;font-size:14px;font-weight:400}
.bottom-sheet-body .fw-sheet-registers form.issuer-form input:focus,.bottom-sheet-body .fw-sheet-registers .register-create input:focus{outline:0;border-color:#2f7fe6;box-shadow:0 0 0 3px rgba(47,127,230,.15)}
.bottom-sheet-body .fw-sheet-form input,.bottom-sheet-body .fw-sheet-form textarea{font-weight:400}
