:root{
  font-family:"Segoe UI",Tahoma,Arial,sans-serif;
  color:#0f172a;
  background:#f6f8fb;
  font-synthesis:none;
  --ink:#0f172a;
  --muted:#7a8aa3;
  --line:#dfe7f0;
  --green:#0aa27a;
  --green-dark:#067a5d;
  --green-soft:#eefcf7;
  --blue:#2f66e9;
  --amber:#df7a00;
  --red:#db1237;
  --navy:#17243a;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-width:320px;background:#f6f8fb;color:var(--ink)}
body.modal-open{overflow:hidden}
button,input,select{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(47,102,233,.18);outline-offset:2px}
svg{display:block}
.app-shell{max-width:1620px;margin:0 auto;padding:24px 28px 44px}
.topbar,.stat-card,.payment-workspace,.shop-card,.distribution-card,.registry{border-radius:18px}
.topbar{background:#fff;border:1px solid #dce5ee;box-shadow:0 1px 2px rgba(15,23,42,.03);display:flex;justify-content:space-between;align-items:center;padding:24px 26px;gap:24px}
.brand{display:flex;gap:16px;align-items:center;min-width:0}
.brand-icon{width:58px;height:58px;flex:0 0 58px;border-radius:16px;background:#13aa84;color:#fff;display:grid;place-items:center;box-shadow:0 10px 22px rgba(5,150,105,.18)}
.brand-icon svg{width:30px;height:30px;stroke-width:1.8}
.brand-copy{min-width:0}
.brand-line{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.brand-line h1{font-size:31px;line-height:1.15;margin:0;font-weight:800;letter-spacing:-.4px}
.brand-line span{font-size:12px;color:#087a5d;background:#dcfce7;border:1px solid #a7f3d0;padding:5px 11px;border-radius:999px;font-weight:700}
.brand p{color:#7b8aa3;margin:8px 0 0;font-size:15px}
.top-actions{display:flex;gap:10px;align-items:center;direction:rtl;flex-wrap:wrap;justify-content:flex-start}
.top-actions button,.primary,.secondary-action,.amber-primary{border:0;border-radius:12px;padding:13px 18px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:9px;min-height:48px;box-shadow:0 1px 1px rgba(15,23,42,.04)}
.top-actions svg{width:18px;height:18px}
.dark{background:#101a2c;color:#fff}.blue{background:#285ee3;color:#fff}.warning{background:#e57900;color:#fff}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:28px 0}
.stat-card{background:#fff;border:1px solid #dce5ee;min-height:132px;padding:24px 20px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.stat-copy{display:flex;flex-direction:column;gap:8px;min-width:0}
.stat-copy .label{font-size:14px;color:#8b99b0}
.stat-copy strong{font-size:29px;line-height:1.1;white-space:nowrap;letter-spacing:.2px}
.stat-copy small{font-size:13px;color:#7b8aa3}
.stat-icon{width:58px;height:58px;border-radius:16px;display:grid;place-items:center;flex:0 0 58px}
.stat-icon svg{width:27px;height:27px;stroke-width:1.9}
.stat-card.green .stat-icon{background:#e9fbf5;color:#058661}.stat-card.green strong,.stat-card.green small{color:#07805f}
.stat-card.blue .stat-icon{background:#edf4ff;color:#2b64e8}.stat-card.indigo .stat-icon{background:#eef1ff;color:#4b56e8}
.stat-card.red{border-color:#f8b8c3;background:linear-gradient(90deg,#fffafa,#fff)}.stat-card.red .stat-icon{background:#fff0f2;color:#d71943}.stat-card.red strong,.stat-card.red .label{color:#d3153c}.stat-card.red small{color:#e02348}
.dashboard-workspace{display:grid;grid-template-columns:minmax(0,2.22fr) minmax(330px,.94fr);gap:28px;align-items:start;margin-bottom:30px}
.payment-workspace{background:#fff;border:2px solid #b9ecd9;box-shadow:0 1px 2px rgba(15,23,42,.03);min-height:610px;padding:30px 32px}
.workspace-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:20px;border-bottom:1px solid #edf2f7}
.workspace-title{display:flex;align-items:center;gap:14px}.workspace-title .square-icon{width:48px;height:48px;background:#069f77;color:#fff;border-radius:14px;display:grid;place-items:center;box-shadow:0 8px 20px rgba(5,150,105,.15)}.workspace-title h2{margin:0;font-size:23px}.workspace-title p{margin:6px 0 0;color:#8492a8;font-size:13px}.selected-chip{display:inline-flex;align-items:center;gap:7px;color:#087a5d;background:#e8fff6;border:1px solid #9ce9cb;border-radius:999px;padding:7px 12px;font-size:13px;font-weight:800}.selected-chip::before{content:"";width:9px;height:9px;border-radius:50%;background:#19b986}
.selector-box{margin:22px 0 20px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:15px;padding:18px;display:grid;grid-template-columns:1fr 1fr;gap:16px}
.field-block label{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:800;margin-bottom:8px;color:#263247}.field-block label .hint{margin-inline-start:auto;color:#079b70;font-size:12px;font-weight:700}.select-like,.field-input{height:48px;border:1px solid #cfd9e6;border-radius:12px;background:#fff;padding:0 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:700;color:#122036}.field-block select{width:100%;height:48px;border:1px solid #cfd9e6;border-radius:12px;background:#fff;padding:0 14px;color:#122036;font-weight:700}
.payment-summary{background:linear-gradient(90deg,#effcf7,#fbfffd);border:1px solid #b8ecd7;border-radius:14px;padding:16px 18px;margin-bottom:22px}.summary-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.summary-item{padding:6px 12px;text-align:right}.summary-item span{display:block;color:#8b98ad;font-size:12px;margin-bottom:5px}.summary-item strong{font-size:17px}.summary-item small{display:block;color:#8290a5;font-size:11px;margin-top:4px}.summary-item .pill{display:inline-block;background:#059669;color:#fff;border-radius:5px;padding:4px 9px;font-size:14px}.summary-bottom{border-top:1px solid #c8eee0;margin-top:12px;padding-top:11px;display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:12px}.status-pair{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.status-badge{background:#c9f7e4;color:#087657;border-radius:5px;padding:5px 9px;font-weight:700}.cin-chip{background:#fff;border:1px solid #dbe5ef;border-radius:5px;padding:5px 9px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-weight:700}.debt-chip{display:flex;align-items:center;gap:8px;color:#b51236;font-weight:800}.debt-chip b{background:#fff4f6;border:1px solid #f4b5c1;border-radius:6px;padding:5px 9px}
.amount-section{margin-top:10px}.amount-label{font-size:13px;font-weight:800;margin-bottom:8px}.amount-box{position:relative}.amount-box input{width:100%;height:62px;border:2px solid #cdd8e6;border-radius:13px;padding:0 18px 0 62px;font-size:23px;font-weight:800;background:#fff}.amount-box span{position:absolute;left:17px;top:50%;transform:translateY(-50%);color:#9aa8bb;font-weight:700}.multiple-caption{display:flex;justify-content:space-between;align-items:center;margin:12px 0 9px;font-size:12px;color:#536178}.multiple-caption small{color:#a0aabd}.multiples{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}.multiples button{min-height:58px;background:#f8fafc;border:1px solid #dbe4ef;border-radius:12px;color:#142033}.multiples button strong{display:block;font-size:14px}.multiples button small{display:block;margin-top:4px;color:#627086;font-size:11px}.multiples button.active{background:#079e74;color:#fff;border-color:#079e74}.multiples button.active small{color:#eafff7}
.payment-fields{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(220px,.72fr);gap:14px;margin-top:16px}.payment-fields input{height:48px;border:1px solid #cfd9e6;border-radius:12px;padding:0 14px;width:100%;background:#fff}.validation-error{margin-top:18px;background:#fff2f4;border:2px solid #ff8da1;border-radius:14px;color:#c0163e;padding:16px 18px;font-size:13px}.validation-error strong{font-size:14px}.validation-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.validation-actions button{border:1px solid #f2a3b1;border-radius:9px;background:#fff;color:#bd173c;padding:8px 12px;font-weight:700}.payment-actions{display:flex;align-items:center;justify-content:flex-start;gap:10px;margin-top:18px;flex-wrap:wrap}.payment-actions button{min-height:46px;border-radius:11px;padding:0 16px;border:1px solid #d9e2ec;background:#f7f9fc;display:flex;align-items:center;gap:7px;font-weight:800}.payment-actions .save-payment{background:#059c75;color:#fff;border-color:#059c75;box-shadow:0 8px 16px rgba(5,156,117,.15)}.payment-actions .exit-action{background:#edf5ff;color:#1856df;border-color:#bcd2ff}.payment-actions .alert-action{background:#fff8eb;color:#b95b00;border-color:#f5c876}.next-total{margin-inline-start:auto;color:#77869d;font-size:12px}.next-total strong{display:block;color:#07845f;font-size:14px;margin-top:2px}
.shop-sidebar{display:flex;flex-direction:column;gap:18px}.shop-card{background:#fff;border:1px solid #dce5ee;padding:22px 22px 20px;box-shadow:0 1px 2px rgba(15,23,42,.03)}.shop-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:14px}.shop-card .shop-title h3{font-size:22px;margin:8px 0 0}.shop-badge{display:inline-block;background:#ebfff7;color:#07805e;border:1px solid #a5eecf;border-radius:999px;padding:5px 11px;font-size:12px;font-weight:700}.rank-chip{width:48px;height:48px;border-radius:14px;background:#f2f5f9;display:grid;place-items:center;font-weight:900;font-size:18px}.shop-details{margin-top:10px}.detail-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #edf2f7;font-size:13px}.detail-row .label{color:#95a2b5}.detail-row .value{font-weight:800}.detail-row.highlight-red{background:#fff7f8;border:1px solid #ffd2da;border-radius:7px;padding:10px 12px;margin-top:7px;color:#c21239}.detail-row.highlight-green{color:#087d5e}.detail-row .late{color:#bc5f00}.side-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}.side-actions button{height:40px;border:0;border-radius:10px;background:#f0f4f8;color:#1e293b;font-weight:800;display:flex;align-items:center;justify-content:center;gap:7px}.side-actions .wide{grid-column:1/-1;background:linear-gradient(90deg,#2f67ea,#5544ed);color:#fff}
.distribution-card{background:#18253a;color:#fff;padding:22px}.distribution-head{display:flex;align-items:center;gap:8px;color:#1ad19a;font-weight:800;margin-bottom:13px}.distribution-list{display:flex;flex-direction:column;gap:9px}.distribution-item{display:flex;align-items:center;justify-content:space-between;background:#223149;border-radius:8px;padding:9px 10px;font-size:12px}.distribution-item b{background:#31435e;border-radius:6px;padding:4px 8px;font-size:11px}
.registry{background:#fff;border:1px solid #dce5ee;box-shadow:0 1px 2px rgba(15,23,42,.03);overflow:hidden}.registry-head{padding:22px 24px;display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid #e5edf5}.registry-title{display:flex;align-items:center;gap:12px}.registry-icon{width:42px;height:42px;background:#f2f5f9;border-radius:12px;display:grid;place-items:center;color:#38475e}.registry h2{margin:0;font-size:22px}.registry p{margin:5px 0 0;color:#8492a8;font-size:13px}.filters{display:flex;gap:10px;direction:ltr}.search{display:flex;align-items:center;gap:8px;border:1px solid #cfd9e6;border-radius:12px;padding:0 11px;background:#fff;color:#7e8ca2}.search input{border:0;outline:0;width:255px;height:44px;direction:rtl}.filters select{height:44px;border:1px solid #cfd9e6;border-radius:12px;padding:0 14px;background:#fff;min-width:160px;direction:rtl}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:1160px}th{background:#f8fafc;color:#4c5b70;font-size:12px;text-align:right;padding:14px 12px;border-bottom:1px solid #dce5ee;white-space:nowrap}th.sort-red{color:#c21638}td{padding:13px 12px;border-bottom:1px solid #edf1f5;font-size:13px;vertical-align:middle}tbody tr:hover,tbody tr.selected-row{background:#f4fff9}.shop-number{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#f1f5f9;font-weight:900}.row-person{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.row-person strong{font-weight:800}.cin{display:inline-block;background:#f2f5f8;color:#9aa7ba;padding:4px 7px;border-radius:5px;font-size:10px;font-family:ui-monospace,Consolas,monospace}.positive{color:#00875f;font-weight:800}.negative{color:#d70b33;font-weight:800}.zero-muted{color:#9aa7ba;font-weight:700}.badge{display:inline-block;padding:5px 9px;border-radius:5px;font-size:11px;font-weight:800}.badge.danger{background:#fff0f2;color:#c00f37;border:1px solid #ffc7d1}.badge.success{background:#d7f8e9;color:#08775a}.badge.neutral{background:#f1f5f9;color:#187765}.row-actions{display:flex;gap:6px;align-items:center;direction:ltr}.row-actions button{width:32px;height:32px;border:0;background:#f1f5f9;border-radius:9px;display:grid;place-items:center;color:#475569}.row-actions button svg{width:16px;height:16px}.row-actions .pay{width:auto;padding:0 10px;background:#e7fbf3;color:#08785b;font-weight:800;display:flex;gap:5px}.row-actions .alert-btn{background:#fff9e9;color:#b65a00}.row-actions .exit-btn{background:#eef4ff;color:#255edf}.row-actions .delete-btn{color:#9ba8ba;background:transparent}.table-footer{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;color:#68778e;font-size:12px}.pager{display:flex;align-items:center;gap:12px}.pager button{width:34px;height:34px;border:1px solid #dce5ee;background:#fff;border-radius:9px}.pager button:disabled{opacity:.45}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.58);backdrop-filter:blur(4px);display:grid;place-items:center;padding:14px;z-index:100}.modal{width:min(1160px,96vw);height:min(92vh,900px);background:#fff;border-radius:18px;box-shadow:0 34px 90px rgba(15,23,42,.36);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr auto}.modal-close{border:0;background:rgba(255,255,255,.12);color:#fff;border-radius:10px;width:38px;height:38px;display:grid;place-items:center}.modal-close.light{background:#eef2f7;color:#4b5a70}.modal-close svg{width:19px;height:19px}.doc-header{padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px;color:#fff}.doc-header.blue-head{background:#1b2940}.doc-header.amber-head{background:linear-gradient(90deg,#a94708,#bd5605)}.doc-title-group{display:flex;align-items:center;gap:12px}.doc-title-icon{width:46px;height:46px;border-radius:12px;background:#2c67f1;display:grid;place-items:center}.doc-header h2{margin:0;font-size:20px}.doc-header p{margin:5px 0 0;font-size:12px;color:#9fb0c9}.doc-header.amber-head p{color:#ffc78f}.header-tools{display:flex;align-items:center;gap:9px;direction:ltr}.scope-tabs{display:flex;gap:5px;background:#22334c;border-radius:12px;padding:4px;direction:rtl}.scope-tabs button{border:0;background:transparent;color:#dbe6f5;border-radius:9px;height:36px;padding:0 13px;font-weight:800;font-size:12px}.scope-tabs button.active{background:#2e68ec;color:#fff}.header-tool{height:36px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:#fff;border-radius:10px;padding:0 11px;display:flex;align-items:center;gap:6px;font-weight:800;font-size:12px}.header-tool.pdf{background:#e98000;border-color:#e98000}.header-tool.print-white{background:#fff;color:#9f4b0b;border-color:#fff}.selection-count{background:#b66a15;color:#ffe0b6;border-radius:7px;padding:7px 10px;font-size:11px;font-weight:800}
.notice-strip{padding:11px 22px;background:#fff8e5;color:#9a4d12;border-bottom:1px solid #f1cc75;font-size:12px}.doc-controls{padding:10px 22px;background:#fffaf0;border-bottom:1px solid #f4dfad;display:flex;align-items:center;gap:16px;flex-wrap:wrap}.doc-controls label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800}.doc-controls input,.doc-controls select{height:34px;border:1px solid #edb746;border-radius:9px;background:#fff;padding:0 10px;min-width:175px}.doc-controls .grow-right{margin-inline-start:auto}.doc-controls button{height:34px;border:1px solid #ebb13c;background:#fff;border-radius:9px;padding:0 12px;color:#914a11;font-weight:800;font-size:12px}.doc-body{overflow:auto;background:#fff;padding:0 4px 14px}.doc-paper{margin:16px 18px;background:#fff;padding:24px 28px;border:1px solid #cbd8e6;border-radius:14px;min-width:920px}.doc-meta{display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:20px;align-items:start;font-size:12px}.doc-meta>div:nth-child(2){text-align:center}.doc-meta>div:last-child{text-align:left}.doc-paper h1{text-align:center;font-size:23px;margin:17px 0 5px}.center{text-align:center;color:#718098;margin:0 0 14px;font-size:12px}.doc-info{border-top:1px solid #dbe3ed;border-bottom:2px solid #1f2937;margin:18px 0 18px;padding:10px 0 14px;display:flex;justify-content:space-between;gap:20px;font-size:11px}.exit-table{min-width:1020px;border-collapse:separate;border-spacing:0;border:1px solid #cbd8e6;border-radius:13px;overflow:hidden}.exit-table th,.exit-table td{border-left:1px solid #cbd8e6;border-bottom:1px solid #cbd8e6;text-align:center;padding:9px 6px;font-size:11px}.exit-table th{background:#eef4fb;color:#1e3d7c;font-weight:900}.exit-table tr:last-child td{border-bottom:0}.exit-table th:last-child,.exit-table td:last-child{border-left:0}.write-line{color:#a5b3c4;letter-spacing:1px}.life-alive{color:#07855f;font-weight:800}.signatures{display:grid;grid-template-columns:1fr 1fr;gap:60px;margin-top:18px;padding-top:18px;border-top:1px dashed #b7c5d5;text-align:center}.signatures h4{margin:0 0 3px;font-size:13px}.signatures p{margin:0;color:#7f8ca0;font-size:10px}.signature-box{height:70px;border:1px dashed #cbd8e6;border-radius:8px;margin:9px 20px 0;display:grid;place-items:center;color:#9eacbf;font-size:11px}.next-step{margin-top:16px;border:1px solid #d6e0ea;background:#f8fafc;border-radius:10px;padding:11px;text-align:center;font-size:11px;color:#506077}.sticky-actions{background:#f8fafc;border-top:1px solid #dce5ee;padding:12px 18px;display:flex;gap:9px;align-items:center;direction:rtl}.sticky-actions button{height:42px;border:1px solid #cfd9e6;background:#fff;border-radius:11px;padding:0 14px;display:flex;gap:7px;align-items:center;font-weight:800;color:#1d2b40}.sticky-actions .primary{background:#285ee3;color:#fff;border-color:#285ee3}.sticky-actions .amber-primary{background:#c65b07;color:#fff;border-color:#c65b07}.sticky-actions .close-action{margin-inline-start:auto}
.alert-paper{border:2px solid #24344a;padding:12px 14px 24px;background:#fff}.notice-select-row{display:flex;align-items:center;justify-content:space-between;background:#fffcf5;border-radius:10px;padding:10px 12px;border-bottom:1px dashed #e4b850;margin-bottom:16px;font-size:12px}.notice-select-row label{font-weight:800}.notice-select-row button{height:34px;border:1px solid #ebb13c;background:#fff;border-radius:9px;color:#9a4e12;font-weight:800}.notice-heading{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;align-items:start;font-size:11px}.notice-heading>div:nth-child(2){text-align:center}.notice-heading>div:last-child{text-align:left}.notice-badge{display:inline-block;border:1px solid #e8a62b;background:#fff8e6;border-radius:999px;padding:8px 14px;color:#8f4b12;font-weight:900}.recipient{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:14px;background:#f7f9fc;border:1px solid #d3deea;border-radius:11px;padding:14px;margin-top:16px;font-size:12px}.warning-box{margin-top:18px;border:1px solid #efa92e;border-radius:12px;padding:14px 16px;background:#fffdf8}.warning-box h3{margin:0 0 12px;font-size:13px}.warning-box .summary-row{background:#effcf7;border:1px solid #b8ecd7;border-radius:10px;padding:12px}.notice-copy{margin-top:14px;font-size:12px;line-height:1.8;color:#27364a}.notice-copy strong{color:#9b4d11}.print-note{margin-inline-start:auto;color:#68778f;font-size:11px}
.toast{position:fixed;left:22px;bottom:22px;background:#0f172a;color:#fff;padding:12px 16px;border-radius:10px;z-index:200;box-shadow:0 10px 30px #0003}.error-toast{background:#991b1b}

/* v0.3 operational and document refinements */
.doc-kicker{font-size:10px;background:#213b5d;border:1px solid #416183;border-radius:5px;padding:3px 8px;display:inline-block;margin-bottom:3px}
.amber-icon{background:#a76606!important}
.party-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.party-role{font-size:10px;color:#087a5d;background:#e8fff6;border:1px solid #b6ecd7;border-radius:999px;padding:2px 7px}.stacked-person{display:grid;gap:5px}.stacked-person .party-line+.party-line{padding-top:4px;border-top:1px dashed #e3e9f0}.parties-cell{line-height:1.55}.parties-cell>div+div{border-top:1px dashed #dce5ee;margin-top:4px;padding-top:4px}.parties-cell small{color:#6d7c91}.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.life-deceased{color:#c01638;font-weight:900}.overdue-cell{color:#a84f00;font-weight:800}.wide-write{min-width:145px}
.alert-editor{padding:12px 22px;background:#fff7e8;border-bottom:1px solid #f1d193;display:flex;gap:12px;align-items:flex-end}.alert-editor[hidden]{display:none}.alert-editor label{display:grid;gap:6px;flex:1;font-size:12px;font-weight:800}.alert-editor textarea{width:100%;min-height:82px;resize:vertical;border:1px solid #dfad48;border-radius:10px;padding:10px 12px;line-height:1.65}.alert-editor>div{display:flex;gap:8px}.alert-editor button{border:1px solid #dca33b;background:#fff;color:#8b470f;border-radius:9px;height:36px;padding:0 12px;font-weight:800}.alert-editor button:first-child{background:#b95508;color:#fff;border-color:#b95508}
.notice-rule{border-top:2px solid #1f2937;margin-top:17px}.muted-small{font-size:10px;color:#718097}.issue-date{margin-top:10px;color:#718097}.notice-copy p{margin:6px 0 0}.ack-receipt{margin-top:18px;border-top:1.5px dashed #8896a9;padding-top:14px}.receipt-title{display:flex;align-items:center;justify-content:center;gap:7px;font-size:14px;font-weight:900;color:#233147;margin-bottom:7px}.ack-receipt p{font-size:11px;line-height:1.7;margin:0 0 10px}.receipt-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px 22px;font-size:11px}.receipt-fields .signature-line{grid-column:1/-1;border-top:1px dotted #9aa8ba;padding-top:9px;margin-top:2px}
.history-modal{width:min(1260px,96vw);height:min(86vh,820px);grid-template-rows:auto auto 1fr auto}.history-head{padding:15px 20px;background:#f8fafc;border-bottom:1px solid #dce5ee;display:flex;align-items:center;justify-content:space-between;gap:18px}.history-person{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.history-person strong{font-size:18px}.partners-note{font-size:11px;color:#087a5d;background:#e6fbf2;border:1px solid #bee9d9;border-radius:999px;padding:4px 8px}.history-kpis{display:flex;gap:10px;flex-wrap:wrap}.history-kpis span{background:#fff;border:1px solid #dce5ee;border-radius:9px;padding:7px 10px;font-size:11px}.history-kpis b{margin-inline-start:4px}.history-body{padding:16px 18px}.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:12px;color:#66768b}.history-toolbar input{width:min(360px,50vw);height:38px;border:1px solid #d5dee9;border-radius:10px;padding:0 12px;background:#fff}.history-table-wrap{overflow:auto;border:1px solid #dce5ee;border-radius:12px}.history-table{width:100%;border-collapse:collapse;min-width:950px}.history-table th{background:#f4f7fb;color:#526174;font-size:11px;padding:10px 9px;border-bottom:1px solid #dce5ee;white-space:nowrap}.history-table td{font-size:11px;padding:11px 9px;border-bottom:1px solid #edf1f5;vertical-align:middle}.history-table tbody tr:last-child td{border-bottom:0}.backup-pill{display:inline-block;background:#dcfce7;color:#087657;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.backup-pill.pending{background:#fff5d8;color:#9a5b00}.history-loading,.history-error,.empty-state{text-align:center;padding:34px;color:#748399}.history-error{color:#b4233f}
@media(max-width:1240px){.app-shell{padding:18px}.brand-line h1{font-size:26px}.dashboard-workspace{grid-template-columns:1fr}.shop-sidebar{display:grid;grid-template-columns:1fr 1fr}.stats{grid-template-columns:repeat(2,1fr)}.topbar{align-items:flex-start;flex-direction:column}.top-actions{width:100%}.payment-workspace{min-height:auto}.registry-head{align-items:flex-start;flex-direction:column}.filters{direction:rtl;flex-wrap:wrap}.search input{width:220px}}
@media(max-width:760px){.app-shell{padding:12px}.stats{grid-template-columns:1fr}.brand{align-items:flex-start}.brand-icon{width:48px;height:48px;flex-basis:48px}.brand-line h1{font-size:21px}.top-actions{display:grid;grid-template-columns:1fr}.top-actions button{width:100%}.payment-workspace{padding:20px 16px}.selector-box,.summary-row,.payment-fields{grid-template-columns:1fr}.multiples{grid-template-columns:repeat(2,1fr)}.summary-bottom{align-items:flex-start;flex-direction:column}.shop-sidebar{display:flex}.filters{display:grid;width:100%}.search input{width:100%}.modal-backdrop{padding:0}.modal{width:100vw;height:100vh;max-height:none;border-radius:0}.scope-tabs{overflow:auto;max-width:65vw}.doc-controls{align-items:flex-start;flex-direction:column}.doc-controls .grow-right{margin-inline-start:0}.sticky-actions{overflow:auto}.doc-paper{margin:10px;min-width:900px}}
@page exitSheet{size:A4 landscape;margin:9mm}
@page alertSheet{size:A4 portrait;margin:10mm}
@media print{
  html,body{background:#fff!important}
  body{margin:0!important}
  .app-shell,.doc-header,.notice-strip,.doc-controls,.sticky-actions,.alert-editor,.screen-only{display:none!important}
  .modal-backdrop{position:static!important;background:none!important;padding:0!important;display:block!important;backdrop-filter:none!important}
  .modal{width:100%!important;height:auto!important;max-height:none!important;box-shadow:none!important;overflow:visible!important;display:block!important;border-radius:0!important}
  .doc-body{overflow:visible!important;padding:0!important;background:#fff!important}
  .doc-paper{box-shadow:none!important}
  .exit-print-paper{page:exitSheet;border:0!important;margin:0!important;padding:0!important;min-width:0!important;width:100%!important}
  .exit-table{min-width:0!important;width:100%!important;border-collapse:collapse!important;border-radius:0!important}
  .exit-table thead{display:table-header-group}
  .exit-table tfoot{display:table-footer-group}
  .exit-table tr{break-inside:avoid;page-break-inside:avoid}
  .exit-table th,.exit-table td{padding:4px 4px!important;font-size:8.2pt!important}
  .exit-print-paper h1{font-size:16pt!important;margin:8px 0 3px!important}.exit-print-paper .center{font-size:8.5pt!important;margin-bottom:6px!important}.exit-print-paper .doc-info{font-size:8pt!important;margin:7px 0 8px!important;padding:6px 0!important}.exit-print-paper .doc-meta{font-size:8pt!important}
  .alert-paper{page:alertSheet;border:0!important;margin:0!important;padding:0!important;min-width:0!important;width:100%!important;page-break-after:always!important;break-after:page!important}
  .alert-paper:last-child{page-break-after:auto!important;break-after:auto!important}
  body.print-alerts .alert-paper:not(.print-selected){display:none!important}
  body.print-alerts.print-single-alert .alert-paper{display:none!important}
  body.print-alerts.print-single-alert .alert-paper.print-single-target{display:block!important}
  .notice-heading{font-size:9pt!important}.recipient{font-size:9pt!important;padding:8px!important;margin-top:10px!important}.warning-box{margin-top:10px!important;padding:9px 10px!important}.warning-box h3{font-size:10pt!important;margin-bottom:7px!important}.warning-box .summary-row{padding:7px!important}.summary-item{padding:3px 6px!important}.summary-item span{font-size:8pt!important}.summary-item b,.summary-item strong{font-size:10pt!important}.notice-copy{font-size:9pt!important;line-height:1.55!important;margin-top:9px!important}.ack-receipt{margin-top:11px!important;padding-top:9px!important}.ack-receipt p,.receipt-fields{font-size:8.7pt!important}.receipt-title{font-size:10pt!important}.notice-rule{margin-top:10px!important}.notice-badge{padding:5px 10px!important}.issue-date{margin-top:5px!important}
}
.history-parties{display:flex;gap:8px;flex-wrap:wrap}.history-parties>span{display:grid;gap:2px;background:#fff;border:1px solid #dce5ee;border-radius:9px;padding:7px 9px}.history-parties b{font-size:12px}.history-parties em{font-size:9.5px;color:#718097;font-style:normal}
/* v0.4 — official notice + GIR annual receipt register */
.top-actions{flex-wrap:wrap}.top-actions .teal{background:#0f766e;color:#fff}.required-tag{font-size:10px;background:#fee2e2;color:#b42318;border-radius:999px;padding:2px 7px;margin-inline-start:5px}.gir-payment-fields{grid-template-columns:220px 220px 1fr}.grow-field{min-width:0}
.teal-head{background:#0f766e!important;color:#fff}.receipt-register-modal{width:min(1500px,98vw);height:min(94vh,980px);grid-template-rows:auto auto 1fr auto}.receipt-toolbar{display:flex;align-items:center;gap:12px;padding:12px 18px;background:#f0fdfa;border-bottom:1px solid #99f6e4}.receipt-toolbar label{display:flex;align-items:center;gap:8px;font-weight:800}.receipt-toolbar select{border:1px solid #99cfc8;border-radius:10px;padding:9px 12px;background:#fff}.receipt-search{background:#fff;min-width:300px}.receipt-auto-note{margin-inline-start:auto;color:#0f766e;background:#ccfbf1;border:1px solid #99f6e4;border-radius:999px;padding:7px 11px;font-size:11px;font-weight:800}.receipt-body{padding:14px 16px}.receipt-register-paper{min-width:1320px;margin:0;padding:18px 20px}.receipt-register-head{display:grid;grid-template-columns:1fr 1.5fr 1fr;align-items:start;gap:20px;border-bottom:2px solid #0f172a;padding-bottom:12px;margin-bottom:12px;font-size:11px}.receipt-register-head>div:nth-child(2){text-align:center}.receipt-register-head h1{font-size:20px;margin:0 0 4px}.receipt-register-head p{margin:0;color:#64748b}.receipt-register-head>div:last-child{text-align:left}.year-register-wrap{overflow:auto}.year-register{width:100%;border-collapse:collapse;table-layout:fixed;min-width:1280px}.year-register th,.year-register td{border:1px solid #cbd5e1;text-align:center;vertical-align:middle;padding:5px 4px;font-size:9.5px}.year-register th{background:#eef7f6;color:#274458;font-weight:900}.year-register th:nth-child(1){width:42px}.year-register th:nth-child(2){width:180px}.year-register th:nth-child(3){width:78px}.register-person{text-align:right!important}.register-person>div{display:grid;gap:1px;padding:2px 0}.register-person small{color:#64748b;font-size:8.5px}.receipt-cell{background:#fff;min-width:82px}.receipt-cell.filled{background:#f0fdf4;color:#14532d}.receipt-cell b{display:block;font-size:9px}.receipt-cell small{display:block;margin-top:2px;color:#64748b;font-size:8px}.teal-primary{background:#0f766e!important;color:#fff!important;border:0!important}.footer-note{margin-inline-end:auto;color:#64748b;font-size:11px}
.official-letterhead{display:grid;grid-template-columns:1fr 170px 1fr;align-items:start;gap:18px;direction:rtl;min-height:112px}.letterhead-admin,.letterhead-ref{display:flex;flex-direction:column;gap:3px;font-size:11.5px;line-height:1.5}.letterhead-admin b{font-size:12.5px}.letterhead-ref{align-items:flex-start;text-align:right}.coat-wrap{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:105px}.morocco-coat{width:76px;height:78px;object-fit:contain}.coat-fallback{display:none;font-size:9px;color:#64748b;border:1px solid #cbd5e1;border-radius:8px;padding:8px;text-align:center}.official-subject{text-align:center;border-top:1.5px solid #111827;padding-top:12px;margin-top:4px;display:grid;gap:8px}.official-subject b{font-size:17px}.official-subject span{font-weight:800}.official-recipient{display:flex;justify-content:space-between;gap:20px;margin:18px 0 8px;font-size:12px}.official-body{font-size:12.2px;line-height:2;text-align:justify}.official-body p{margin:10px 0}.official-closing{font-weight:900;text-align:left;padding-left:60px}.official-ack{margin-top:18px;border:1px solid #cbd5e1;border-radius:10px;padding:12px 14px;background:#fafafa}.official-ack .receipt-title{font-size:13px}.official-ack .receipt-fields{margin-top:10px}
@page receiptRegister{size:A4 landscape;margin:6mm}
@media print{
 body.print-receipts .modal-backdrop{position:static!important;background:none!important;padding:0!important;display:block!important;backdrop-filter:none!important}
 body.print-receipts .modal{width:100%!important;height:auto!important;max-height:none!important;box-shadow:none!important;overflow:visible!important;border-radius:0!important;display:block!important}
 body.print-receipts .receipt-register-paper{page:receiptRegister;border:0!important;margin:0!important;padding:0!important;min-width:0!important;width:100%!important}
 body.print-receipts .year-register{min-width:0!important;width:100%!important;table-layout:fixed!important}
 body.print-receipts .year-register thead{display:table-header-group}
 body.print-receipts .year-register tr{break-inside:avoid;page-break-inside:avoid}
 body.print-receipts .year-register th,body.print-receipts .year-register td{font-size:6.8pt!important;padding:2.2px 2px!important}
 body.print-receipts .receipt-register-head{font-size:7pt!important;margin-bottom:5px!important;padding-bottom:5px!important}.receipt-register-head h1{font-size:12pt!important}
 body.print-receipts .app-shell,body.print-receipts .doc-header,body.print-receipts .receipt-toolbar,body.print-receipts .sticky-actions{display:none!important}
 .official-letterhead{min-height:82px!important;grid-template-columns:1fr 120px 1fr!important}.morocco-coat{width:58px!important;height:60px!important}.letterhead-admin,.letterhead-ref{font-size:8.5pt!important}.official-subject{margin-top:0!important;padding-top:8px!important}.official-subject b{font-size:13pt!important}.official-recipient,.official-body{font-size:9.2pt!important}.official-body{line-height:1.75!important}.official-ack{font-size:8.5pt!important;padding:8px 10px!important}.official-ack .receipt-title{font-size:10pt!important}
}
@media(max-width:900px){.gir-payment-fields{grid-template-columns:1fr}.receipt-toolbar{flex-wrap:wrap}.receipt-auto-note{margin-inline-start:0}.receipt-search{min-width:220px;flex:1}}

/* =========================================================
   v0.5 — Premium municipal operations UI + bilingual polish
   ========================================================= */
:root{
  --canvas:#f2f5f8;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --ink:#122033;
  --ink-strong:#0b1628;
  --muted:#718198;
  --muted-2:#93a0b2;
  --line:#dbe4ed;
  --line-strong:#c8d4e0;
  --green:#0b946e;
  --green-dark:#087257;
  --green-soft:#eaf9f3;
  --teal:#0f766e;
  --blue:#2b62df;
  --blue-dark:#204fc1;
  --amber:#cc6f08;
  --amber-dark:#a95305;
  --red:#cf2444;
  --red-dark:#a81733;
  --navy:#17263d;
  --navy-2:#101c2e;
  --focus:#2b62df;
  --radius-control:11px;
  --radius-card:16px;
  --radius-panel:18px;
  --shadow-card:0 7px 22px rgba(17,36,58,.055),0 1px 2px rgba(17,36,58,.035);
  --shadow-panel:0 18px 48px rgba(15,28,46,.12),0 2px 7px rgba(15,28,46,.07);
  --ease:cubic-bezier(.2,.8,.2,1);
  font-family:"Segoe UI Variable","Segoe UI","Noto Sans Arabic",Tahoma,Arial,sans-serif;
}
html{background:var(--canvas);scrollbar-color:#a8b5c4 #edf1f5;scrollbar-width:thin}
*{scrollbar-color:#a8b5c4 #edf1f5;scrollbar-width:thin}
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-track{background:#edf1f5}
*::-webkit-scrollbar-thumb{background:#a8b5c4;border:2px solid #edf1f5;border-radius:999px}
*::-webkit-scrollbar-thumb:hover{background:#8797aa}
body{background:linear-gradient(180deg,#edf2f6 0,#f6f8fa 300px,#f3f6f8 100%);color:var(--ink);font-feature-settings:"kern" 1,"tnum" 1}
button,input,select,textarea{font:inherit}
textarea{resize:none}
button{transition:transform .16s var(--ease),box-shadow .16s var(--ease),background-color .16s var(--ease),border-color .16s var(--ease),color .16s var(--ease)}
button:not(:disabled):hover{transform:translateY(-1px)}
button:not(:disabled):active{transform:translateY(0)}
button:disabled{cursor:not-allowed;opacity:.48}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 24%,transparent);outline-offset:2px}
.app-shell{max-width:1660px;padding:22px 28px 48px}

/* Application masthead */
.topbar{border-radius:var(--radius-panel);border:1px solid rgba(194,207,220,.82);padding:20px 22px;background:rgba(255,255,255,.96);box-shadow:var(--shadow-card);backdrop-filter:blur(12px)}
.brand{gap:14px}
.brand-icon{width:54px;height:54px;flex-basis:54px;border-radius:15px;background:linear-gradient(145deg,#0da17a,#078361);box-shadow:0 10px 24px rgba(11,148,110,.20)}
.brand-icon svg{width:27px;height:27px;stroke-width:1.85}
.brand-line{gap:10px}
.brand-line h1{font-size:28px;font-weight:780;letter-spacing:-.45px;color:var(--ink-strong)}
html[lang="fr"] .brand-line h1{font-size:26px;letter-spacing:-.55px}
.brand-line span{font-size:11px;padding:4px 9px;background:#eefaf5;color:#07745a;border-color:#b9ead7;font-weight:750}
.brand p{font-size:13.5px;color:var(--muted);margin-top:6px}
.top-actions{gap:8px;align-items:center}
.top-actions button{min-height:44px;padding:0 14px;border-radius:11px;border:1px solid transparent;box-shadow:none;font-size:12.5px;font-weight:760;white-space:nowrap}
.top-actions button svg{width:17px;height:17px}
.top-actions .dark{background:var(--navy);border-color:var(--navy);color:#fff}
.top-actions .dark:hover{background:var(--navy-2);box-shadow:0 8px 18px rgba(16,28,46,.15)}
.top-actions .blue{background:#edf4ff;border-color:#c9dafd;color:#2858c7}
.top-actions .blue:hover{background:#e1edff;border-color:#adc7fa;box-shadow:0 7px 16px rgba(43,98,223,.10)}
.top-actions .teal{background:#edf9f7!important;border-color:#bfdfda!important;color:#0e6c65!important}
.top-actions .teal:hover{background:#e1f5f1!important;border-color:#a6d3cb!important}
.top-actions .warning{background:#fff7e9;border-color:#f2cf96;color:#a95707}
.top-actions .warning:hover{background:#ffefd3;border-color:#eab86d;box-shadow:0 7px 16px rgba(204,111,8,.10)}
.action-count{display:inline-grid;place-items:center;min-width:24px;height:22px;padding:0 6px;border-radius:999px;background:rgba(255,255,255,.75);border:1px solid currentColor;font-size:10.5px;line-height:1;font-variant-numeric:tabular-nums}
.language-toggle{width:44px!important;min-width:44px!important;padding:0!important;gap:5px!important;background:#fff!important;color:#21314a!important;border-color:#cdd8e3!important;box-shadow:0 1px 2px rgba(17,36,58,.04)!important}
.language-toggle:hover{border-color:#aebdca!important;background:#f8fafc!important;box-shadow:0 6px 16px rgba(17,36,58,.08)!important}
.language-toggle .language-code{font-size:10px;font-weight:850;letter-spacing:.3px}
.language-toggle svg{width:16px!important;height:16px!important}

/* KPI cards */
.stats{gap:14px;margin:20px 0}
.stat-card{position:relative;overflow:hidden;min-height:122px;padding:20px;border-radius:var(--radius-card);border:1px solid var(--line);box-shadow:var(--shadow-card);background:var(--surface)}
.stat-card::before{content:"";position:absolute;inset-inline:0;top:0;height:3px;background:#d7e1ea}
.stat-card.green::before{background:#68c9aa}.stat-card.blue::before{background:#80a9f5}.stat-card.indigo::before{background:#9da7f5}.stat-card.red::before{background:#ee879b}
.stat-copy{gap:6px}
.stat-copy .label{font-size:12.5px;color:var(--muted);font-weight:650}
.stat-copy strong{font-size:27px;letter-spacing:-.3px;font-weight:820;color:var(--ink-strong)}
.stat-copy small{font-size:11.5px;color:var(--muted)}
.stat-icon{width:50px;height:50px;flex-basis:50px;border-radius:14px;border:1px solid rgba(0,0,0,.02)}
.stat-icon svg{width:23px;height:23px}
.stat-card.red{background:#fff;border-color:#f1c3cc}.stat-card.red .label,.stat-card.red strong{color:#c91d3e}

/* Primary working surface */
.dashboard-workspace{gap:20px;margin-bottom:22px;grid-template-columns:minmax(0,2.18fr) minmax(320px,.9fr)}
.payment-workspace{position:relative;overflow:hidden;min-height:590px;border:1px solid #b8dfd1;border-radius:var(--radius-panel);padding:26px 28px;background:var(--surface);box-shadow:var(--shadow-card)}
.payment-workspace::before{content:"";position:absolute;top:0;inset-inline:0;height:4px;background:linear-gradient(90deg,#0b946e,#3cb798)}
.workspace-head{padding-bottom:17px}
.workspace-title{gap:12px}.workspace-title .square-icon{width:44px;height:44px;border-radius:12px;background:var(--green);box-shadow:0 8px 18px rgba(11,148,110,.17)}
.workspace-title h2{font-size:21px;color:var(--ink-strong);letter-spacing:-.2px}
.workspace-title p{font-size:12px;color:var(--muted)}
.selected-chip{padding:6px 10px;font-size:11.5px;background:#effaf6;border-color:#b8e5d4;color:#08745a}
.selected-chip::before{width:7px;height:7px;background:#17a977}
.selector-box{margin:18px 0;background:#f7f9fb;border-color:var(--line);border-radius:13px;padding:15px;gap:12px}
.field-block label{font-size:12px;color:#314057;margin-bottom:7px;font-weight:760}
.field-block label .hint{font-size:10.5px;color:#0b8c69}
.select-like,.field-input,.field-block select,.payment-fields input{height:46px;border-color:var(--line-strong);border-radius:10px;color:#17263c;font-size:12.5px;box-shadow:0 1px 1px rgba(17,36,58,.02)}
.select-like:hover,.field-input:hover,.field-block select:hover,.payment-fields input:hover{border-color:#b1c0ce}
.payment-summary{background:#f1faf6;border-color:#c7e8dc;border-radius:13px;padding:14px 16px;margin-bottom:19px}
.summary-item span{font-size:10.8px;color:#7c8ba0}.summary-item strong{font-size:16px;color:#102036}.summary-item small{font-size:10px}
.summary-bottom{border-color:#cde9df;margin-top:10px;padding-top:10px}
.status-badge,.cin-chip,.debt-chip b{border-radius:7px}
.amount-section{margin-top:8px}.amount-label{font-size:12.5px;color:#26354a}
.amount-box input{height:58px;border:1.5px solid #c5d2df;border-radius:11px;font-size:22px;padding-inline-start:17px;padding-inline-end:58px;transition:border-color .16s var(--ease),box-shadow .16s var(--ease)}
.amount-box input:focus{border-color:#78ad9a;box-shadow:0 0 0 4px rgba(11,148,110,.08);outline:0}
.amount-box span{inset-inline-end:17px;left:auto;color:#8695a8}
html[dir="ltr"] .amount-box span{left:auto;right:17px}
.multiple-caption{font-size:11px;margin:11px 0 8px}.multiples{gap:8px}
.multiples button{min-height:55px;border-radius:10px;background:#fbfcfd;border-color:#d8e1ea;font-size:12px}
.multiples button:hover{background:#f4f7fa;border-color:#c6d2de;box-shadow:0 5px 12px rgba(17,36,58,.06)}
.multiples button.active{background:var(--green);border-color:var(--green);box-shadow:0 7px 16px rgba(11,148,110,.16)}
.required-tag{padding:2px 6px;background:#fff0f2;color:#b81c39;font-weight:780}
.payment-actions{margin-top:16px;gap:8px}.payment-actions button{min-height:44px;border-radius:10px;padding:0 13px;font-size:11.5px;background:#f7f9fb;border-color:#d7e0e9;color:#26364c}
.payment-actions button:hover{background:#f0f4f7;border-color:#c5d2de}
.payment-actions .save-payment{background:var(--green);border-color:var(--green);box-shadow:0 7px 15px rgba(11,148,110,.15)}
.payment-actions .save-payment:hover{background:var(--green-dark);box-shadow:0 9px 19px rgba(11,148,110,.19)}
.payment-actions .exit-action{background:#f1f6ff;border-color:#c9d9fa;color:#2456c4}
.payment-actions .alert-action{background:#fff8ec;border-color:#efd19e;color:#a65708}
.next-total{font-size:10.5px}.next-total strong{font-size:13px}
.validation-error{border-width:1px;border-color:#ef9cab;background:#fff5f6;border-radius:12px;padding:14px 16px;font-size:12px}
.validation-actions button{border-radius:9px}

/* Context cards */
.shop-sidebar{gap:14px}.shop-card,.distribution-card{border-radius:var(--radius-card);box-shadow:var(--shadow-card);border-color:var(--line)}
.shop-card{padding:19px}.shop-card-head{margin-bottom:10px}.shop-card .shop-title h3{font-size:20px}.shop-badge{font-size:10.5px;padding:4px 9px;background:#effaf6;border-color:#b8e5d4}.rank-chip{width:44px;height:44px;border-radius:12px;background:#f1f4f7;color:#293951;font-size:16px}
.detail-row{padding:10px 0;font-size:12px;gap:10px}.detail-row .label{color:#8897aa}.detail-row .value{font-weight:780}.detail-row.highlight-red{border-radius:8px;background:#fff7f8}.side-actions{gap:7px;margin-top:13px}.side-actions button{height:38px;border-radius:9px;font-size:11.5px;background:#f3f6f8;border:1px solid #e3e9ef}.side-actions button:hover{background:#eaf0f4;border-color:#d3dde6}
.distribution-card{background:linear-gradient(160deg,#17263d,#111d30);box-shadow:0 12px 28px rgba(16,28,46,.12)}

/* Registry */
.registry{border-radius:var(--radius-panel);border:1px solid var(--line);box-shadow:var(--shadow-card);overflow:hidden;background:#fff}
.registry-head{padding:18px 20px;border-bottom:1px solid #e8eef3;background:#fff}
.registry-title h2{font-size:19px;color:var(--ink-strong)}.registry-title p{font-size:11.5px;color:var(--muted)}
.registry-icon{width:38px;height:38px;border-radius:10px;background:#f1f5f8;color:#31445f}
.filters{gap:8px}.filters select,.search{height:40px;border-radius:10px;border-color:#d4dee8;background:#f9fbfc}
.filters select{padding-inline:12px;font-size:11.5px;color:#2b3b51}.search input{height:38px;font-size:11.5px;padding-inline-start:34px;padding-inline-end:34px;background:transparent}
.search-clear{position:absolute;inset-inline-end:8px;top:50%;transform:translateY(-50%)!important;width:24px;height:24px;padding:0;border:0;border-radius:7px;background:#edf1f5;color:#65758b;font-size:17px;line-height:1;display:grid;place-items:center}
.search-clear[hidden]{display:none}
.table-wrap{scrollbar-gutter:stable}.registry table{font-size:11.5px}.registry th{position:sticky;top:0;z-index:2;background:#f7f9fb;color:#58677d;font-size:10.5px;font-weight:780;border-bottom:1px solid #dce4ec}.registry td{border-bottom:1px solid #edf1f5}.registry tbody tr{transition:background-color .14s ease}.registry tbody tr:hover{background:#f8fbfa}.registry tbody tr.selected{background:#f0faf6}
.row-number{border-radius:9px;background:#eef2f6;color:#25354c}
.action-buttons{gap:5px}.action-buttons button{width:31px;height:31px;border-radius:8px;border:1px solid #e2e8ee;background:#f7f9fb}.action-buttons button:hover{background:#edf2f6;border-color:#d0dae4}.action-buttons .pay-btn{width:auto;padding-inline:9px;background:#eaf9f3;border-color:#c7e9dc;color:#08765a}
.table-footer{padding:11px 18px;background:#fbfcfd;border-top:1px solid #e7edf2;color:#6d7d92;font-size:11px}.pager button{width:32px;height:32px;border-radius:9px;border:1px solid #dce4ec;background:#fff}.pager b{font-size:11px;font-weight:700;color:#4b5b72}

/* Modal system */
.modal-backdrop{background:rgba(10,20,34,.61);backdrop-filter:blur(5px);padding:20px}
.modal{border-radius:19px;box-shadow:0 30px 80px rgba(7,16,29,.28),0 4px 18px rgba(7,16,29,.13);border:1px solid rgba(255,255,255,.12);overflow:hidden}
.doc-header{min-height:80px;padding:17px 20px}.doc-header h2{font-size:20px;letter-spacing:-.2px}.doc-header p{font-size:11.5px;opacity:.72;margin-top:4px}.doc-header .close-modal{width:38px;height:38px;border-radius:10px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.12)}
.notice-strip{font-size:11px;padding:10px 18px}.doc-controls{padding:11px 18px;gap:10px}.doc-controls input,.doc-controls select,.doc-controls button{min-height:38px;border-radius:9px;font-size:11px}.scope-tabs{padding:3px;background:rgba(255,255,255,.08);border-radius:11px;gap:3px}.scope-tabs button{border-radius:8px;padding:8px 11px;font-size:10.5px}.sticky-actions{min-height:64px;padding:10px 18px;background:rgba(255,255,255,.97);backdrop-filter:blur(8px);border-top:1px solid #dce4ec;gap:8px}.sticky-actions button{min-height:40px;border-radius:10px;padding:0 14px;font-size:11.5px;font-weight:760}.primary,.amber-primary,.teal-primary{box-shadow:0 6px 14px rgba(17,36,58,.10)}
.doc-body{background:#eef2f5}.doc-paper{border:1px solid #d6dfe8;box-shadow:0 10px 30px rgba(17,36,58,.07)}

/* Official summons document: screen preview and print geometry */
.alert-paper{display:flex;flex-direction:column;min-height:1080px;max-width:900px;margin-inline:auto;background:#fff;padding:28px 34px 26px;border-radius:4px}
.official-document-content{display:block}
.official-letterhead{grid-template-columns:1fr 150px 1fr;min-height:106px;gap:16px}.morocco-coat{width:72px;height:72px}.letterhead-admin,.letterhead-ref{font-size:11px;line-height:1.55}.letterhead-admin b{font-size:11.5px}.official-subject{padding-top:11px;margin-top:3px;gap:5px}.official-subject b{font-size:16px}.official-subject span{font-size:13px}.official-recipient{margin:17px 0 7px;font-size:11.5px}.official-body{font-size:11.6px;line-height:1.95}.official-body p{margin:8px 0}.official-closing{padding-inline-start:52px;padding-left:0}
.official-ack{margin-top:auto!important;border:1px solid #cbd5e1;border-radius:8px;padding:12px 14px;background:#fff;break-inside:avoid;page-break-inside:avoid}.official-ack .receipt-title{text-align:center;font-size:13px;font-weight:850}.official-ack p{font-size:11px;line-height:1.8}.official-ack .receipt-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px 28px;margin-top:12px;font-size:10.5px}.official-ack .signature-line{grid-column:1/-1;margin-top:4px}
.document-language-note{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;background:#fff8e8;border:1px solid #f0d39a;color:#915006;border-radius:8px;font-size:10.5px;font-weight:700}

/* GIR register */
.receipt-register-modal{border-radius:19px}.receipt-toolbar{padding:10px 16px;background:#f1faf7;border-color:#c8e8df}.receipt-toolbar label{font-size:11.5px}.receipt-toolbar select{height:38px;padding:0 10px;border-radius:9px}.receipt-auto-note{font-size:10px;padding:6px 9px}.receipt-register-paper{border-radius:4px}.receipt-register-head h1{font-size:18px}.year-register th{background:#f0f6f5;color:#31495a}.year-register tr:hover td{background:#fbfdfc}.year-register tr:hover .receipt-cell.filled{background:#e8f9ef}.receipt-cell.filled{background:#eefaf4;color:#16623f}

/* History */
.history-parties>span{border-radius:8px;background:#f9fbfc}.history-parties b{font-size:11.5px}.history-parties em{font-size:9px}
.toast-region{position:fixed;inset-block-end:20px;inset-inline-start:20px;z-index:1000;display:grid;gap:8px;pointer-events:none}.toast{min-width:260px;max-width:390px;padding:11px 13px;border-radius:11px;background:#14233a;color:#fff;box-shadow:0 13px 32px rgba(10,20,34,.20);font-size:11.5px;font-weight:650;pointer-events:auto}

/* French / LTR adaptation */
html[dir="ltr"] .top-actions{direction:ltr}
html[dir="ltr"] .summary-item{text-align:left}
html[dir="ltr"] .official-document-content,html[dir="ltr"] .official-ack{direction:rtl;text-align:right}
html[dir="ltr"] .register-person{text-align:left!important}
html[dir="ltr"] .receipt-register-head>div:last-child{text-align:right}
html[dir="ltr"] .official-closing{text-align:left}
html[dir="ltr"] .detail-row{text-align:left}
html[dir="ltr"] .debt-chip{direction:ltr}

/* Narrow layouts */
@media(max-width:1260px){
  .topbar{align-items:flex-start}.brand-line h1{font-size:24px}.top-actions{max-width:630px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:980px){
  .app-shell{padding:16px}.topbar{padding:17px}.dashboard-workspace{grid-template-columns:1fr}.shop-sidebar{display:grid;grid-template-columns:1fr 1fr}
  .payment-workspace{padding:22px}.registry-head{align-items:flex-start}.filters{width:100%}
}
@media(max-width:720px){
  .topbar{gap:16px}.top-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.language-toggle{grid-column:auto}.stats{grid-template-columns:1fr}.shop-sidebar{grid-template-columns:1fr}
  .brand-line h1,html[lang="fr"] .brand-line h1{font-size:21px}.brand p{font-size:12px}
  .payment-workspace{padding:19px 14px}.workspace-head{align-items:flex-start}.workspace-title h2{font-size:18px}.selected-chip{font-size:10px}.selector-box,.summary-row,.payment-fields{grid-template-columns:1fr}.multiples{grid-template-columns:repeat(2,1fr)}
  .modal-backdrop{padding:0}.modal{border-radius:0}.doc-header{padding:14px}.doc-controls{padding:10px 12px}.sticky-actions{padding:9px 12px}.alert-paper{min-height:1000px;margin:10px;min-width:760px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}

/* Print contract: no application chrome; receipt anchored at the bottom of every summons page. */
@page alertSheet{size:A4 portrait;margin:10mm 13mm 10mm}
@media print{
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .screen-only,.document-language-note{display:none!important}
  body.print-alerts .alert-paper{
    page:alertSheet!important;
    width:100%!important;
    min-width:0!important;
    height:277mm!important;
    min-height:277mm!important;
    max-height:277mm!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    break-after:page!important;
    page-break-after:always!important;
  }
  body.print-alerts .alert-paper:last-child{break-after:auto!important;page-break-after:auto!important}
  body.print-alerts .official-document-content{display:block!important;flex:0 0 auto!important}
  body.print-alerts .official-ack{margin-top:auto!important;margin-bottom:0!important;flex:0 0 auto!important;border-color:#aeb9c4!important;background:#fff!important;padding:8mm 7mm 6mm!important;border-radius:2mm!important}
  body.print-alerts .official-ack .receipt-title{font-size:11pt!important;margin-bottom:2mm!important}
  body.print-alerts .official-ack p{font-size:9pt!important;line-height:1.65!important;margin:1.5mm 0!important}
  body.print-alerts .official-ack .receipt-fields{font-size:8.8pt!important;gap:3mm 8mm!important;margin-top:3mm!important}
  body.print-alerts .official-letterhead{min-height:30mm!important;grid-template-columns:1fr 34mm 1fr!important;gap:4mm!important}
  body.print-alerts .morocco-coat{width:18mm!important;height:18mm!important}
  body.print-alerts .letterhead-admin,body.print-alerts .letterhead-ref{font-size:8.8pt!important;line-height:1.45!important}
  body.print-alerts .letterhead-admin b{font-size:9pt!important}
  body.print-alerts .official-subject{padding-top:3mm!important;margin-top:1mm!important;gap:1.2mm!important}
  body.print-alerts .official-subject b{font-size:13pt!important}
  body.print-alerts .official-subject span{font-size:10.5pt!important}
  body.print-alerts .official-recipient{font-size:9pt!important;margin:5mm 0 2mm!important}
  body.print-alerts .official-body{font-size:9pt!important;line-height:1.8!important}
  body.print-alerts .official-body p{margin:2.2mm 0!important}
  body.print-alerts .official-closing{font-size:9.5pt!important;margin-top:2mm!important}
}

/* v0.5 print refinement: reserve the lower band and anchor the acknowledgement there. */
@media print{
  body.print-alerts .alert-paper{position:relative!important;padding-bottom:55mm!important}
  body.print-alerts .official-document-content{padding-bottom:0!important}
  body.print-alerts .official-ack{
    position:absolute!important;
    inset-inline:0!important;
    bottom:0!important;
    width:100%!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
}

/* =========================================================
   v0.6 — exact A4 summons + approved template editor
   ========================================================= */
#alertPapers{display:flex;flex-direction:column;align-items:center;gap:22px;padding:2px 0 24px}
.alert-sheet-card{width:min(100%,850px);display:flex;flex-direction:column;gap:9px;align-items:center}
.alert-sheet-card .notice-select-row{width:210mm;max-width:100%;margin:0;padding:9px 12px;border:1px solid #e9c47e;border-radius:10px;background:#fffaf0;box-shadow:0 1px 2px rgba(65,37,5,.03)}
.alert-sheet-card .alert-paper,.template-a4-paper{width:210mm;height:297mm;min-height:297mm;max-height:297mm;box-sizing:border-box;padding:var(--notice-page-padding,13mm);margin:0;background:#fff;border:1px solid #d6dee8;border-radius:2px;box-shadow:0 18px 46px rgba(17,36,58,.10);display:flex;flex-direction:column;overflow:hidden;font-family:var(--notice-font,Tahoma,Arial,sans-serif)}
.alert-paper .official-document-content,.template-a4-paper .official-document-content{flex:0 0 auto;min-height:0}
.alert-paper .official-letterhead,.template-a4-paper .official-letterhead{min-height:27mm;grid-template-columns:1fr 34mm 1fr;gap:4mm}
.alert-paper .morocco-coat,.template-a4-paper .morocco-coat{width:18mm;height:18mm}
.alert-paper .letterhead-admin,.alert-paper .letterhead-ref,.template-a4-paper .letterhead-admin,.template-a4-paper .letterhead-ref{font-size:10.5px;line-height:1.45}
.alert-paper .official-subject,.template-a4-paper .official-subject{padding-top:3mm;margin-top:1mm;gap:1.5mm}
.alert-paper .subject-rendered,.template-a4-paper .subject-editable{font-size:16px;font-weight:800;line-height:1.35}
.alert-paper .salutation-rendered,.template-a4-paper .salutation-editable{font-size:13px;font-weight:750;line-height:1.4}
.alert-paper .official-recipient,.template-a4-paper .official-recipient{font-size:calc(var(--notice-body-size,12px) * .95);margin:4.5mm 0 2mm;gap:8mm}
.alert-paper .official-body,.template-a4-paper .official-body{font-size:var(--notice-body-size,12px);line-height:var(--notice-line-height,1.75);text-align:justify}
.alert-paper .official-body p,.template-a4-paper .official-body p{margin:0 0 var(--notice-paragraph-gap,7px)}
.alert-paper .official-closing,.template-a4-paper .official-closing{font-size:var(--notice-body-size,12px);line-height:1.5;margin-top:2mm;font-weight:800;text-align:left;padding-left:15mm}
.alert-paper .official-ack,.template-a4-paper .official-ack{margin-top:auto!important;position:static!important;inset:auto!important;flex:0 0 auto;min-height:var(--notice-receipt-height,39mm);max-height:var(--notice-receipt-height,39mm);width:auto!important;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:2.5mm;padding:5mm 6mm 4mm;background:#fff;overflow:hidden;break-inside:avoid;page-break-inside:avoid}
.alert-paper .official-ack .receipt-title,.template-a4-paper .official-ack .receipt-title{text-align:center;font-size:calc(var(--notice-body-size,12px) * 1.02);font-weight:850;line-height:1.35;margin-bottom:2mm}
.alert-paper .official-ack .receipt-copy,.template-a4-paper .official-ack .receipt-copy{font-size:calc(var(--notice-body-size,12px) * .88);line-height:1.55}
.alert-paper .official-ack .receipt-fields,.template-a4-paper .official-ack .receipt-fields{display:grid;grid-template-columns:1fr 1fr;gap:2.5mm 8mm;margin-top:3mm;font-size:calc(var(--notice-body-size,12px) * .82)}
.alert-paper .official-ack .signature-line,.template-a4-paper .official-ack .signature-line{grid-column:1/-1;margin-top:1mm;border-top:1px dotted #94a3b8;padding-top:2mm}
.template-launch{border-color:#e2a848!important;background:#fff9ee!important;color:#8d4a0a!important;font-weight:800!important}
.template-launch:hover{background:#fff3dc!important;border-color:#d8912d!important}

/* Simplified Word-like A4 template studio */
#templateStudioHost{background:#e9eef3;min-height:0;overflow:auto}
#templateStudioHost[hidden]{display:none}
.template-studio-shell{display:grid;grid-template-rows:auto auto auto 1fr auto;min-height:100%;background:#e9eef3;color:var(--ink)}
.template-studio-head{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px 18px;background:#fff;border-bottom:1px solid #d9e2eb;position:sticky;top:0;z-index:5}
.template-studio-head h3{margin:2px 0 3px;font-size:18px}.template-studio-head p{margin:0;color:#718198;font-size:11px}.studio-kicker{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#9b5c13;font-weight:800}.studio-head-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.studio-head-actions button{height:36px;border:1px solid #d6e0e9;background:#fff;border-radius:9px;padding:0 11px;display:flex;align-items:center;gap:6px;font-weight:750;color:#334155}.fit-status{display:inline-flex;align-items:center;min-height:30px;padding:5px 9px;border-radius:999px;font-size:10.5px;font-weight:800;max-width:360px}.fit-status.fit-ok{background:#eaf9f3;color:#087257;border:1px solid #b8ead8}.fit-status.fit-bad{background:#fff1f2;color:#b42342;border:1px solid #fecdd3}
.template-toolbar{display:flex;align-items:end;gap:8px;padding:10px 14px;background:#f8fafc;border-bottom:1px solid #dbe4ed;position:sticky;top:68px;z-index:4;overflow-x:auto;white-space:nowrap}
.template-toolbar label{display:grid;gap:4px;color:#64748b;font-size:9.5px;font-weight:750}.template-toolbar select{height:34px;border:1px solid #cfd9e3;border-radius:8px;background:#fff;padding:0 8px;color:#17263d;font-size:11px;min-width:82px}.template-toolbar label:first-child select{min-width:130px}.toolbar-divider{width:1px;height:34px;background:#d9e2eb;margin:0 2px}.rich-tools{display:flex;gap:4px}.rich-tools button{width:34px;height:34px;border:1px solid #cfd9e3;background:#fff;border-radius:8px;display:grid;place-items:center;color:#334155;font-weight:800}.rich-tools button:hover{background:#eef4f8;border-color:#b9c7d5}
.template-tokenbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 14px;background:#fff;border-bottom:1px solid #dbe4ed;font-size:10.5px}.template-tokenbar>span{font-weight:800;color:#536178;margin-inline-end:2px}.template-tokenbar small{margin-inline-start:auto;color:#8290a3}.token-button{height:29px;border:1px solid #cbd8e3;border-radius:999px;background:#f8fbfd;padding:0 9px;color:#41546b;font-size:10px;font-weight:750}.token-button:hover{background:#edf5fa;border-color:#aabfd1}
.template-stage{padding:24px;overflow:auto;display:flex;flex-direction:column;align-items:center;gap:7px;min-height:0;background:linear-gradient(#e9eef3,#e3e9ef)}.a4-ruler-label{font-size:10px;color:#68798e;background:#fff;border:1px solid #d4dee7;border-radius:999px;padding:4px 9px;box-shadow:0 2px 6px rgba(15,23,42,.04)}
.template-a4-paper{box-shadow:0 22px 60px rgba(15,30,48,.16);border-color:#cfd8e2}
.rich-editable{border-radius:4px;outline:none;transition:background-color .12s ease,box-shadow .12s ease}.rich-editable:hover{background:rgba(255,245,222,.36)}.rich-editable:focus{background:#fff8e9;box-shadow:0 0 0 2px rgba(204,111,8,.18)}.subject-editable,.salutation-editable{min-height:1.3em}.body-editable{min-height:38mm}.closing-editable{min-width:65px;display:inline-block}.receipt-copy.rich-editable{min-height:1.5em}
.template-studio-actions{display:flex;align-items:center;gap:9px;padding:11px 16px;background:#fff;border-top:1px solid #d9e2eb;position:sticky;bottom:0;z-index:5}.template-studio-actions button{height:40px;border-radius:10px;border:1px solid #d4dee7;background:#fff;padding:0 13px;font-weight:800;color:#334155}.template-studio-actions .template-save{background:#a95406;color:#fff;border-color:#a95406;box-shadow:0 6px 15px rgba(169,84,6,.16)}.template-studio-actions .template-save:disabled{box-shadow:none}.receipt-lock-note{margin-inline-end:auto;display:flex;align-items:center;gap:6px;color:#087257;background:#eefaf5;border:1px solid #c1eadb;border-radius:9px;padding:7px 9px;font-size:10.5px;font-weight:750}
.document-modal.template-mode{grid-template-rows:auto 1fr}.document-modal.template-mode>.doc-header{display:flex}.document-modal.template-mode>.doc-controls{display:none}.document-modal.template-mode>#templateStudioHost{display:block;overflow:auto}

/* Exact print contract: one summons = one physical A4 page. */
@page alertSheet{size:A4 portrait;margin:0}
@media print{
  body.print-alerts{background:#fff!important;margin:0!important;padding:0!important}
  body.print-alerts .app-shell,body.print-alerts .doc-header,body.print-alerts .notice-strip,body.print-alerts .doc-controls,body.print-alerts .sticky-actions,body.print-alerts #templateStudioHost,body.print-alerts .screen-only{display:none!important}
  body.print-alerts .modal-backdrop{position:static!important;inset:auto!important;background:none!important;padding:0!important;display:block!important;backdrop-filter:none!important}
  body.print-alerts .modal{display:block!important;width:auto!important;height:auto!important;max-height:none!important;overflow:visible!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important}
  body.print-alerts .doc-body,body.print-alerts #alertPapersArea{display:block!important;overflow:visible!important;padding:0!important;margin:0!important;background:#fff!important}
  body.print-alerts #alertPapers{display:block!important;padding:0!important;margin:0!important}
  body.print-alerts .alert-sheet-card{display:block!important;width:210mm!important;height:297mm!important;margin:0!important;padding:0!important;break-after:page!important;page-break-after:always!important}
  body.print-alerts .alert-sheet-card:last-child{break-after:auto!important;page-break-after:auto!important}
  body.print-alerts .alert-sheet-card:not(.is-selected){display:none!important}
  body.print-alerts.print-single-alert .alert-sheet-card{display:none!important}
  body.print-alerts.print-single-alert .alert-sheet-card:has(.print-single-target){display:block!important}
  body.print-alerts .alert-paper{page:alertSheet!important;width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;margin:0!important;padding:var(--notice-page-padding,13mm)!important;border:0!important;border-radius:0!important;box-shadow:none!important;box-sizing:border-box!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#fff!important}
  body.print-alerts .official-document-content{flex:0 0 auto!important}
  body.print-alerts .official-letterhead{min-height:27mm!important;grid-template-columns:1fr 34mm 1fr!important;gap:4mm!important}
  body.print-alerts .morocco-coat{width:18mm!important;height:18mm!important}
  body.print-alerts .letterhead-admin,body.print-alerts .letterhead-ref{font-size:8.8pt!important;line-height:1.42!important}
  body.print-alerts .official-subject{padding-top:3mm!important;margin-top:1mm!important;gap:1.5mm!important}
  body.print-alerts .subject-rendered{font-size:13pt!important;line-height:1.35!important}
  body.print-alerts .salutation-rendered{font-size:10.5pt!important;line-height:1.4!important}
  body.print-alerts .official-recipient{font-size:calc(var(--notice-body-size,12px) * .95)!important;margin:4.5mm 0 2mm!important}
  body.print-alerts .official-body{font-size:var(--notice-body-size,12px)!important;line-height:var(--notice-line-height,1.75)!important}
  body.print-alerts .official-body p{margin:0 0 var(--notice-paragraph-gap,7px)!important}
  body.print-alerts .official-closing{font-size:var(--notice-body-size,12px)!important;margin-top:2mm!important;padding-left:15mm!important}
  body.print-alerts .official-ack{position:static!important;inset:auto!important;width:auto!important;margin-top:auto!important;margin-bottom:0!important;flex:0 0 auto!important;min-height:var(--notice-receipt-height,39mm)!important;max-height:var(--notice-receipt-height,39mm)!important;border:1px solid #aeb9c4!important;background:#fff!important;padding:5mm 6mm 4mm!important;border-radius:2.5mm!important;box-sizing:border-box!important;overflow:hidden!important}
  body.print-alerts .official-ack .receipt-title{font-size:calc(var(--notice-body-size,12px) * 1.02)!important;margin-bottom:2mm!important}
  body.print-alerts .official-ack .receipt-copy{font-size:calc(var(--notice-body-size,12px) * .88)!important;line-height:1.55!important}
  body.print-alerts .official-ack .receipt-fields{font-size:calc(var(--notice-body-size,12px) * .82)!important;gap:2.5mm 8mm!important;margin-top:3mm!important}
}
@media(max-width:900px){.template-studio-head{align-items:flex-start;flex-direction:column}.template-toolbar{top:102px}.template-stage{padding:14px;align-items:flex-start}.template-tokenbar small{width:100%;margin-inline-start:0}.template-studio-actions{overflow:auto}.alert-sheet-card{align-items:flex-start}}

/* v0.6.1 — hard anchor the acknowledgement inside the A4 safe area. */
.alert-sheet-card .alert-paper,.template-a4-paper{position:relative;padding-bottom:calc(var(--notice-page-padding,13mm) + var(--notice-receipt-height,39mm) + 6mm)}
.alert-paper .official-ack,.template-a4-paper .official-ack{position:absolute!important;inset-inline:var(--notice-page-padding,13mm)!important;bottom:var(--notice-page-padding,13mm)!important;width:auto!important;margin:0!important;height:var(--notice-receipt-height,39mm);min-height:var(--notice-receipt-height,39mm);max-height:var(--notice-receipt-height,39mm)}
@media print{
  body.print-alerts .alert-paper{position:relative!important;padding-bottom:calc(var(--notice-page-padding,13mm) + var(--notice-receipt-height,39mm) + 6mm)!important}
  body.print-alerts .official-ack{position:absolute!important;inset-inline:var(--notice-page-padding,13mm)!important;bottom:var(--notice-page-padding,13mm)!important;width:auto!important;margin:0!important;height:var(--notice-receipt-height,39mm)!important;min-height:var(--notice-receipt-height,39mm)!important;max-height:var(--notice-receipt-height,39mm)!important}
}
/* Physical coordinates fallback for print/PDF engines that do not resolve logical insets. */
.alert-paper .official-ack,.template-a4-paper .official-ack{left:var(--notice-page-padding,13mm)!important;right:var(--notice-page-padding,13mm)!important}
@media print{body.print-alerts .official-ack{left:var(--notice-page-padding,13mm)!important;right:var(--notice-page-padding,13mm)!important}}

/* FINAL production polish — shop editor reuses the approved v0.6 visual system. */
.shop-editor-modal{width:min(880px,96vw);max-height:min(900px,92vh);display:flex;flex-direction:column;background:#fff}
.shop-editor-form{padding:20px;overflow:auto;display:grid;gap:18px;background:#fbfcfd}
.shop-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.shop-form-grid label,.notes-form-label{display:grid;gap:7px;color:#53647a;font-size:11.5px;font-weight:700}
.shop-form-grid label.wide{grid-column:span 2}
.shop-form-grid input,.shop-form-grid select,.notes-form-label textarea,.partner-form-row input,.partner-form-row select{width:100%;min-height:42px;border:1px solid #d7e0e8;border-radius:10px;background:#fff;color:#18283e;padding:9px 11px;font:inherit;outline:none;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}
.shop-form-grid input:focus-visible,.shop-form-grid select:focus-visible,.notes-form-label textarea:focus-visible,.partner-form-row input:focus-visible,.partner-form-row select:focus-visible{border-color:#4b75df;box-shadow:0 0 0 3px rgba(47,104,232,.12)}
.shop-form-grid input[readonly]{background:#f2f5f8;color:#65758a;cursor:not-allowed}
.notes-form-label textarea{resize:none;min-height:88px;line-height:1.65}
.partners-form{border:1px solid #e0e7ee;border-radius:14px;background:#fff;padding:14px;display:grid;gap:12px}
.partners-form-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.partners-form-head>div{display:grid;gap:3px}.partners-form-head b{font-size:12.5px;color:#1a2b41}.partners-form-head small{font-size:10.5px;color:#8593a6}
.partners-form-head button{min-height:36px;padding:0 11px;border:1px solid #cfe0f9;border-radius:9px;background:#f2f7ff;color:#285abf;font-weight:750;display:inline-flex;align-items:center;gap:6px}
.partner-form-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(120px,.8fr) minmax(130px,.8fr) 38px;gap:8px;align-items:center;padding-top:10px;border-top:1px solid #edf1f5}
.partner-form-row:first-child{border-top:0;padding-top:0}.partner-remove{width:38px;height:38px;border:1px solid #f1cbd1;border-radius:9px;background:#fff7f8;color:#b9233c;display:grid;place-items:center}
.form-error{border:1px solid #efb4bd;background:#fff5f6;color:#a51e34;border-radius:10px;padding:10px 12px;font-size:11.5px;font-weight:700}
.shop-form-actions{position:sticky;bottom:-20px;margin:0 -20px -20px;padding:12px 20px;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-top:1px solid #e1e8ef;display:flex;justify-content:flex-end;gap:8px;z-index:2}
.shop-form-actions button{min-height:42px;border-radius:10px;padding:0 16px;border:1px solid #d7e0e8;background:#fff;color:#304158;font-weight:780;display:inline-flex;align-items:center;justify-content:center;gap:7px}.shop-form-actions .save-payment{background:var(--green);border-color:var(--green);color:#fff}.shop-form-actions .save-payment:hover{background:var(--green-dark)}
@media(max-width:720px){.shop-form-grid{grid-template-columns:1fr}.shop-form-grid label.wide{grid-column:auto}.partner-form-row{grid-template-columns:1fr 1fr}.partner-form-row select{grid-column:1/-2}.partners-form-head{align-items:flex-start;flex-direction:column}.shop-form-actions{justify-content:stretch}.shop-form-actions button{flex:1}}
.registry tbody tr[data-select-row]:focus-visible{outline:2px solid rgba(47,104,232,.72);outline-offset:-2px;background:#f5f9ff}
