:root{font:14px/1.5 Arial,sans-serif;color:#243443;background:#f3f5f6;--blue:#247bab;--line:#d9e0e4}*{box-sizing:border-box}body{margin:0}header{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:13px;padding:0 32px}.brand{background:#1f789f;color:white;width:42px;height:42px;border-radius:9px;text-align:center;font:bold 29px/42px Georgia}.brand span{color:#bdde79}small{display:block;color:#778693;font-size:12px}#identity{margin-left:auto;font-size:13px}main{max-width:1200px;margin:26px auto;padding:0 24px}nav{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-bottom:24px}nav button{border:0;border-radius:0;background:none;padding:12px 0;color:#637482}nav button.active{color:var(--blue);border-bottom:3px solid var(--blue);font-weight:bold}button{font:inherit;padding:9px 15px;border:1px solid #c9d3da;border-radius:4px;background:#fff;cursor:pointer;color:#334858}button:hover{background:#eff6fa}button:disabled{opacity:.5;cursor:default}.primary{background:#77a635;color:#fff;border-color:#77a635}.primary:hover{background:#638e29}.danger{color:#a33}input,select,textarea{font:inherit;border:1px solid #cbd5db;border-radius:4px;padding:9px;background:white;max-width:100%}input:not([type=checkbox]),select,textarea{width:100%}input[type=checkbox]{accent-color:var(--blue);width:16px;height:16px}label{display:block;color:#50616e;margin:12px 0}label input:not([type=checkbox]),label select,label textarea{display:block;margin-top:5px}.card{background:white;border:1px solid var(--line);border-radius:6px;padding:24px;margin:16px 0}h1{font-size:25px;margin:0 0 8px}h2{font-size:18px;margin:0 0 14px}h3{font-size:14px;margin:24px 0 8px}p{color:#687c8c}.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.metric{padding:18px 22px;background:white;border:1px solid var(--line);border-radius:6px}.metric b{display:block;font-size:26px;margin-top:8px}.metric.paid b{color:#5e902c}.row{display:flex;gap:16px;align-items:end;flex-wrap:wrap}.row label{flex:1;min-width:180px}.row button{margin:12px 0}.hint{background:#edf7fd;color:#39748f;padding:13px 17px;border-left:3px solid #52a6d3;margin:14px 0}.banner{padding:10px 32px;background:#fff1cf;color:#7e6226}#notice{position:sticky;top:0;z-index:5;padding:14px 32px;background:#e7f1d9;white-space:pre-wrap}#notice.error{background:#fee7e5;color:#97392f}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{text-align:left;background:#f6f8fa;color:#667b89;font-weight:normal}td,th{padding:12px;border-bottom:1px solid #e5eaed;vertical-align:top}td a{color:var(--blue);word-break:break-all}.badge{display:inline-block;padding:3px 8px;border-radius:12px;background:#edf2f5;white-space:nowrap}.badge.paid{background:#eaf4dd;color:#577f2b}.badge.refunded,.badge.rejected{background:#fcebe7;color:#9e493c}.actions{display:flex;gap:6px;flex-wrap:wrap}.actions button{padding:5px 9px;font-size:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:0 28px}.settings-section{margin-bottom:24px}.check{display:flex;align-items:center;gap:9px}.check input{flex-shrink:0}.settings-layout{max-width:880px}.savebar{position:sticky;bottom:0;background:#fff;padding:14px 24px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.muted{color:#7b8994;font-size:12px}details{margin-top:12px}pre{white-space:pre-wrap;word-break:break-word;font-size:12px}dialog{border:1px solid var(--line);border-radius:8px;max-width:700px;width:95%;max-height:90vh;padding:24px}dialog::backdrop{background:#19354966}footer{display:flex;justify-content:end;gap:10px;margin-top:24px}.empty{text-align:center;padding:28px;color:#8b9aa3}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px}@media(max-width:700px){header{padding:0 16px}.summary,.grid{grid-template-columns:1fr}main{padding:0 12px;margin-top:12px}.card{padding:16px}.metric b{font-size:23px}nav{gap:16px}.toolbar{align-items:start;flex-direction:column}}
fieldset{border:0;padding:0;margin:0}

[hidden]{display:none!important}

/* Keep long forms scrollable inside the fixed MoySklad iframe. */
body.app-shell{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.app-shell>header,.app-shell>#banner,.app-shell>#notice{flex:0 0 auto}
.app-shell>main{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;width:100%;margin:0 auto;padding:20px 24px 0}
.app-shell main>nav{flex:0 0 auto;margin-bottom:16px}
.app-shell #content{flex:1 1 auto;min-height:0;overflow-y:scroll;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-color:#8da2af #e7edf1;padding:0 12px 0 0;scroll-padding:12px 0 90px}
.app-shell #content:has(.settings-layout){max-width:904px}
.app-shell #content::-webkit-scrollbar{width:12px;height:12px}
.app-shell #content::-webkit-scrollbar-track{background:#e7edf1}
.app-shell #content::-webkit-scrollbar-thumb{background:#8da2af;border:2px solid #e7edf1;border-radius:6px}
.app-shell #content:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
.app-shell .savebar{z-index:2;gap:12px;box-shadow:0 -3px 8px #2434430d}
.app-shell fieldset{min-width:0}
@media(max-width:700px){.app-shell>main{padding:12px 12px 0}.app-shell #content{padding-right:8px}.app-shell .savebar{padding:12px}}
