:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#24362f;background:#f5f7f5;font-synthesis:none;--green:#175c4b;--muted:#77817a;--line:#e4e9e5;--soft:#eef3ef}*{box-sizing:border-box}body{margin:0;font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}a{color:var(--green)}button{border:1px solid var(--line);background:white;border-radius:8px;padding:10px 14px;color:inherit;transition:background .15s}button:hover{background:#f0f4f1}.primary{background:var(--green);border-color:var(--green);color:white}.primary:hover{background:#114737}.danger{color:#b24836;border-color:#edc6be}.quiet{background:transparent;border-color:transparent}.link{padding:0;border:0;border-radius:0;color:var(--green);background:none;text-align:left;font-weight:600}.link:hover{text-decoration:underline;background:none}.muted{color:var(--muted)}.small{font-size:12px}.app-shell{display:grid;grid-template-columns:220px 1fr;min-height:100vh}.sidebar{background:#fff;border-right:1px solid var(--line);padding:30px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{font-size:22px;font-weight:800;letter-spacing:-1px;padding:0 12px}.brand span{color:var(--green)}.workspace-label{font-size:10px;letter-spacing:2px;color:var(--muted);margin:9px 12px 37px}.nav-label{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:var(--muted);margin:23px 12px 10px}.nav-button{width:100%;border:0;background:transparent;display:flex;gap:12px;align-items:center;text-align:left;margin:3px 0;padding:12px 13px;font-weight:500;color:#606d64}.nav-button svg{width:18px;height:18px}.nav-button.active{color:var(--green);background:#eaf2ee;font-weight:650}.sidebar-footer{margin-top:auto;border-top:1px solid var(--line);padding:20px 10px 0;line-height:1.7;font-size:12px}.online{display:inline-block;width:6px;height:6px;border-radius:100%;background:#4e9f7c;margin-right:6px}.main{min-width:0}.topbar{height:80px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 36px;gap:12px}.breadcrumbs{font-size:12px;color:#879088;display:flex;gap:12px}.breadcrumbs strong{color:#36493e;font-weight:500}.top-actions{display:flex;align-items:center;gap:16px}.notification-button{display:flex;gap:6px;align-items:center;position:relative;padding:8px;border:0}.notification-button svg{width:20px;height:20px}.badge{background:#d96e42;color:white;min-width:17px;height:17px;line-height:17px;text-align:center;border-radius:5px;font-size:10px}.avatar{width:33px;height:33px;background:#e4ede5;color:var(--green);border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700}.user-info{display:flex;align-items:center;gap:10px;font-size:12px}.user-info small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.page{padding:32px 36px;max-width:1800px;margin:auto}.page-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:25px}.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:1.8px;color:var(--muted);margin-bottom:8px}h1{margin:0;font-size:29px;letter-spacing:-.8px;font-weight:650}h2{font-size:18px;margin:0 0 16px}h3{font-size:14px;margin:0 0 12px}.subtitle{margin:8px 0 0;color:var(--muted);font-size:13px}.button-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.demo-banner{background:#f8efd9;border-bottom:1px solid #eee1ba;padding:9px 36px;font-size:12px;color:#876a28}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:0 0 25px}.stat{border:1px solid var(--line);border-radius:12px;padding:21px 24px;background:#fff;position:relative}.stat-label{color:var(--muted);font-size:12px;display:flex;align-items:center;gap:8px}.stat-value{font-size:28px;letter-spacing:-.8px;font-weight:650;display:block;margin:12px 0 7px}.stat-note{font-size:11px;color:var(--muted)}.stat.accent{background:#edf4ef;border-color:#dfe8e0}.stat-dot{width:7px;height:7px;border-radius:50%;background:#b7c3ba}.stat-dot.orange{background:#cf9154}.stat-dot.green{background:#5e9873}.panel{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}.panel-pad{padding:24px}.toolbar{padding:17px 20px;display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);flex-wrap:wrap}.search-wrap{display:flex;align-items:center;gap:8px;flex:1;min-width:230px;max-width:430px}.search-wrap svg{width:17px;height:17px;color:#88978c}.search-wrap input{width:100%;border:0;background:transparent;padding:8px 3px;outline-offset:0}.filters{display:flex;gap:8px;flex-wrap:wrap}.filters select,.filters input{width:auto;padding:8px 10px;font-size:12px}.filters-more{display:flex;gap:10px;align-items:end;flex-wrap:wrap;padding:12px 20px;background:#fafbf9;border-bottom:1px solid var(--line)}.filters-more label{font-size:11px}.filters-more input{padding:6px 8px;width:150px}.table-scroll{overflow:auto;max-height:65vh}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}th{background:#fafbf9;font-size:10px;text-transform:uppercase;letter-spacing:.65px;color:#899389;font-weight:600;padding:15px 18px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:1}td{padding:17px 18px;border-bottom:1px solid #edf0eb;font-size:12px;height:66px}tbody tr:hover{background:#fbfcfa}tbody tr:last-child td{border-bottom:0}.name-cell{font-size:12px;font-weight:600;display:block}.sub-cell{font-size:10px;display:block;color:#899389;margin-top:5px}.mono{font-variant-numeric:tabular-nums}.amount{text-align:right;font-weight:650}.source{font-size:11px;background:#f2f4f0;border:1px solid #e5e9e2;border-radius:5px;padding:4px 8px}.pill{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:550;padding:5px 8px;border-radius:5px;background:#f0f2ef;color:#6b776d}.pill:before{content:'';width:5px;height:5px;background:currentColor;border-radius:50%}.pill.working{background:#f8efd9;color:#a17f30}.pill.sent{background:#e9eef8;color:#6483ac}.pill.completed,.pill.paid{background:#e9f3e9;color:#53845d}.pill.waiting{background:#fbebdf;color:#bc8049}.pill.partial{background:#f8efd9;color:#a17f30}.pill.cancelled,.pill.refunded{background:#f6e8e6;color:#ad6c60}.overdue{color:#b47d48;font-size:10px;display:block;margin-top:5px}.pagination{padding:15px 20px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);color:var(--muted);font-size:11px}.pagination button{padding:5px 10px}.empty{padding:55px 20px;text-align:center;color:var(--muted);white-space:normal}.empty strong{display:block;color:#405747;font-size:17px;margin-bottom:10px}.page-foot{display:flex;justify-content:space-between;font-size:10px;color:#90998f;margin-top:20px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.span-2{grid-column:1/-1}label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:500;color:#516153}input,select,textarea{border:1px solid #dfe5dc;border-radius:7px;background:white;color:#2e4434;padding:10px 11px;width:100%}input:focus,select:focus,textarea:focus{outline:2px solid #89b7a2;border-color:transparent}textarea{resize:vertical;min-height:90px}.form-actions{margin-top:23px;display:flex;justify-content:flex-end;gap:9px}.form-error{color:#ad4937;background:#fff2ed;border:1px solid #f4d9ce;border-radius:6px;padding:10px;font-size:12px;margin:15px 0}.form-error:empty{display:none}.hint{font-size:11px;color:var(--muted);line-height:1.6;margin-top:9px}.login-layout{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;background:#fff}.login-art{background:#183e32;color:#eef5ea;padding:70px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.login-art:after{content:'';position:absolute;right:-200px;bottom:-240px;width:650px;height:650px;border:1px solid #4f6f54;border-radius:50%;box-shadow:0 0 0 80px #ffffff03,0 0 0 160px #ffffff03}.login-art .brand{padding:0;color:white}.login-art h1{font-size:52px;line-height:1.14;max-width:450px;font-weight:450}.login-art p{color:#a9bfb0;line-height:1.8;max-width:360px}.login-form{padding:50px;display:flex;align-items:center;justify-content:center}.login-card{max-width:370px;width:100%}.login-card h1{font-size:27px}.login-card form{display:grid;gap:18px;margin-top:30px}.login-card .primary{padding:13px}.login-bottom{font-size:11px;line-height:1.7;color:var(--muted);margin-top:25px}.login-demo{background:#f7f2e4;padding:14px;border-radius:8px;font-size:12px;line-height:1.6;margin-top:20px}.login-demo code{font-size:11px}.login-demo button{margin-top:8px;font-size:11px}dialog{border:1px solid var(--line);border-radius:14px;padding:0;max-width:850px;width:calc(100% - 30px);max-height:90vh;color:#24362f;box-shadow:0 24px 100px #0d28152b}dialog::backdrop{background:#142d2360;backdrop-filter:blur(2px)}.dialog-header{padding:23px 26px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:white;z-index:2}.dialog-header h2{margin:0}.dialog-body{padding:24px 26px}.dialog-section{border-top:1px solid var(--line);margin-top:25px;padding-top:24px}.dialog-header button{border:0;font-size:18px;padding:2px 8px}.summary-line{display:flex;gap:25px;flex-wrap:wrap;margin-bottom:22px;background:#f4f7f2;padding:18px;border-radius:8px}.summary-line strong{display:block;font-size:19px;margin-top:4px}.comment{padding:14px 0;border-bottom:1px solid var(--line)}.comment p{white-space:pre-wrap;line-height:1.6;margin:8px 0 0;font-size:13px;overflow-wrap:anywhere}.comment-head{display:flex;justify-content:space-between;color:var(--muted);font-size:11px}.comment-head strong{color:#4c6555}.two-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.report-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px}.report-row{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.note{background:#f1f5ef;border:1px solid #e1e9dc;border-radius:8px;padding:14px 17px;line-height:1.65;font-size:12px;color:#64765f;margin-bottom:18px}.integration-card{padding:18px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px}.notice-row{padding:18px;border:1px solid var(--line);border-radius:9px;margin-bottom:10px;background:#fff}.notice-row.unread{border-left:3px solid #c99154;background:#fffcf7}.notice-row p{font-size:12px;color:var(--muted)}.notice-row .button-row{justify-content:space-between}.notice-row h3{margin:0}.loading{padding:100px;text-align:center;color:#728572}.audit-details{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;max-width:600px}.audit-details summary{cursor:pointer;color:var(--green)}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);border-radius:10px;background:#203e2e;color:#fff;padding:14px 23px;font-size:13px;box-shadow:0 8px 24px #18372333;z-index:100;display:none;max-width:90vw}#toast.show{display:block}.error-page{padding:30px;color:#ad4937}.client-picker{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end}.client-results{max-height:150px;overflow:auto;display:grid;gap:4px;margin:8px 0}.client-results button{text-align:left;padding:8px 12px;font-size:12px}.selected-client{padding:11px;background:#edf4ef;border-radius:6px;font-size:13px}.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}.section-heading h2,.section-heading h3{margin:0}.table-scroll.compact{max-height:260px}.compact td{height:auto;padding:12px}.settings-stack{display:grid;gap:22px}.nowrap{white-space:nowrap}@media(min-width:1600px){.page{padding:40px 45px}}@media(max-width:1100px){.app-shell{grid-template-columns:180px 1fr}.sidebar{padding:27px 10px}.page{padding:26px 22px}.topbar{padding:0 22px}.brand{font-size:20px}.user-info .user-text{display:none}.two-columns{grid-template-columns:1fr}.stats{gap:10px}.stat{padding:17px}.stat-value{font-size:25px}.login-art{padding:40px}.login-art h1{font-size:40px}}@media(max-width:700px){.app-shell{display:block}.sidebar{position:static;height:auto;padding:15px;border-right:0;border-bottom:1px solid var(--line)}.sidebar nav{display:flex;overflow:auto;margin-top:12px;gap:5px}.workspace-label,.nav-label,.sidebar-footer{display:none}.nav-button{width:auto;white-space:nowrap;padding:9px 12px;font-size:12px}.brand{font-size:20px}.topbar{height:60px;padding:0 15px}.breadcrumbs{font-size:10px}.top-actions{gap:8px}.page{padding:24px 15px}.page-title{align-items:flex-start}h1{font-size:25px}.stats{grid-template-columns:1fr}.stat{padding:14px 18px}.stat-value{margin:8px 0;font-size:25px}.stat-note{display:none}.report-cards{grid-template-columns:1fr 1fr}.toolbar{padding:12px}.search-wrap{max-width:none}.filters{width:100%}.filters select{flex:1;min-width:130px}.demo-banner{padding:9px 15px}.page-foot{line-height:1.6;gap:12px}.login-layout{display:block}.login-art{padding:27px}.login-art h1,.login-art p,.login-art .small{display:none}.login-form{padding:40px 25px}.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.dialog-body{padding:18px}.dialog-header{padding:18px}.page-title .button-row button{padding:9px;font-size:12px}.two-columns{grid-template-columns:1fr}.filters-more input{width:135px}}
[data-theme="dark"]{color-scheme:dark;--bg:#141518;--line:#41444c;--muted:#b5b8c2;--green:#bdcdf9;--text:#f0f1f4}
[data-theme="dark"] body,[data-theme="dark"] .main,[data-theme="dark"] .login-layout{background:#141518;color:#f0f1f4}
[data-theme="dark"] .sidebar,[data-theme="dark"] .topbar,[data-theme="dark"] .panel,[data-theme="dark"] .stat,[data-theme="dark"] dialog,[data-theme="dark"] .dialog-header,[data-theme="dark"] .notice-row,[data-theme="dark"] .login-form{background:#202226;color:#f0f1f4}
[data-theme="dark"] button,[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea{background:#2a2d33;color:#f0f1f4;border-color:#626774}
[data-theme="dark"] button:hover,[data-theme="dark"] tbody tr:hover{background:#353942}
[data-theme="dark"] button.primary{background:#c4d2ff;color:#18213b;border-color:#c4d2ff}
[data-theme="dark"] .brand,[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,[data-theme="dark"] .stat-value,[data-theme="dark"] .link,[data-theme="dark"] .name-cell,[data-theme="dark"] .breadcrumbs strong,[data-theme="dark"] label,[data-theme="dark"] .comment-head strong{color:#f0f1f4}
[data-theme="dark"] .nav-button,[data-theme="dark"] .breadcrumbs,[data-theme="dark"] .stat-label,[data-theme="dark"] th,[data-theme="dark"] td,[data-theme="dark"] .user-info{color:#d4d7df}
[data-theme="dark"] .nav-button.active,[data-theme="dark"] .stat.accent,[data-theme="dark"] .summary-line,[data-theme="dark"] .selected-client,[data-theme="dark"] .note,[data-theme="dark"] th{background:#2d3037;color:#eef0f6}
[data-theme="dark"] .source,[data-theme="dark"] .pill.paid,[data-theme="dark"] .pill.completed{background:#304f3b;color:#b9edc9}
[data-theme="dark"] .demo-banner,[data-theme="dark"] .login-demo,[data-theme="dark"] .notice-row.unread{background:#3a3423;color:#e1d5ae}
[data-theme="dark"] .form-error,[data-theme="dark"] .pill.cancelled,[data-theme="dark"] .pill.refunded{background:#472c2c;color:#ffbab0;border-color:#70413b}
[data-theme="dark"] .pill.waiting,[data-theme="dark"] .pill.partial{background:#4a3d24;color:#f1d69e}
[data-theme="dark"] .pill.working,[data-theme="dark"] .pill.sent{background:#293e4a;color:#bad7eb}
.settings-extra{margin-bottom:30px}.outstanding{margin-bottom:22px}.chat-layout{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:20px}.chat-list{max-height:70vh;overflow:auto}.chat-contact{border:0;border-bottom:1px solid var(--line);border-radius:0;width:100%;display:grid;text-align:left;gap:7px;padding:18px}.chat-contact span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}.chat-contact small{color:var(--muted)}.chat-messages{max-height:50vh;overflow:auto;display:flex;flex-direction:column;gap:12px;padding:10px 0 20px}.chat-bubble{background:#edf3ed;border-radius:12px;padding:12px 16px;max-width:85%;align-self:flex-start}.chat-bubble.out{background:#dcecdc;align-self:flex-end}.chat-bubble p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 8px;line-height:1.5}.chat-bubble small{color:var(--muted);font-size:10px}[data-theme="dark"] .chat-bubble{background:#2c2f36}[data-theme="dark"] .chat-bubble.out{background:#3a4255}td small{display:block}@media(max-width:800px){.chat-layout{grid-template-columns:1fr}.chat-list{max-height:230px}}
[data-theme="dark"] .nav-button{background:transparent;border-color:transparent}[data-theme="dark"] .nav-button.active{background:#3e4658;color:#f0f3ff}[data-theme="dark"] .nav-button:hover{background:#2d3037}[hidden]{display:none!important}
/* Align action buttons with their input fields, not the field labels. */
form[data-form="source"],form[data-form="method"]>.button-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px}
form[data-form="source"]>label,form[data-form="method"] label{min-width:0}
form[data-form="source"] input,form[data-form="method"] input,form[data-form="report"] input{height:42px;min-width:0}
form[data-form="source"]>.primary,form[data-form="method"] .primary,form[data-form="report"]>.primary{height:42px;white-space:nowrap}
form[data-form="source"]>.form-error{grid-column:1/-1;grid-row:2;margin:0}
form[data-form="report"]{display:grid;grid-template-columns:minmax(140px,190px) minmax(140px,190px) max-content;align-items:end;gap:12px;margin-bottom:22px}
form[data-form="report"]>.form-error{grid-column:1/-1;margin:0}
[data-theme="dark"] .filters-more{background:#202226}
[data-theme="dark"] .search-wrap input{background:transparent}
[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder{color:#b5b8c2;opacity:1}
#page .orders-table .pill{font-size:11px;padding:6px 10px;line-height:1.3;white-space:nowrap}
@media(max-width:520px){form[data-form="report"]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}form[data-form="report"]>.primary{grid-column:1/-1;justify-self:start}form[data-form="source"],form[data-form="method"]>.button-row{gap:8px}}
/* Graphite surfaces and explicit focus / row contrast. */
[data-theme="dark"]{background:#141518;color:#f0f1f4;--soft:#2d3037;scrollbar-color:#686d79 #202226}
[data-theme="dark"] .stat.accent,[data-theme="dark"] .note,[data-theme="dark"] .source{border-color:#535863}
[data-theme="dark"] .source{background:#30343d;color:#e0e4ee}
[data-theme="dark"] td{border-bottom-color:#41444c}
[data-theme="dark"] .sub-cell,[data-theme="dark"] .page-foot,[data-theme="dark"] .loading{color:#b5b8c2}
[data-theme="dark"] .empty strong{color:#f0f1f4}
[data-theme="dark"] .avatar{background:#3e4658;color:#f0f3ff}
[data-theme="dark"] .login-art{background:#191b20;color:#f0f1f4}
[data-theme="dark"] .login-art p{color:#b5b8c2}
[data-theme="dark"] .login-art:after{border-color:#444852}
[data-theme="dark"] .demo-banner{border-bottom-color:#66593a}
[data-theme="dark"] .danger,[data-theme="dark"] .overdue,[data-theme="dark"] .error-page{color:#ffb5a7}
[data-theme="dark"] button.primary:hover{background:#d8e1ff}
[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible{outline:2px solid #a9bdff;outline-offset:3px}
[data-theme="dark"] input:focus,[data-theme="dark"] select:focus,[data-theme="dark"] textarea:focus{outline-color:#a9bdff}
[data-theme="dark"] dialog::backdrop{background:#050609b8}
[data-theme="dark"] #toast{background:#363c49;color:#f4f5f8;border:1px solid #6b7280}
.help-guide{display:grid;gap:18px;max-width:980px}.help-guide p,.help-guide li{line-height:1.8}.help-guide li{margin-bottom:9px}.help-guide ol{padding-left:23px}.telegram-settings{margin-bottom:24px}.telegram-settings form{max-width:650px}.online.offline{background:#e27c7c}.online.checking{background:#d6b867}#connection-status{white-space:nowrap}@media(max-width:700px){.sidebar-footer{display:block;margin-top:12px;padding:10px 0 0}.sidebar-footer br{display:none}.sidebar-footer .muted{margin-left:12px}}
.login-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}.login-tools button{white-space:normal;font-size:12px;min-height:42px;margin:0}.login-tools button:first-child{text-align:left}.login-card .login-bottom{margin-top:18px}
[data-theme="dark"] .pill.working{background:#453922;color:#ffe0a0}[data-theme="dark"] .pill.sent{background:#263f58;color:#b7dcff}
form[data-form="activity-period"]{align-items:end;margin:18px 0 24px}@media(max-width:420px){.login-tools{grid-template-columns:1fr}.login-tools button{text-align:center!important}}
.login-tools{align-items:stretch}.login-tools button{height:100%}
