:root{--red:#d12b34;--red-dark:#ae1f2b;--ink:#232a35;--text:#384252;--muted:#6d7888;--line:#e6e9ef;--bg:#f6f7fa;--white:#fff;--shadow:0 12px 35px rgba(32,40,55,.045)}
/* Nomenclature creation */
.product-modal-open{overflow:hidden}
.product-dialog{width:min(540px,100%)}
.product-dialog fieldset{border:0;padding:0;margin:0;min-width:0;display:flex;flex-direction:column;gap:8px}
.product-dialog h2{font-size:25px}
.product-dialog .dialog-header{gap:12px}
.product-dialog .close-button{flex:0 0 34px}
.product-dialog .supporting{margin:8px 0 0;font-size:12px}
.product-dialog input:disabled{background:#f5f6f8;color:#6d7888}
.product-success{border:1px solid #c7e3d3;background:#f0f9f3;color:#226341;padding:12px 16px;border-radius:11px;font-size:13px;overflow-wrap:anywhere}
.products-toolbar input{flex:1;min-width:0}
.products-toolbar button{white-space:nowrap}
.products-table td{overflow-wrap:anywhere;max-width:450px}
@media(max-width:660px){.products-toolbar{align-items:stretch}.products-toolbar input{flex:auto;width:100%}.products-table{min-width:550px!important}.product-dialog .dialog-actions button{flex:1}}
*{box-sizing:border-box}html{color-scheme:light}body{margin:0;font:15px/1.48 -apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.7}button:focus-visible,input:focus-visible{outline:3px solid #f4a2a7;outline-offset:2px}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.eyebrow{color:#b72d38;font-size:11px;letter-spacing:1.6px;text-transform:uppercase;font-weight:800}.primary{background:var(--red);color:#fff;border:1px solid var(--red);border-radius:11px;padding:12px 18px;font-weight:750;box-shadow:0 5px 15px rgba(210,44,53,.12)}.primary:hover{background:var(--red-dark)}.secondary{background:#fff;border:1px solid #dce1e8;color:#374253;border-radius:11px;padding:11px 15px;font-weight:700}.secondary:hover{border-color:#bdc5d1}.alert{border-radius:10px;padding:12px 14px;font-size:13px}.error{border:1px solid #f0bec4;background:#fff2f3;color:#982432;margin-top:14px}.supporting{color:var(--muted);font-size:13px;line-height:1.7}
/* Authentication */
.login-screen{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(ellipse 40% 40% at 6% 92%,#fae8e9 0,transparent 100%),#f8f9fb}.login-top{height:84px;display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1210px)/2));background:#fff;border-bottom:1px solid var(--line)}.logo-link{display:flex;align-items:center;gap:7px;text-decoration:none}.logo-link img{width:207px;height:auto;max-height:53px;object-fit:contain}.logo-erp{font-size:11px;letter-spacing:1.3px;color:#697585;font-weight:900}.top-label{color:#9e4149;background:#fff4f5;border:1px solid #f0d9dc;border-radius:30px;padding:8px 13px;font-size:11px;font-weight:800}.login-content{flex:1;max-width:1210px;width:100%;padding:60px 24px 70px;margin:auto;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(340px,.9fr);gap:clamp(32px,6vw,90px);align-items:center}.intro h1{color:var(--ink);font-size:clamp(42px,4.8vw,72px);line-height:1.06;letter-spacing:-3px;margin:19px 0 25px}.intro h1 span{color:var(--red)}.intro p{color:#687485;font-size:18px;max-width:560px;line-height:1.65}.intro-chips{display:flex;flex-wrap:wrap;gap:9px;margin-top:27px}.intro-chips span{border:1px solid #e5e8ef;background:white;border-radius:50px;padding:8px 13px;font-size:12px;font-weight:650;color:#5f6a7c}.intro-graphic{width:min(450px,95%);height:160px;position:relative;border-radius:21px;margin-top:48px;background:rgba(255,255,255,.72);border:1px solid #f0eef0;box-shadow:var(--shadow);overflow:hidden}.graphic-top{height:40px;padding:14px 18px;border-bottom:1px solid #eff0f2;display:flex;gap:7px}.graphic-top span{width:7px;height:7px;background:#e0e3e8;border-radius:50%}.graphic-top .graphic-dot{background:var(--red)}.graphic-grid{padding:21px;display:grid;grid-template-columns:repeat(4,1fr);gap:11px}.graphic-grid i{height:66px;border-radius:10px;background:linear-gradient(135deg,#f7f7f9,#eeeef3)}.graphic-grid i:first-child{background:linear-gradient(135deg,#f9e1e3,#fff4f4)}.login-card{background:#fff;border:1px solid #e9eaee;border-radius:24px;padding:40px;box-shadow:0 22px 70px rgba(28,35,44,.07);max-width:450px;width:100%;justify-self:end}.login-mark{width:48px;height:46px;display:flex;align-items:center;justify-content:center;border-radius:13px;background:var(--red);color:white;font-weight:900;margin-bottom:27px;letter-spacing:-1px}.login-mark span{font-size:8px;align-self:end;padding-bottom:12px;padding-left:2px}.login-card h2{margin:10px 0 3px;color:var(--ink);font-size:31px;letter-spacing:-1.1px}.login-card form{margin-top:26px;display:flex;flex-direction:column;gap:10px}.login-card label,.dialog label{font-size:13px;font-weight:750;color:#3c4555}.login-card input,.dialog input,.client-toolbar input{height:46px;border:1px solid #dce1e7;border-radius:11px;background:white;color:var(--ink);padding:11px 13px;width:100%;outline:none}.login-card input:focus,.dialog input:focus,.client-toolbar input:focus{border-color:var(--red);box-shadow:0 0 0 3px #fce8e9}.login-card label:not(:first-child){margin-top:8px}.wide-button{margin-top:10px;display:flex;align-items:center;justify-content:center;gap:12px}.security-note{font-size:11px;color:#8993a1;line-height:1.65;margin:24px 0 0}.login-footer{padding:18px 24px;font-size:11px;text-align:center;color:#89919d;border-top:1px solid var(--line)}
/* App chrome */
.app-screen{display:flex;min-height:100vh}.sidebar{width:252px;flex:0 0 252px;background:#fff;border-right:1px solid var(--line);min-height:100vh;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;z-index:30}.sidebar-head{height:125px;display:flex;flex-direction:column;justify-content:center;padding:20px 25px 16px;border-bottom:1px solid #f0f2f5}.sidebar-head img{width:190px;height:auto;max-height:53px;object-fit:contain;object-position:left}.sidebar-product{font-size:10px;color:#8b95a4;letter-spacing:1.4px;font-weight:800;padding-left:2px;margin-top:4px}.sidebar-section-title{font-size:10px;color:#a3acb8;letter-spacing:1.3px;font-weight:800;margin:24px 24px 10px}.side-nav{display:flex;flex-direction:column;gap:5px;padding:0 12px;overflow:auto;flex:1}.side-nav .sidebar-section-title{margin:14px 12px 4px}.nav-button{border:0;background:transparent;color:#596474;text-align:left;min-height:43px;padding:9px 13px;display:flex;align-items:center;gap:14px;border-radius:10px;font-size:13px;font-weight:700;width:100%;transition:background .15s}.nav-button .nav-icon{font-size:20px;color:#8490a0;line-height:1;width:21px;text-align:center;font-weight:400}.nav-button.is-active{background:#fff0f1;color:#af2530}.nav-button.is-active .nav-icon{color:var(--red)}.nav-button:not(:disabled):hover{background:#f4f5f8}.nav-button.coming{color:#a4aeba}.nav-button small{margin-left:auto;background:#f4f5f7;border-radius:30px;padding:2px 6px;font-size:9px;color:#a1a7b1}.nav-divider{height:1px;background:#eceef2;margin:12px 11px}.sidebar-bottom{padding:18px 22px 20px;border-top:1px solid #eef0f3}.sidebar-bottom p{margin:10px 0 0;color:#a3abb7;font-size:10px}.sidebar-status{color:#778393;font-size:11px}.status-dot{display:inline-block;width:7px;height:7px;background:#3cb38a;border-radius:50%;margin-right:5px}.workspace{min-width:0;flex:1}.workspace-top{height:74px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 32px;gap:16px}.top-left,.top-right{display:flex;align-items:center;gap:15px}.top-breadcrumb{color:#768294;font-size:13px}.top-breadcrumb span{color:#c6ccd5;margin:0 9px}.top-breadcrumb strong{color:#333f50}.environment{font-size:10px;color:#a8424a;background:#fff1f2;border:1px solid #f0d8db;border-radius:20px;padding:6px 10px;font-weight:800;letter-spacing:.7px}.avatar{width:32px;height:32px;background:#f6e0e1;color:var(--red);border-radius:9px;display:grid;place-items:center;font-weight:850;font-size:11px}.header-user{font-size:12px;color:#4f5d6d;font-weight:750}.link-button{background:transparent;color:#6b788b;border:0;font-size:12px;padding:8px}.menu-toggle{display:none;background:#fff;border:1px solid #e1e4e8;border-radius:10px;width:40px;height:38px;color:#526072}.workspace-body{max-width:1440px;margin:0 auto;padding:34px 35px 40px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.page-header h1{font-size:clamp(26px,3vw,37px);color:var(--ink);letter-spacing:-1.1px;line-height:1.15;margin:8px 0 7px}.page-subtitle{color:#778395;font-size:13px;margin:0}.context-banner{display:flex;gap:12px;align-items:flex-start;color:#79623e;background:#fffaf1;border:1px solid #f1e5cd;border-radius:12px;font-size:12px;line-height:1.55;padding:13px 15px;margin-bottom:22px}.banner-dot{width:20px;height:20px;border-radius:50%;border:1px solid #d7b579;color:#ad8135;flex:0 0 20px;display:grid;place-items:center;font-weight:800;font-size:11px}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.kpi-card,.data-card,.clients-summary{background:#fff;border:1px solid #e7eaf0;border-radius:16px;box-shadow:var(--shadow)}.kpi-card{min-height:166px;padding:22px}.kpi-title{display:flex;align-items:center;justify-content:space-between;color:#738093;font-size:13px;font-weight:650;gap:10px}.kpi-symbol{display:grid;place-items:center;width:34px;height:34px;background:#fff0f1;color:#c7353e;border-radius:10px;font-size:18px}.kpi-card strong{display:block;color:#26303e;font-size:31px;letter-spacing:-1px;margin-top:21px;line-height:1.1}.kpi-card small{display:block;color:#9aa3af;font-size:11px;margin-top:8px}.financial-grid,.lower-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-top:16px}.data-card{padding:24px}.data-card-title{display:flex;gap:10px;align-items:center;justify-content:space-between;color:#5e6978;font-weight:750;font-size:14px}.data-card-title span{font-size:10px;color:#ae747a;background:#fff3f4;border-radius:20px;padding:5px 9px;white-space:nowrap}.data-card>strong{display:block;color:#26303e;font-size:32px;letter-spacing:-.7px;margin:22px 0 9px}.data-card>p{font-size:12px;color:#919aa8;margin:0}.list-card{min-height:214px}.card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.card-header h2{font-size:16px;margin:0;color:#323d4a}.card-header span{font-size:11px;color:#9aa4b0}.list-items{display:flex;flex-direction:column;gap:10px}.list-row{padding:9px 0;border-top:1px solid #f0f1f4;display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px}.list-row strong{font-size:12px;color:#455163}.list-row span{color:#8e98a7}.empty-state{padding:24px 12px;border:1px dashed #e7eaf0;border-radius:11px;text-align:center;color:#a2abb6;font-size:12px;background:#fcfcfd}.workspace-footnote{font-size:11px;color:#a3acb8;margin-top:25px;text-align:center}
/* CRM */
.clients-summary{padding:20px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:17px}.clients-summary div{display:flex;flex-direction:column;gap:4px;flex:none}.clients-summary span{color:#828e9d;font-size:12px}.clients-summary strong{font-size:28px;color:#303b48}.clients-summary p{margin:0;max-width:550px;font-size:12px;color:#8893a2}.clients-card{padding:0;overflow:hidden}.client-toolbar{display:flex;gap:12px;padding:17px 20px;border-bottom:1px solid var(--line)}.client-toolbar input{max-width:540px}.table-scroll{overflow-x:auto}.clients-table{border-collapse:collapse;width:100%;min-width:660px;text-align:left;font-size:13px}.clients-table th{background:#fafbfc;color:#8893a1;font-size:11px;font-weight:750;white-space:nowrap;padding:14px 19px}.clients-table td{padding:17px 19px;border-top:1px solid #edf0f3;color:#5b6878}.clients-table .name-cell{color:#273242;font-weight:750}.table-footer{border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;padding:15px 20px;font-size:11px;color:#929cab}.table-empty{padding:45px 15px;text-align:center;color:#8895a6;font-size:13px}
/* Modal */
.dialog-backdrop{position:fixed;inset:0;background:rgba(21,28,40,.46);z-index:200;display:flex;align-items:center;justify-content:center;padding:20px}.dialog{background:#fff;border-radius:21px;width:min(460px,100%);padding:27px;box-shadow:0 30px 90px rgba(0,0,0,.22);max-height:calc(100vh - 40px);overflow-y:auto}.dialog-header{display:flex;align-items:center;justify-content:space-between}.dialog-header h2{font-size:24px;letter-spacing:-.5px;margin:6px 0}.close-button{background:#f2f4f7;border:0;border-radius:50%;width:34px;height:34px;font-size:23px;color:#657184}.dialog form{display:flex;flex-direction:column;gap:9px;margin-top:20px}.dialog label{margin-top:8px}.dialog-actions{margin-top:22px;display:flex;gap:9px;justify-content:flex-end}.mobile-bottom,.mobile-overlay{display:none}
@media(max-width:1100px){.sidebar{width:216px;flex-basis:216px}.sidebar-head{padding:19px}.sidebar-head img{width:174px}.workspace-body{padding:28px 24px}.workspace-top{padding:0 24px}.kpi-card{padding:19px}.login-content{gap:36px}}
@media(max-width:900px){.login-content{grid-template-columns:1fr;justify-items:stretch;gap:33px;max-width:680px;padding:50px 24px}.login-card{max-width:none;justify-self:auto}.intro-graphic{display:none}.intro h1{font-size:52px}.sidebar{position:fixed;transform:translateX(-100%);transition:transform .2s ease;box-shadow:10px 0 30px rgba(0,0,0,.06)}.sidebar.is-open{transform:translateX(0)}.menu-toggle{display:block}.mobile-overlay:not([hidden]){display:block;position:fixed;inset:0;background:rgba(16,24,36,.36);z-index:25}.workspace-body{padding:26px 22px 90px}.mobile-bottom{display:flex;justify-content:space-around;align-items:stretch;position:fixed;bottom:0;left:0;right:0;background:rgba(255,255,255,.97);border-top:1px solid var(--line);z-index:20;min-height:68px;padding-bottom:env(safe-area-inset-bottom)}.bottom-button,.bottom-disabled{border:0;background:none;color:#929aa7;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:22px;gap:1px}.bottom-button.is-active{color:var(--red)}.bottom-button small,.bottom-disabled small{font-size:10px;font-weight:750}.header-user{display:none}}
@media(max-width:660px){.login-top{padding:0 19px;height:70px}.logo-link img{width:157px}.logo-erp{font-size:10px}.top-label{font-size:9px;padding:6px 8px}.login-content{padding:34px 17px 46px}.intro h1{font-size:39px;letter-spacing:-1.7px}.intro p{font-size:15px;margin:0}.intro-chips{gap:6px;margin-top:17px}.intro-chips span{font-size:10px;padding:6px 10px}.login-card{padding:26px;border-radius:20px}.login-card h2{font-size:26px}.workspace-top{height:66px;padding:0 16px}.top-right{gap:9px}.environment{font-size:9px;padding:5px 6px}.avatar{display:none}.top-breadcrumb{font-size:12px}.workspace-body{padding:20px 14px 110px}.page-header{align-items:flex-start;flex-direction:column}.page-header h1{font-size:29px}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.kpi-card{padding:15px;min-height:138px}.kpi-card strong{font-size:27px}.kpi-symbol{width:28px;height:28px;font-size:16px}.financial-grid,.lower-grid{grid-template-columns:1fr;gap:10px;margin-top:10px}.data-card{padding:19px}.data-card>strong{font-size:28px}.clients-summary{flex-direction:column;align-items:flex-start;padding:16px}.client-toolbar{flex-direction:column;padding:14px}.client-toolbar input{max-width:none}.table-footer{flex-direction:column}.dialog{padding:21px}.sidebar{width:min(280px,82vw)}}

/* RoofStone ERP v0.4 pilot: orders and warehouse */
.warehouse-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.warehouse-summary > span { padding:18px 16px; background:#fff; border:1px solid #e5e7ee; border-radius:16px; display:flex; flex-direction:column; gap:5px; color:#667085; font-size:13px; }
.warehouse-summary strong { color:#222a39; font-size:26px; font-weight:750; }
.warehouse-task-list { display:grid; gap:15px; }
.warehouse-task { background:#fff; padding:18px; border:1px solid #e5e7ee; border-radius:16px; }
.warehouse-task h3 { margin:0 0 7px; font-size:18px; color:#2b3442; }
.warehouse-task p { font-size:13px; color:#546072; line-height:1.5; margin:5px 0; overflow-wrap:anywhere; }
.task-line { display:grid; grid-template-columns:minmax(0,1fr) 100px auto; align-items:center; gap:8px; padding:10px 0; border-top:1px solid #eef0f5; }
.task-line label { min-width:0; font-size:14px; font-weight:600; color:#263044; }
.task-line input { width:100%; min-width:0; padding:9px; border:1px solid #cfd3dd; border-radius:9px; }
.task-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-top:10px; }
.task-actions button, .orders-action { border-radius:9px; padding:9px 13px; font-size:13px; }
.orders-action { margin:2px; border:1px solid #d7dce4; background:#fff; color:#243045; cursor:pointer; }
.orders-status { font-weight:700; color:#3c4c65; }
.orders-status.paused { color:#a45b0a; }
.orders-status.ready { color:#0f766e; }
.table-scroll .clients-table td { vertical-align:middle; white-space:normal; min-width:100px; }
@media(max-width:900px){.warehouse-summary{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.warehouse-summary {gap:8px}.task-line{grid-template-columns:minmax(0,1fr) 85px}.task-line button{grid-column:1 / -1}.warehouse-task{padding:14px}.table-scroll .clients-table{min-width:850px}}

#client-form select,#client-form input { width:100%; }
#client-business-fields { display:grid; gap:10px; }

/* RoofStone ERP v0.5 — Справочник клиентов */
.catalog-toolbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.catalog-toolbar input[type=search]{flex:2 1 225px;min-width:190px}
.catalog-toolbar select{flex:1 1 138px;min-width:135px;padding:11px 10px;border:1px solid #d5dbe5;border-radius:10px;background:#fff;color:#253248}
.catalog-toolbar .secondary{flex:0 0 auto}
.catalog-pager{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.catalog-pager .secondary{padding:7px 11px;font-size:12px}
.catalog-actions{white-space:nowrap!important;min-width:175px!important}
.catalog-actions button{font-weight:700}
.catalog-actions .danger-action{color:#b73541;border-color:#edd4d6}
.catalog-dialog{max-width:760px;width:calc(100% - 28px);max-height:calc(100dvh - 42px);overflow:auto;scrollbar-width:thin;padding:28px 34px}
.catalog-dialog form>label,.catalog-dialog .form-two label{display:block;margin:13px 0 6px;font-size:13px;color:#344056;font-weight:750}
.catalog-dialog input:not([type=checkbox]),.catalog-dialog textarea,.catalog-dialog select{width:100%;border:1px solid #d6dce6;background:#fff;border-radius:11px;padding:11px 12px;color:#263043;font-size:15px;min-height:43px;max-width:100%;}
.catalog-dialog textarea{resize:vertical;min-height:65px}
.catalog-dialog input:focus-visible,.catalog-dialog textarea:focus-visible,.catalog-dialog select:focus-visible{outline:2px solid #e6929a;outline-offset:1px;border-color:#d74952}
.catalog-dialog #client-type{background:#fbf3f4;border-color:#ebc5c9;font-weight:800}
.form-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-group-biz{padding:13px 16px 17px;margin-top:14px;border:1px solid #e6e9ee;border-radius:13px;background:#fbfcfd}
.catalog-section{border-top:1px solid #e6e9ee;margin-top:22px;padding-top:17px}
.catalog-section h3{font-size:15px;color:#222c3c;font-weight:800;margin:0 0 10px}
.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.category-grid label{display:flex;align-items:center;gap:7px;padding:9px 11px;border:1px solid #e5e9ef;border-radius:10px;background:#fafbfc;font-weight:650;font-size:12px;color:#3a4557;cursor:pointer}
.category-grid label input{accent-color:#cc2b37;width:17px;height:17px;flex-shrink:0}
.form-note{display:block;color:#6d7888;font-size:12px;margin:7px 0}
.row-between{display:flex;justify-content:space-between;gap:8px;align-items:center}
.row-between .small-action{padding:7px 11px;font-size:12px}
.contacts-list{display:grid;gap:12px}
.contact-row{border:1px solid #e3e7ed;background:#fcfcfd;border-radius:12px;padding:13px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.contact-row .contact-field{font-size:12px;color:#3c4656;font-weight:650;display:grid;gap:5px}
.contact-row .contact-field input{margin:0;min-width:0}
.contact-primary{display:flex;gap:7px;align-items:center;font-size:12px;cursor:pointer}
.contact-primary input{accent-color:#cc2b37}
.contact-row>button{justify-self:end}
.catalog-dialog .dialog-actions{position:sticky;bottom:-28px;background:#fff;border-top:1px solid #eaedf2;padding:13px 0 0;margin-top:22px;z-index:3}
@media(max-width:900px){.catalog-toolbar input[type=search]{flex:1 1 100%}.catalog-toolbar select{flex:1 1 31%}.catalog-dialog{max-width:720px}}
@media(max-width:600px){.catalog-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding:18px 16px;border-radius:16px}.form-two,.contact-row,.category-grid{grid-template-columns:1fr}.catalog-toolbar{padding:12px}.catalog-toolbar input[type=search]{min-width:0}.catalog-toolbar select{flex:1 1 45%;min-width:130px}.catalog-dialog h2{font-size:23px}.catalog-dialog .dialog-actions{bottom:-18px}.clients-table{min-width:960px}}

/* v0.5.1: region + city selectors and checkbox fixes */
.catalog-dialog select{height:46px;width:100%;min-width:0;max-width:100%;padding:10px 12px;border:1px solid #dce1e7;border-radius:11px;background:#fff;color:#273242;font:inherit}
.catalog-dialog input[type="search"]{width:100%;min-width:0}
.catalog-dialog .city-custom-toggle{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:650;margin:10px 0 6px;line-height:1.35}
.catalog-dialog .city-custom-toggle input[type="checkbox"]{width:18px;height:18px;flex:0 0 18px;padding:0;margin:0;accent-color:#d12b34}
.catalog-dialog #client-city-manual-box{padding:8px 0 12px}
.catalog-dialog .geo-section{margin-top:17px}
.catalog-dialog .geo-pickers{margin-top:12px}
.catalog-dialog .geo-region-action{display:flex;align-items:end}
.catalog-dialog .geo-region-action button{min-height:44px;width:100%;white-space:normal}
.catalog-dialog .geo-selected{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 4px;min-height:32px}
.catalog-dialog .geo-chip{display:inline-flex;gap:7px;align-items:center;border:1px solid #e5cdd0;background:#fff5f5;color:#8c2631;border-radius:20px;font-size:12px;font-weight:650;padding:6px 7px 6px 12px;max-width:100%;overflow-wrap:anywhere}
.catalog-dialog .geo-chip button{border:0;border-radius:50%;height:23px;width:23px;flex:0 0 23px;background:#f6e0e2;color:#73202a;font-size:16px;line-height:20px}
.catalog-dialog .geo-empty{font-size:12px;color:#808d9d}
.catalog-dialog .category-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.catalog-dialog .category-grid label{min-width:0;display:flex;align-items:center;justify-content:flex-start;gap:11px;white-space:normal;overflow-wrap:anywhere;line-height:1.4;min-height:44px;position:static!important}
.catalog-dialog .category-grid label input[type="checkbox"]{width:18px!important;height:18px!important;flex:0 0 18px;padding:0!important;margin:0!important;position:static!important;display:inline-block!important;min-width:18px!important}
@media(max-width:600px){.catalog-dialog .category-grid{grid-template-columns:1fr}.catalog-dialog .geo-pickers{grid-template-columns:1fr}.catalog-dialog .geo-region-action{align-items:stretch}}

/* RoofStone ERP v0.5.2: INN/BIC lookup and single geography block */
.catalog-dialog .lookup-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px}
.catalog-dialog .lookup-actions button{min-height:42px}
.catalog-dialog .lookup-actions .form-note{flex:1 1 190px}
.catalog-dialog .lookup-feedback{font-size:12px;line-height:1.55;color:#35604a;margin:8px 0;white-space:pre-wrap}
.catalog-dialog .lookup-feedback.is-warning{color:#9a4334;font-weight:700}
.catalog-dialog .lookup-results{display:grid;gap:6px;margin:8px 0}
.catalog-dialog .lookup-result{text-align:left;line-height:1.5;color:#263243;border:1px solid #d7dee9;background:#fbfcff;border-radius:10px;padding:10px 12px;font-size:13px;cursor:pointer}
.catalog-dialog .lookup-result:hover{background:#fff5f5;border-color:#dfa9ad}
.catalog-dialog .bank-section{border-top:1px dashed #dce0e8;margin-top:20px;padding-top:14px}
.catalog-dialog .bank-action{display:flex;align-items:end}
.catalog-dialog .bank-action button{min-height:43px;width:100%}
.catalog-dialog .geo-custom-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px;margin-top:16px}
.catalog-dialog .geo-custom-row button{min-height:44px}
.catalog-dialog [hidden]{display:none!important}
@media(max-width:600px){.catalog-dialog .geo-custom-row{grid-template-columns:1fr}.catalog-dialog .bank-action{align-items:stretch}}

/* v0.6 client 360: accessible overlay that does not alter existing CRM editor. */
.client360-dialog{width:min(1000px,calc(100% - 28px));max-width:1000px;max-height:calc(100dvh - 32px);overflow-y:auto;padding:24px 28px;background:#fff;border:1px solid #e0e3e9;border-radius:18px}
.client360-dialog [hidden]{display:none!important}
.client360-top{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.client360-top h2{font-size:27px;margin:6px 0;color:#222a39}
.client360-actions{display:flex;gap:9px;align-items:center}
.client360-actions .secondary{font-size:13px}
.client360-muted{font-size:12px;color:#667085;margin:10px 0;line-height:1.5}
.client360-notice{padding:10px 13px;border-radius:10px;background:#fff8ec;border:1px solid #f4e3c6;color:#7d5a1e;font-size:12px;line-height:1.5;margin:12px 0}
.client360-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:14px 0}
.client360-kpi{padding:13px;border:1px solid #e2e5ec;background:#fcfcfe;border-radius:12px;display:grid;gap:4px}
.client360-kpi span{font-size:12px;color:#6f7786}.client360-kpi strong{font-size:20px;color:#252f40;overflow-wrap:anywhere}
.client360-tabs{display:flex;gap:5px;overflow-x:auto;padding:2px 0 10px;border-bottom:1px solid #e6e8ee;scrollbar-width:thin}
.client360-tabs button{background:none;border:0;border-radius:8px;padding:9px 11px;white-space:nowrap;font-size:13px;font-weight:700;color:#667080;cursor:pointer}
.client360-tabs button.is-selected{color:#a82734;background:#fff1f2}
.client360-scroll{margin-top:16px;min-height:140px}
.client360-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.client360-list{display:grid;gap:9px}
.client360-record{padding:13px 15px;border:1px solid #e7e9ef;border-radius:12px;background:#fcfdff;display:flex;justify-content:space-between;align-items:flex-start;gap:15px;overflow-wrap:anywhere}
.client360-record strong{font-size:14px;color:#253042}.client360-record p{font-size:12px;color:#657181;margin:5px 0 0;line-height:1.5}
.client360-side{flex:0 0 auto;font-size:11px;color:#8a5360;text-align:right;max-width:35%}
.client360-empty{padding:22px;border:1px dashed #dce1e9;background:#fafbfc;border-radius:12px;text-align:center;font-size:13px;color:#788291}
.client360-editable{margin:14px 0 0}
.client360-entry{display:grid;gap:11px;border:1px solid #e8eaf0;border-radius:12px;padding:14px;background:#fbfcfe;margin:12px 0}
.client360-entry h3{font-size:15px;margin:0;color:#283242}
.client360-entry label{font-size:12px;font-weight:700;color:#455267;display:grid;gap:5px}
.client360-entry input,.client360-entry select,.client360-entry textarea{width:100%;min-width:0;border:1px solid #d4dbe6;border-radius:9px;padding:10px 11px;font-size:14px;background:#fff;color:#283242}
.client360-entry button{justify-self:start}
@media(max-width:650px){.client360-dialog{width:calc(100% - 14px);max-height:calc(100dvh - 14px);padding:15px 14px}.client360-top{flex-wrap:wrap}.client360-top h2{font-size:21px}.client360-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.client360-grid{grid-template-columns:1fr}.client360-record{flex-direction:column}.client360-side{max-width:none;text-align:left}}


/* RoofStone ERP v0.6.2 — compact geography selectors and international phone controls */
.catalog-dialog .geo-pickers{display:grid;grid-template-columns:1fr;gap:13px;margin-top:14px}
.catalog-dialog .geo-picker-row>label{display:block;font-size:13px;font-weight:750;margin:0 0 6px;color:#344056}
.catalog-dialog .geo-input-combo{display:flex;align-items:stretch;min-width:0;border:1px solid #d7dee8;border-radius:12px;overflow:hidden;background:white;box-shadow:0 1px 1px rgba(28,37,55,.025)}
.catalog-dialog .geo-input-combo:focus-within{outline:2px solid #e6929a;outline-offset:1px}
.catalog-dialog .geo-input-combo select,.catalog-dialog .geo-input-combo input{flex:1 1 auto;width:0;min-width:0;border:0!important;border-radius:0!important;outline:0!important;box-shadow:none!important;min-height:46px;background:white}
.catalog-dialog .geo-input-combo .geo-combo-add{flex:0 0 124px;min-width:0;border:0;border-left:1px solid #ebd5d8;border-radius:0;background:#fff3f4;color:#9f2a36;font-size:13px;font-weight:750;cursor:pointer;padding:0 9px}
.catalog-dialog .geo-input-combo .geo-combo-add:hover{background:#fbe7e9}
.catalog-dialog .geo-input-combo .geo-combo-add:disabled{opacity:.5;cursor:default}
.catalog-dialog .geo-custom-row{display:block;margin-top:14px}
.catalog-dialog .phone-composite{display:flex;align-items:stretch;border:1px solid #d6dce6;border-radius:11px;background:#fff;min-width:0;min-height:46px;overflow:hidden}
.catalog-dialog .phone-composite:focus-within{outline:2px solid #e6929a;outline-offset:1px}
.catalog-dialog .phone-composite .phone-country{flex:0 0 135px;min-width:0;max-width:135px;height:auto;min-height:45px;border:0!important;border-right:1px solid #e4e7ed!important;border-radius:0!important;padding:7px 6px!important;font-size:13px!important;color:#344056;background:#fcfdff!important}
.catalog-dialog .phone-composite .phone-prefix{display:flex;align-items:center;justify-content:center;flex:0 0 41px;min-width:35px;color:#c52b3a;font-weight:800;font-size:15px;padding:0 4px;white-space:nowrap}
.catalog-dialog .phone-composite input[type="tel"]{border:0!important;border-radius:0!important;outline:0!important;min-height:44px;box-shadow:none!important;min-width:0;font-size:15px;padding:8px 7px!important}
.catalog-dialog .phone-composite input[type="tel"].phone-other-code{flex:0 0 53px;width:53px!important;border-right:1px solid #e4e7ed!important}
.catalog-dialog .phone-composite input[type="tel"].phone-other-code[hidden]{display:none!important}
.catalog-dialog .phone-composite #client-phone,.catalog-dialog .phone-composite .phone-national{flex:1 1 auto;width:0!important}
.catalog-dialog .contact-field .phone-composite{margin:0}
.catalog-dialog .phone-composite-contact .phone-country{flex-basis:102px;max-width:102px;font-size:12px!important}
.catalog-dialog .phone-composite-contact .phone-prefix{flex-basis:35px}
@media(max-width:600px){
  .catalog-dialog .geo-input-combo .geo-combo-add{flex-basis:104px;font-size:12px}
  .catalog-dialog .phone-composite .phone-country{flex-basis:95px;max-width:95px;font-size:12px!important}
  .catalog-dialog .phone-composite .phone-prefix{flex-basis:35px;font-size:13px}
  .catalog-dialog .phone-composite input[type="tel"]{font-size:14px!important;padding-left:5px!important}
}


/* v0.6.3 — Collapsible left navigation and denser client editor */
.sidebar-head{position:relative;padding-right:53px}
.sidebar-brand-mark{min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px}
.sidebar-brand-mark img{max-width:100%;height:auto}
.sidebar-collapse-toggle{position:absolute;top:17px;right:12px;width:34px;height:34px;border:1px solid #e2e6ed;border-radius:10px;background:#fff;color:#667388;font-size:16px;display:flex;align-items:center;justify-content:center;transition:background .16s,border-color .16s}
.sidebar-collapse-toggle:hover{background:#f3f5f9;border-color:#cbd3df}
.sidebar-collapse-toggle:focus-visible{outline:3px solid #ecb4ba;outline-offset:2px}
.sidebar{transition:width .18s ease,flex-basis .18s ease}
@media (min-width:901px){
  .app-screen.sidebar-collapsed .sidebar{width:76px!important;flex:0 0 76px!important}
  .app-screen.sidebar-collapsed .sidebar-head{height:125px;flex:none;align-items:center;justify-content:center;padding:15px 5px 10px;gap:7px}
  .app-screen.sidebar-collapsed .sidebar-brand-mark{height:44px;width:35px;overflow:hidden;flex:none;position:relative}
  .app-screen.sidebar-collapsed .sidebar-brand-mark img{width:180px!important;min-width:180px!important;height:44px;max-height:44px;max-width:none!important;object-fit:contain;object-position:left center;display:block}
  .app-screen.sidebar-collapsed .sidebar-product{display:none}
  .app-screen.sidebar-collapsed .sidebar-collapse-toggle{position:static;flex:0 0 32px;height:32px;width:42px}
  .app-screen.sidebar-collapsed .sidebar-section-title{display:none}
  .app-screen.sidebar-collapsed .side-nav{padding:9px 9px;gap:7px;overflow-x:hidden}
  .app-screen.sidebar-collapsed .side-nav .nav-button{justify-content:center;width:56px;height:46px;min-height:46px;padding:0;margin:0 auto;gap:0;position:relative}
  .app-screen.sidebar-collapsed .side-nav .nav-button .nav-icon{font-size:23px;width:auto}
  .app-screen.sidebar-collapsed .side-nav .nav-button span:not(.nav-icon),
  .app-screen.sidebar-collapsed .side-nav .nav-button small{display:none}
  .app-screen.sidebar-collapsed .nav-divider{margin:9px 7px}
  .app-screen.sidebar-collapsed .sidebar-bottom{padding:18px 0;text-align:center}
  .app-screen.sidebar-collapsed .sidebar-bottom .sidebar-status{font-size:0}
  .app-screen.sidebar-collapsed .sidebar-bottom .status-dot{margin:0;width:11px;height:11px}
  .app-screen.sidebar-collapsed .sidebar-bottom p{display:none}
}
@media(max-width:900px){
  .sidebar-collapse-toggle{display:none}
  .sidebar-head{padding-right:20px}
  .sidebar{transition:transform .2s ease}
}
/* Compact client editor without reducing touch target size */
.catalog-dialog{padding:22px 26px;max-width:820px}
.catalog-dialog .dialog-header h2{margin:2px 0}
.catalog-dialog #client-form{margin-top:12px;gap:5px}
.catalog-dialog form>label,.catalog-dialog .form-two label{margin:8px 0 4px}
.catalog-dialog input:not([type=checkbox]),.catalog-dialog textarea,.catalog-dialog select{padding:9px 11px;min-height:44px}
.catalog-dialog .catalog-section{margin-top:16px;padding-top:12px}
.catalog-dialog .catalog-section h3{margin-bottom:7px}
.catalog-dialog .form-group-biz{margin-top:9px;padding:11px 13px 13px}
.catalog-dialog .geo-pickers{gap:9px;margin-top:10px}
.catalog-dialog .geo-picker-row>label{margin:0 0 4px}
.catalog-dialog .geo-custom-row{margin-top:9px}
.catalog-dialog .category-grid{gap:6px}
.catalog-dialog .category-grid label{padding:7px 10px;min-height:42px}
.catalog-dialog .form-note{margin:4px 0;line-height:1.45}
.catalog-dialog .dialog-actions{bottom:-22px;padding:10px 0 0;margin-top:15px}
@media(max-width:600px){
  .catalog-dialog{padding:16px 14px;width:calc(100% - 12px);max-height:calc(100dvh - 12px)}
  .catalog-dialog #client-form{gap:6px}
  .catalog-dialog .dialog-actions{bottom:-16px}
}

/* v0.6.4: official RoofStone roll mark in compact sidebar; full logo when expanded */
.sidebar-roll-icon{display:none}
@media (min-width:901px){
  .app-screen.sidebar-collapsed .sidebar-brand-mark{height:54px!important;width:54px!important;overflow:visible!important;align-items:center!important}
  .app-screen.sidebar-collapsed .sidebar-brand-mark img{display:none!important}
  .app-screen.sidebar-collapsed .sidebar-roll-icon{display:block;width:39px;height:49px;flex:none;background-image:url('/portal/roofstone-logo.jpg');background-position:left center;background-repeat:no-repeat;background-size:200px auto}
}

/* v0.6.5: approved RS compact mark, functional icon navigation and real charts */
.sidebar-brand-mark .sidebar-rs-icon{display:none}
@media(min-width:901px){
  .app-screen.sidebar-collapsed .sidebar-brand-mark img.sidebar-rs-icon{display:block!important;width:51px!important;min-width:0!important;height:51px!important;max-height:51px!important;max-width:51px!important;object-fit:cover!important;border-radius:11px;box-shadow:0 2px 9px rgba(0,0,0,.13)}
  .app-screen.sidebar-collapsed .sidebar-head{height:125px}
}
.nav-button:not(:disabled){cursor:pointer;color:#465164}
.nav-button .nav-icon svg{display:block;width:22px;height:22px}
.nav-button:not(:disabled):focus-visible,.kpi-action:focus-visible,.period-switch button:focus-visible{outline:3px solid #b82332;outline-offset:2px}
.nav-button.is-active{color:#aa1f2d;background:#fff0f1}
.nav-button.is-active .nav-icon{color:#c22b35}
.nav-button:not(.is-active) .nav-icon{color:#4d5869}
.nav-button:not(.is-active):hover .nav-icon{color:#b92834}
.kpi-action{display:block;text-align:left;width:100%;border:1px solid #e7eaf0;cursor:pointer;font-family:inherit}
.kpi-action:hover{border-color:#e8b8bf;box-shadow:0 4px 18px rgba(184,42,60,.11)}
.analytics-chart-card{margin-top:16px}
.chart-top{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:12px}
.chart-top h2{margin:0 0 4px;font-size:17px;color:#26303e}.chart-top p{font-size:12px;color:#778395;margin:0}
.period-switch{display:inline-flex;border:1px solid #e3e5e9;border-radius:11px;overflow:hidden;background:#fff;flex:none}
.period-switch button{border:none;border-right:1px solid #e8e8ed;background:#fff;padding:10px 13px;color:#526077;font-weight:700;font-size:12px;font-family:inherit;cursor:pointer}
.period-switch button:last-child{border-right:none}.period-switch button.is-current{background:#ffebee;color:#b52c39}
.rs-chart{min-height:205px;width:100%;overflow:hidden;color:#8a95a4;font-size:13px}.rs-chart svg{display:block;width:100%;height:auto;max-height:330px}
.chart-caption{margin-top:9px;color:#7f8b9c;font-size:12px;line-height:1.5}
.analytics-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.analytics-kpi{background:#fff;border:1px solid #e7eaf0;border-radius:14px;padding:16px;box-shadow:var(--shadow)}
.analytics-kpi small{display:block;color:#667487;font-size:12px}.analytics-kpi strong{display:block;margin-top:9px;color:#283444;font-size:24px}
.module-awaiting{max-width:760px;text-align:left}.module-awaiting .status-dot{display:inline-block}.module-awaiting h2{font-size:19px;margin:10px 0}.module-awaiting p{color:#667487}
@media(max-width:1040px){.analytics-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.chart-top{flex-direction:column}.period-switch{max-width:100%}.analytics-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-kpi strong{font-size:20px}.nav-button .nav-icon svg{width:22px;height:22px}}

/* v0.6.6 — controls for audit filter and first-source attribution */
.audit-controls { margin-bottom:16px; }
.audit-filter-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin-bottom:12px; }
.audit-filter-grid label { display:block;font-size:12px;margin-bottom:5px; }
.audit-filter-grid input, .audit-filter-grid select { box-sizing:border-box;min-width:0;width:100%; }
#client-source[readonly], #client-source-medium[readonly], #client-source-campaign[readonly] { opacity:.75;cursor:not-allowed; }
@media(max-width:600px) { .audit-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* v0.6.7 — narrower client modal and reusable marketing attribute pickers */
.catalog-dialog { width:min(650px,calc(100% - 28px)); max-width:650px; padding:20px 23px; }
.catalog-dialog .supporting { font-size:12px; line-height:1.35; margin:5px 0 7px; }
.catalog-dialog #client-form { gap:4px; margin-top:10px; }
.catalog-dialog .client-basic-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:10px 12px; }
.catalog-dialog .client-field { min-width:0; }
.catalog-dialog .client-field>label { display:block; font-size:12px; margin:0 0 4px; }
.catalog-dialog input:not([type=checkbox]),.catalog-dialog select { font-size:13px; min-height:41px; height:41px; padding:8px 10px; border-radius:9px; }
.catalog-dialog textarea { font-size:13px; padding:8px 10px; }
.catalog-dialog .phone-composite { min-height:41px; }
.catalog-dialog .phone-composite .phone-country { flex-basis:98px; max-width:98px; min-height:40px; font-size:12px!important; padding:5px!important; }
.catalog-dialog .phone-composite .phone-prefix { flex-basis:32px; min-width:32px; padding:0 3px; font-size:13px; }
.catalog-dialog .phone-composite #client-phone { min-width:0; padding:7px 5px; font-size:13px; }
.catalog-dialog .catalog-section { margin-top:11px; padding-top:10px; }
.catalog-dialog .catalog-section h3 { font-size:14px; margin-bottom:6px; }
.catalog-dialog .form-two { gap:10px; }
.catalog-dialog .geo-pickers { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.catalog-dialog .geo-input-combo select,.catalog-dialog .geo-input-combo input { min-height:41px; }
.catalog-dialog .geo-input-combo .geo-combo-add { flex-basis:96px; font-size:12px; }
.catalog-dialog .category-grid label { min-height:38px; padding:6px 8px; font-size:12px; }
.catalog-dialog .form-group-biz { margin-top:8px; padding:10px 12px; }
.catalog-dialog .dialog-actions { bottom:-20px; margin-top:11px; padding-top:9px; }
.catalog-dialog .attribution-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 11px; margin-top:7px; }
.catalog-dialog .attribution-input-row { display:flex; min-width:0; gap:5px; }
.catalog-dialog .attribution-input-row input { min-width:0; flex:1; }
.catalog-dialog .attribution-add { height:41px; min-width:41px; flex:none; padding:0; border:1px solid #ecd2d6; background:#fff1f2; color:#ab2934; border-radius:9px; font-size:20px; font-weight:650; }
.catalog-dialog .attribution-add:hover { background:#ffe5e7; }
.catalog-dialog .attribution-add:disabled { opacity:.45; cursor:not-allowed; }
.catalog-dialog .attribute-status { font-size:12px; margin:6px 0 0; color:#346b4f; }
.catalog-dialog .attribute-status.is-error { color:#ac2a36; }
@media(max-width:700px) {
  .catalog-dialog { width:calc(100% - 12px); padding:16px 15px; max-height:calc(100dvh - 12px); }
  .catalog-dialog .client-basic-grid { grid-template-columns:1fr; gap:8px; }
  .catalog-dialog .attribution-fields { grid-template-columns:1fr; }
  .catalog-dialog .geo-pickers { grid-template-columns:1fr; }
  .catalog-dialog .form-two { grid-template-columns:1fr; }
  .catalog-dialog .dialog-actions { bottom:-16px; }
}

/* v0.6.8 — single-purpose plus button, tighter client layout and unobstructed footer */
.catalog-dialog { max-width:620px; width:min(620px,calc(100% - 24px)); max-height:calc(100dvh - 24px); overflow:hidden; display:flex; flex-direction:column; padding:16px 19px 13px; }
.catalog-dialog .dialog-header { flex:0 0 auto; }
.catalog-dialog .dialog-header h2 { font-size:21px; margin:1px 0 3px; }
.catalog-dialog .supporting { flex:0 0 auto; margin:2px 0 4px; }
.catalog-dialog #client-form { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; padding:1px 5px 12px 1px; margin-top:5px; gap:3px; scroll-padding-bottom:16px; }
.catalog-dialog .client-basic-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px 9px; }
.catalog-dialog .client-basic-grid>.client-field:nth-child(1), .catalog-dialog .client-basic-grid>.client-field:nth-child(4) { grid-column:span 2; }
.catalog-dialog .client-basic-grid>.client-field:nth-child(2), .catalog-dialog .client-basic-grid>.client-field:nth-child(3) { grid-column:span 3; }
.catalog-dialog .client-field>label { margin:0 0 3px; }
.catalog-dialog input:not([type=checkbox]),.catalog-dialog select { height:40px; min-height:40px; padding:7px 9px; }
.catalog-dialog .phone-composite { min-height:40px; }
.catalog-dialog .phone-composite .phone-country { min-height:39px; max-width:90px; flex-basis:90px; }
.catalog-dialog .phone-composite .phone-prefix { min-width:29px; flex-basis:29px; font-size:13px; }
.catalog-dialog .phone-composite #client-phone { min-width:0; font-size:13px; padding:5px 6px!important; }
.catalog-dialog .catalog-section { margin-top:9px; padding-top:8px; }
.catalog-dialog .catalog-section h3 { margin-bottom:5px; font-size:13px; }
.catalog-dialog .category-grid { gap:5px; }
.catalog-dialog .category-grid label { min-height:33px; padding:5px 8px; font-size:12px; }
.catalog-dialog .category-grid label input[type="checkbox"] { width:17px!important; height:17px!important; flex-basis:17px; min-width:17px!important; }
.catalog-dialog .form-note { margin:3px 0; }
.catalog-dialog .geo-selected { margin:6px 0 2px; min-height:26px; }
.catalog-dialog .attribution-add { height:40px; min-width:40px; }
.catalog-dialog .attribution-add:disabled { background:#f4f5f6; border-color:#e1e4e8; color:#97a0ab; opacity:1; }
.catalog-dialog .dialog-actions { flex:0 0 auto; position:static; bottom:auto; margin:0; padding:10px 0 0; border-top:1px solid #e8ebf0; background:#fff; }
.catalog-dialog .attribute-editor { border:1px solid #e9c7cc; background:#fff8f8; border-radius:11px; padding:10px; margin-top:8px; }
.catalog-dialog .attribute-editor label { display:block; font-size:12px; font-weight:700; margin:0 0 6px; }
.catalog-dialog .attribute-editor-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.catalog-dialog .attribute-editor-row input { flex:1 1 185px; min-width:0; }
.catalog-dialog .attribute-editor-row button { min-height:40px; padding:8px 11px; font-size:12px; }
@media(max-width:700px) {
  .catalog-dialog { width:calc(100% - 12px); padding:12px 13px 10px; max-height:calc(100dvh - 12px); }
  .catalog-dialog .client-basic-grid { grid-template-columns:1fr; }
  .catalog-dialog .client-basic-grid>.client-field:nth-child(n) { grid-column:auto; }
  .catalog-dialog .attribution-fields { grid-template-columns:1fr; }
}


/* v0.6.10 — one 42px control system throughout the client editor.
   Composite phone / geography shells must include their own border in 42px. */
.catalog-dialog input:not([type="checkbox"]):not([type="hidden"]),
.catalog-dialog select {
  box-sizing:border-box;
  height:42px;
  min-height:42px;
  max-height:42px;
  padding:8px 10px;
  border:1px solid #d6dce6;
  border-radius:9px;
}
.catalog-dialog .phone-composite,
.catalog-dialog .geo-input-combo {
  box-sizing:border-box;
  height:42px;
  min-height:42px;
  max-height:42px;
  border:1px solid #d6dce6;
  border-radius:9px;
  overflow:hidden;
}
/* The two 1px shell borders leave exactly 40px for the children. */
.catalog-dialog .phone-composite .phone-country,
.catalog-dialog .phone-composite input[type="tel"],
.catalog-dialog .geo-input-combo select,
.catalog-dialog .geo-input-combo input:not([type="checkbox"]) {
  box-sizing:border-box;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  border-top:0!important;
  border-bottom:0!important;
  border-radius:0!important;
}
.catalog-dialog .phone-composite .phone-prefix {
  height:40px;
  min-height:40px;
  max-height:40px;
}
.catalog-dialog .geo-input-combo select,
.catalog-dialog .geo-input-combo input:not([type="checkbox"]) {
  border-left:0!important;
  border-right:0!important;
}
.catalog-dialog .geo-input-combo .geo-combo-add {
  height:40px;
  min-height:40px;
  max-height:40px;
  border-radius:0;
}
.catalog-dialog .attribution-add {
  height:42px;
  min-height:42px;
  max-height:42px;
}


/* RoofStone ERP v0.6.10.1 — unified inline, tap-friendly contextual help */
.rs-help-trigger{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 19px!important;width:19px!important;height:19px!important;min-width:19px!important;min-height:19px!important;padding:0!important;margin:0 0 0 6px!important;vertical-align:middle!important;border:1px solid #bfc8d5!important;border-radius:50%!important;background:#f4f6f9!important;color:#5b6474!important;font-family:system-ui,-apple-system,sans-serif!important;font-size:12px!important;font-weight:800!important;line-height:1!important;cursor:pointer!important;box-shadow:none!important}
.rs-help-trigger:focus-visible{outline:2px solid #ae252e!important;outline-offset:3px!important}
.rs-help-trigger:hover,.rs-help-trigger[aria-expanded="true"]{background:#fff0f1!important;color:#9c202d!important;border-color:#d49da6!important}
.rs-label-caption{display:inline-flex;align-items:center;gap:0;min-width:0}
.rs-help-popover{position:fixed;z-index:18000;width:min(325px,calc(100vw - 24px));max-height:min(280px,calc(100dvh - 24px));overflow:auto;background:#fff;color:#303746;border:1px solid #dde2e9;box-shadow:0 18px 50px rgba(18,30,49,.22);border-radius:12px;padding:14px 16px 15px;line-height:1.48;box-sizing:border-box}
.rs-help-popover[hidden]{display:none!important}
.rs-help-popover-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px}
.rs-help-popover-title{font-size:13px;font-weight:800;color:#252d3c;line-height:1.3}
.rs-help-popover-body{font-size:13px;color:#586476;margin:0;white-space:pre-line;overflow-wrap:anywhere}
.rs-help-popover-close{font-size:18px;line-height:1!important;background:transparent!important;border:0!important;box-shadow:none!important;color:#788396!important;padding:3px 6px!important;min-width:28px!important;min-height:28px!important;border-radius:7px!important;cursor:pointer}
.rs-help-popover-close:focus-visible{outline:2px solid #ae252e;outline-offset:2px}
@media(max-width:620px){.rs-help-popover{width:min(300px,calc(100vw - 20px));padding:12px 14px}.rs-help-trigger{margin-left:5px!important}}

/* RoofStone ERP v0.6.11 — independent, stage-gated workflows */
.wf-toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;padding:14px 16px;margin:12px 0}
.wf-toolbar label{display:block;font-size:12px;font-weight:750;color:#435066}
.wf-toolbar select{min-width:210px;max-width:370px;height:42px;padding:7px 11px;border:1px solid #d6dce6;border-radius:10px;background:#fff;color:#263043;font-size:13px}
.wf-toolbar button{min-height:42px}
.wf-board{display:flex;gap:10px;overflow-x:auto;overscroll-behavior-x:contain;padding:8px 2px 18px;scrollbar-width:thin;align-items:flex-start}
.wf-column{flex:0 0 226px;min-width:226px;max-width:226px;background:#f1f3f7;border:1px solid #e6eaf0;border-radius:13px;min-height:165px;padding:9px;display:flex;flex-direction:column;gap:8px}
.wf-column-head{display:flex;justify-content:space-between;gap:8px;align-items:center;color:#344152;padding:8px 5px;font-size:12px;line-height:1.4}
.wf-count{font-size:12px;background:#fff;padding:3px 8px;border-radius:9px;color:#788292}
.wf-case{width:100%;text-align:left;display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #e2e6ed;border-radius:11px;padding:13px;color:#263043;min-height:88px;box-shadow:0 2px 7px rgba(25,35,50,.035);font-size:13px;overflow-wrap:anywhere}
.wf-case:hover{border-color:#db7a85;box-shadow:0 4px 12px rgba(55,43,48,.08)}
.wf-case:focus-visible{outline:3px solid #f4a2a7;outline-offset:2px}
.wf-case strong{line-height:1.38}.wf-case small,.wf-muted{color:#7b8798;font-size:12px;line-height:1.5}
.wf-done{color:#14845f;font-size:11px;font-weight:700}.wf-overdue{font-size:11px;font-weight:800;color:#bd2938}
.wf-empty{color:#a1aab7;text-align:center;font-size:12px;padding:20px 6px;margin:0}
.wf-detail,.wf-dossier{margin-top:13px;padding:20px}
.wf-detail h4,.wf-dossier h4{margin:18px 0 8px;color:#394457;font-size:13px}
.wf-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.wf-detail-heading h3{font-size:17px;color:#273242;margin:0}
.wf-check{border:1px solid #edf0f4;padding:11px 12px;border-radius:10px;display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:7px 0}
.wf-check-label{font-size:12px;font-weight:700;color:#3d495b;flex:1 1 170px}
.wf-check-note{height:40px;min-width:150px;flex:2 1 240px;padding:8px 11px;border:1px solid #dbe0e7;border-radius:9px;font:inherit;font-size:12px}
.wf-next{margin-top:12px}.wf-event,.wf-dossier-case{margin:6px 0;padding:8px 10px;background:#f8f9fb;border-radius:9px;color:#667489;font-size:12px}
.wf-create-dialog{max-width:510px;width:min(510px,100%)}
.wf-create-dialog label{display:block;margin-top:11px}.wf-create-dialog select,.wf-create-dialog input{height:42px;padding:8px 11px;border:1px solid #d6dce6;border-radius:9px;font-size:13px;background:#fff;min-width:0;width:100%}
@media(max-width:670px){.wf-toolbar{align-items:stretch}.wf-toolbar select{width:100%;max-width:none}.wf-toolbar label{width:100%}.wf-column{flex-basis:210px;min-width:210px;max-width:210px}.wf-detail,.wf-dossier{padding:14px}.wf-detail-heading h3{font-size:15px}.wf-check-note{flex-basis:100%}}

.wf-assign{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:9px 0}.wf-assign label{font-size:12px;font-weight:750}.wf-assign select{max-width:250px;min-width:150px;height:40px;padding:8px 10px;border:1px solid #d6dce6;border-radius:9px;background:white;color:#384252}

/* v0.6.12 pilot UI: accessible pipeline tiles and visible case modal */
.wf-hidden-selector{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
.wf-pipeline-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:10px;margin:12px 0 20px}
.wf-pipeline-tile{min-height:88px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;text-align:left;gap:9px;border:1px solid #d8dce2;border-radius:12px;background:#fff;color:#1b2430;padding:15px;cursor:pointer}
.wf-pipeline-tile small{font-size:12px;color:#667085}
.wf-pipeline-tile.is-selected{border:2px solid #b4232a;background:#fff8f8}
.wf-pipeline-tile:focus-visible,.wf-case:focus-visible{outline:3px solid #b4232a;outline-offset:2px}
.wf-modal-detail:not([hidden]){position:fixed!important;inset:0!important;z-index:2000!important;overflow-y:auto!important;display:block!important;background:rgba(15,23,42,.56)!important;padding:clamp(15px,5vh,60px) max(12px,calc((100vw - 780px)/2))!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.wf-modal-detail:not([hidden])>*{background:white}
.wf-modal-detail:not([hidden]){color:#1b2430}
.wf-modal-detail:not([hidden]) .wf-detail-heading{padding:16px;border-radius:12px 12px 0 0}
.wf-modal-detail:not([hidden])> :not(.wf-detail-heading){padding:12px 16px;margin:0;background:white}
.wf-modal-detail:not([hidden])>:last-child{border-radius:0 0 12px 12px;padding-bottom:24px}
@media(max-width:650px){.wf-pipeline-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.wf-modal-detail:not([hidden]){padding:12px!important}}

/* v0.6.12.1 — linked client projects */
.wf-client-projects{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px;margin:8px 0}
.wf-project-choice{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;background:#fff;border:1px solid #d5dbe2;border-radius:10px;padding:12px;min-height:72px;cursor:pointer;color:#1f2937}
.wf-project-choice.is-selected{border:2px solid #b4232a;background:#fff7f7}
.wf-project-choice small{color:#667085}
.wf-project-status{font-size:12px;color:#475467}
.wf-inline-project{border:1px solid #e4e7ec;border-radius:12px;padding:14px;margin:12px 0;background:#fafafa}
.wf-inline-project[hidden]{display:none}
.wf-inline-project label{display:block;margin-top:9px}
@media(max-width:560px){.wf-client-projects{grid-template-columns:1fr}}

/* RoofStone v0.6.13 — адаптивные фотоотчёты */
#reports-view .data-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
#reports-view .list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}
#reports-view .list-row > span {
  flex: 1 1 260px;
  overflow-wrap: anywhere;
}
#reports-view .report-details {
  width: 100%;
  padding: 24px;
  margin-top: 20px;
  box-sizing: border-box;
}
#reports-view .report-details img {
  width: 100%;
  max-height: 650px !important;
  object-fit: contain;
  border-radius: 12px;
}
#reports-view input[type="file"] {
  max-width: 100%;
  font-size: 16px;
}
@media (max-width: 700px) {
  #reports-view .report-details {
    padding: 14px;
  }
}

/* RoofStone v0.6.13 — галерея фотоотчётов */
#reports-view .rs-photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
#reports-view .rs-photo-tile {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  background: #f8f9fb;
  overflow: hidden;
}
#reports-view .rs-photo-tile img {
  display: block;
  width: 100%;
  height: 180px;
  max-height: 180px !important;
  object-fit: cover;
  border-radius: 9px;
}
#reports-view .rs-photo-tile span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #647084;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  #reports-view .rs-photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  #reports-view .rs-photo-tile img {
    height: 135px;
    max-height: 135px !important;
  }
}

/* RoofStone v0.6.13 — полноэкранный просмотр фото */
.rs-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 13, 20, .96);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px
           max(16px, env(safe-area-inset-bottom));
}
.rs-photo-viewer img {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
.rs-photo-viewer button {
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: white;
  min-height: 48px;
  font-size: 28px;
}
.rs-photo-viewer button:first-child {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  padding: 8px 18px;
  font-size: 15px;
}
.rs-photo-viewer button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}
.rs-photo-viewer button:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}
.rs-photo-viewer p {
  grid-column: 1 / -1;
  grid-row: 3;
  text-align: center;
  color: white;
  font-size: 14px;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .rs-photo-viewer {
    grid-template-columns: 38px minmax(0,1fr) 38px;
    gap: 5px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* v0.6.13 — доступность кнопок полноэкранной галереи */
.rs-photo-viewer > button {
  position: relative;
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
}
.rs-photo-viewer > button:first-child {
  grid-column: 2 / 4;
  grid-row: 1;
  justify-self: end;
  min-width: 110px;
}
.rs-photo-viewer > img {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* v0.6.13 — читаемый журнал фотоотчётов */
#reports-view .list-row {
  padding: 18px 14px;
  margin: 10px 0;
  background: #fafbfc;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  font-size: 14px;
}
#reports-view .list-row strong {
  font-size: 15px;
  color: #26303e;
}
#reports-view .list-row span {
  font-size: 13px;
  line-height: 1.6;
}
#reports-view .list-row button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 10px;
}

/* RoofStone ERP v0.6.13 — Industrial Report Cards */
#reports-view .rs-report-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin: 16px 0;
  background: #fff;
  border: 1px solid #dce1e8;
  border-left: 5px solid #c8202e;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(20,28,40,.05);
}
#reports-view .rs-report-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
#reports-view .rs-report-card strong {
  font-size: 21px;
  font-weight: 800;
  color: #202733;
  line-height: 1.3;
}
#reports-view .rs-report-card-content > span {
  font-size: 13px;
  color: #697586;
  line-height: 1.6;
}
#reports-view .rs-report-stage {
  padding: 9px 13px;
  background: #f1f3f6;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #354153;
}
#reports-view .rs-report-status {
  padding: 7px 13px;
  border-radius: 30px;
  background: #edf0f4;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
}
#reports-view .rs-report-status[data-status="draft"] {
  background: #fff1d3;
  color: #8c5b00;
}
#reports-view .rs-report-status[data-status="submitted"] {
  background: #e5efff;
  color: #2457a5;
}
#reports-view .rs-report-status[data-status="approved"] {
  background: #dcf5e5;
  color: #17683a;
}
#reports-view .rs-report-status[data-status="rework"] {
  background: #ffe5e7;
  color: #a51f2b;
}
#reports-view .rs-report-open {
  flex-shrink: 0;
  min-height: 48px;
  padding: 13px 20px;
  font-size: 14px;
}
@media (max-width: 700px) {
  #reports-view .rs-report-card {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    gap: 16px;
  }
  #reports-view .rs-report-card strong {
    font-size: 18px;
  }
  #reports-view .rs-report-open {
    width: 100%;
  }
}

/* RoofStone v0.6.13 — Industrial Full Report */
#rs-report-screen {
  width: 100%;
  min-width: 0;
}
#rs-report-screen .rs-report-screen-toolbar {
  display: flex;
  align-items: center;
  padding: 12px 0 22px;
}
#rs-report-back {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 750;
}
#rs-report-screen-content {
  width: 100%;
  min-width: 0;
}
#rs-report-screen-content .report-details {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 30px;
  border: 1px solid #dce1e8;
  border-top: 5px solid #c8202e;
  border-radius: 18px;
  background: #fff;
  box-sizing: border-box;
}
#rs-report-screen-content .report-details h3 {
  font-size: clamp(21px, 2.5vw, 30px);
  color: #202733;
  line-height: 1.3;
}
#rs-report-screen-content .rs-photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  margin-top: 20px;
}
#rs-report-screen-content .rs-photo-tile {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e3e7ee;
  border-radius: 14px;
  background: #f7f8fa;
  overflow: hidden;
}
#rs-report-screen-content .rs-photo-tile img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 9px;
  cursor: zoom-in;
}
#rs-report-screen-content .rs-photo-tile span {
  display: block;
  padding: 8px 2px 3px;
  font-size: 12px;
  color: #657184;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  #rs-report-screen-content .report-details {
    padding: 16px;
  }
  #rs-report-screen-content .rs-photo-gallery {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
  }
  #rs-report-screen-content .rs-photo-tile img {
    height: 145px;
  }
  #rs-report-back {
    width: 100%;
  }
}

/* RoofStone v0.6.13 — Industrial Report Detail */
#rs-report-screen .rs-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e6ec;
}
#rs-report-screen .rs-detail-header-main {
  flex: 1;
  min-width: 0;
}
#rs-report-screen .rs-detail-eyebrow {
  display: block;
  color: #c8202e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
#rs-report-screen .rs-detail-project {
  margin: 0 0 10px;
  color: #202733;
  font-size: clamp(27px, 3.5vw, 42px);
  font-weight: 850;
  line-height: 1.15;
}
#rs-report-screen .rs-detail-number {
  margin: 0;
  color: #798494;
  font-size: 15px;
  font-weight: 650;
}
#rs-report-screen .rs-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  margin: 24px 0;
}
#rs-report-screen .rs-detail-stat {
  padding: 20px;
  background: #f4f6f8;
  border: 1px solid #e5e9ef;
  border-radius: 13px;
}
#rs-report-screen .rs-detail-stat span {
  display: block;
  color: #7b8797;
  font-size: 12px;
  margin-bottom: 8px;
}
#rs-report-screen .rs-detail-stat strong {
  display: block;
  color: #222b39;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 800;
}
#rs-report-screen .rs-detail-description {
  padding: 18px 22px;
  margin-bottom: 22px;
  background: #fafbfc;
  border-left: 4px solid #c8202e;
  border-radius: 10px;
}
#rs-report-screen .rs-detail-description h4 {
  margin: 0 0 9px;
  color: #26303e;
  font-size: 16px;
}
#rs-report-screen .rs-detail-description p {
  margin: 0;
  color: #526071;
  font-size: 14px;
  line-height: 1.65;
}
@media (max-width: 700px) {
  #rs-report-screen .rs-detail-stats {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  #rs-report-screen .rs-detail-stat {
    padding: 14px;
  }
  #rs-report-screen .rs-detail-project {
    font-size: 27px;
  }
}

/* RoofStone v0.6.13 — Industrial Detail Header */
#rs-report-screen-content .rs-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding: 28px;
  background: #222b38;
  border-radius: 14px;
  color: #fff;
}
#rs-report-screen-content .rs-detail-header-main {
  flex: 1;
  min-width: 0;
}
#rs-report-screen-content .rs-detail-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: #ff7b83;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
#rs-report-screen-content .rs-detail-project {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 850;
}
#rs-report-screen-content .rs-detail-number {
  margin: 0;
  color: #c8d0da;
  font-size: 14px;
  font-weight: 600;
}
#rs-report-screen-content .rs-detail-header .rs-report-status {
  flex-shrink: 0;
}
#rs-report-screen-content .rs-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
#rs-report-screen-content .rs-detail-stat {
  padding: 20px;
  background: #f4f6f8;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
}
#rs-report-screen-content .rs-detail-stat span {
  display: block;
  color: #748093;
  font-size: 12px;
  margin-bottom: 8px;
}
#rs-report-screen-content .rs-detail-stat strong {
  display: block;
  color: #222b38;
  font-size: 21px;
}
#rs-report-screen-content .rs-detail-description {
  padding: 20px 0;
  border-bottom: 1px solid #e5e9ef;
}
#rs-report-screen-content .rs-detail-description h4 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #263140;
}
@media (max-width: 700px) {
  #rs-report-screen-content .rs-detail-header {
    padding: 20px;
  }
  #rs-report-screen-content .rs-detail-stats {
    gap: 8px;
  }
  #rs-report-screen-content .rs-detail-stat {
    padding: 12px;
  }
  #rs-report-screen-content .rs-detail-stat strong {
    font-size: 15px;
  }
}

/* Fix: visible project title in report header */
#rs-report-screen-content .rs-detail-header-main {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  visibility: visible !important;
  opacity: 1 !important;
}
#rs-report-screen-content .rs-detail-project {
  display: block !important;
  color: #ffffff !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#rs-report-screen-content .rs-detail-number {
  display: block !important;
  color: #d5dce5 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* RoofStone — single frame stage control */
#rs-report-screen-content .rs-stage-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dce2e9;
  border-radius: 14px;
  background: #fff;
  margin: 20px 0;
}
#rs-report-screen-content .rs-stage-toolbar > label {
  display: flex !important;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
  margin: 0 !important;
  font-size: 13px;
  font-weight: 700;
  color: #667386;
}
#rs-report-screen-content .rs-stage-toolbar select {
  flex: 1;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  color: #263140;
}
#rs-report-screen-content .rs-stage-save {
  flex-shrink: 0;
  min-height: 44px;
  border-radius: 9px;
  background: #c8202e;
  color: #fff;
}

/* RoofStone — four report information blocks */
#rs-report-screen-content .rs-detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 700px) {
  #rs-report-screen-content .rs-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* RoofStone v0.6.13 — Photo Report Journal Grid */
#rs-reports-journal .rs-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
#rs-reports-journal .rs-report-grid .rs-report-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e1e6ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(25,35,50,.06);
}
#rs-reports-journal .rs-report-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  flex: 1;
}
#rs-reports-journal .rs-report-card-content strong {
  font-size: 18px;
  line-height: 1.35;
}
#rs-reports-journal .rs-report-open {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
}
@media (max-width: 1000px) {
  #rs-reports-journal .rs-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  #rs-reports-journal .rs-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* RoofStone — photo report card covers */
#rs-reports-journal .rs-report-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #263140, #465467);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}
#rs-reports-journal .rs-report-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#rs-reports-journal .rs-report-grid .rs-report-card {
  border-left: 1px solid #e1e6ed;
  transition: transform .2s ease, box-shadow .2s ease;
}
#rs-reports-journal .rs-report-grid .rs-report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(25,35,50,.12);
}

/* RoofStone v0.6.13 — Work Stages Service */
#work-stages-view #rs-stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#work-stages-view .rs-stage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 18px 20px;
  background: #f7f8fa;
  border: 1px solid #e2e7ed;
  border-left: 4px solid #c8202e;
  border-radius: 12px;
}
#work-stages-view .rs-stage-row > strong {
  flex: 1 1 220px;
  color: #263140;
  font-size: 16px;
}
#work-stages-view .rs-stage-row > span {
  flex: 1 1 240px;
  color: #667386;
  font-size: 13px;
}
#work-stages-view .rs-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#work-stages-view .rs-stage-actions button {
  min-height: 40px;
  border-radius: 9px;
  font-size: 13px;
}
#work-stages-view #rs-stage-add {
  background: #c8202e;
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
}
@media (max-width: 600px) {
  #work-stages-view .rs-stage-row {
    padding: 15px;
  }
  #work-stages-view .rs-stage-actions {
    width: 100%;
  }
}

/* RoofStone v0.6.13 — installation navigation */
.sidebar .nav-button[data-view="reports"],
.sidebar .nav-button[data-view="work-stages"] {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
  min-width: 0;
  text-align: left;
}
.sidebar .nav-button[data-view="reports"] .nav-icon,
.sidebar .nav-button[data-view="work-stages"] .nav-icon {
  flex: 0 0 24px;
}
.sidebar .nav-button[data-view="reports"] > span:last-child,
.sidebar .nav-button[data-view="work-stages"] > span:last-child {
  min-width: 0;
  white-space: nowrap;
}

/* RoofStone v0.6.13 — installation navigation */
.sidebar .nav-button[data-view="reports"],
.sidebar .nav-button[data-view="work-stages"] {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
  min-width: 0;
  text-align: left;
}
.sidebar .nav-button[data-view="reports"] .nav-icon,
.sidebar .nav-button[data-view="work-stages"] .nav-icon {
  flex: 0 0 24px;
}
.sidebar .nav-button[data-view="reports"] > span:last-child,
.sidebar .nav-button[data-view="work-stages"] > span:last-child {
  min-width: 0;
  white-space: nowrap;
}

/* RoofStone — report details without work quantity */
#rs-report-screen-content .rs-detail-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 600px) {
  #rs-report-screen-content .rs-detail-stats {
    grid-template-columns: 1fr;
  }
}

/* RoofStone — create photo report form */
#rs-report-create-screen {
  width: 100%;
  min-width: 0;
}
#rs-report-create-screen .rs-report-create-panel {
  max-width: 900px;
  padding: 32px;
}
#rs-report-create-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 24px;
}
#rs-report-create-form label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #344054;
  margin-top: 12px;
}
#rs-report-create-form select,
#rs-report-create-form textarea,
#rs-report-create-form input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid #dce2e9;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
}
#rs-report-create-form textarea {
  min-height: 130px;
  resize: vertical;
}
#rs-report-create-form #rs-create-submit {
  align-self: flex-start;
  margin-top: 14px;
}
@media(max-width:600px) {
  #rs-report-create-screen .rs-report-create-panel {
    padding: 18px;
  }
  #rs-report-create-form #rs-create-submit {
    width: 100%;
  }
}

/* Users, project access, and personal cabinets. */
.access-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.access-toolbar label { display:grid; gap:8px; flex:1; max-width:540px; font-size:13px; font-weight:600; }
.access-toolbar input { width:100%; padding:11px 13px; border:1px solid #dce2e9; border-radius:9px; font:inherit; }
.access-muted { color:#64748b; font-size:13px; line-height:1.6; }
.access-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.access-actions button { white-space:normal; }
.access-badge { display:inline-block; margin-top:5px; padding:4px 9px; border-radius:7px; background:#eaf0f6; color:#334155; font-size:12px; }
.access-badge.is-enabled { background:#e7f5ed; color:#166534; }
.access-badge.is-disabled { background:#fff0ed; color:#9f2d22; }
#access-users-tbody td { vertical-align:top; padding-top:18px; padding-bottom:18px; }
#access-users-tbody .access-actions { max-width:360px; }
#access-assignments-panel { margin-top:24px; }
.access-assignment { border-top:1px solid #e5eaf0; padding:20px 0; }
.access-assignment h3 { margin:0 0 4px; }
.access-project-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr)); gap:18px; margin:22px 0; }
.access-project-card { display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.access-project-card h2,.access-project-card p { margin:0; }
.access-project-card button { margin-top:auto; }
.access-project-details { display:grid; grid-template-columns:max-content 1fr; gap:12px 24px; }
.access-project-details dt { color:#64748b; }
.access-project-details dd { margin:0; overflow-wrap:anywhere; }
.access-dialog { width:min(540px,calc(100vw - 28px)); max-height:calc(100dvh - 40px); box-sizing:border-box; border:1px solid #e2e8f0; border-radius:18px; padding:28px; color:#172238; box-shadow:0 20px 90px #17223833; }
.access-dialog::backdrop { background:#17223888; }
.access-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.access-dialog h2 { margin:0; font-size:22px; }
.access-form { display:grid; gap:16px; }
.access-form > label { display:grid; gap:7px; font-size:13px; font-weight:600; }
.access-form input:not([type="checkbox"]),.access-form select { width:100%; min-width:0; box-sizing:border-box; border:1px solid #cbd5e1; border-radius:8px; background:white; padding:11px 12px; font:inherit; font-weight:400; }
.access-form input:disabled,.access-form select:disabled { background:#f1f5f9; color:#64748b; }
.access-form .access-check { display:flex; align-items:center; gap:10px; font-weight:400; font-size:14px; }
.access-check input { width:18px; height:18px; flex-shrink:0; accent-color:#e66b23; }
#access-permission-fields { display:grid; gap:13px; border:1px solid #e2e8f0; border-radius:10px; padding:16px; margin:0; }
#access-permission-fields legend { font-size:13px; font-weight:600; padding:0 6px; }
.access-form .chart-caption { margin:0; }
@media(max-width:600px) {
  .access-toolbar,.access-dialog-head { align-items:stretch; }
  .access-toolbar { flex-direction:column; }
  .access-dialog { padding:20px; }
  .access-actions button { min-height:40px; }
  .access-project-details { grid-template-columns:1fr; gap:6px; }
  .access-project-details dd { margin-bottom:10px; }
}


/* Compact access workspace. Other ERP screens retain their existing spacing. */
.app-screen.access-compact-workspace .workspace-body { padding:22px 24px 30px; }
#cabinet-view .page-header,#users-view .page-header { margin-bottom:14px; gap:12px; }
#cabinet-view .page-header h1,#users-view .page-header h1 { font-size:25px; line-height:1.2; letter-spacing:-.5px; margin:4px 0; }
#cabinet-view .page-subtitle,#users-view .page-subtitle { font-size:12px; line-height:1.5; }
#cabinet-view .data-card,#users-view .data-card { padding:14px; border-radius:12px; }
#cabinet-view #access-profile { display:flex; align-items:center; flex-wrap:wrap; gap:10px 22px; padding:12px 14px; }
#cabinet-view .access-profile-main { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; min-width:0; }
#cabinet-view .access-profile-main h2 { font-size:18px; line-height:1.3; margin:0; overflow-wrap:anywhere; }
#cabinet-view .access-profile-role { color:#6b7280; background:#f3f5f8; border-radius:6px; padding:3px 7px; font-size:12px; line-height:1.4; }
#cabinet-view .access-profile-meta { display:flex; flex-wrap:wrap; gap:4px 18px; min-width:0; color:#64748b; font-size:12px; line-height:1.5; }
#cabinet-view .access-profile-meta span { overflow-wrap:anywhere; }
#cabinet-view .access-project-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr)); gap:12px; margin:14px 0; align-items:start; }
#cabinet-view .access-project-card { gap:8px; padding:14px 16px; min-height:150px; }
#cabinet-view .access-project-card h2 { font-size:18px; line-height:1.3; letter-spacing:-.2px; }
#cabinet-view .access-project-card .eyebrow { font-size:10px; letter-spacing:1px; }
#cabinet-view .access-project-card p { font-size:12px; line-height:1.5; }
#cabinet-view .access-project-card > button { margin-top:auto; }
#cabinet-view .access-permission-details,#users-view .access-permission-details { width:100%; color:#64748b; font-size:12px; line-height:1.5; }
#cabinet-view .access-permission-details summary,#users-view .access-permission-details summary { cursor:pointer; width:fit-content; padding:2px 0; color:#475569; }
#cabinet-view .access-permission-details summary:focus-visible,#users-view .access-permission-details summary:focus-visible { outline:3px solid #f4a2a7; outline-offset:3px; border-radius:3px; }
#cabinet-view .access-permission-details ul,#users-view .access-permission-details ul { margin:5px 0 0; padding-left:18px; }
#cabinet-view .access-permission-details li,#users-view .access-permission-details li { margin:3px 0; overflow-wrap:anywhere; }
#cabinet-view .primary,#cabinet-view .secondary,#users-view .primary,#users-view .secondary { min-height:32px; padding:6px 10px; border-radius:8px; font-size:12px; line-height:1.5; }
#cabinet-view .access-project-details { gap:8px 18px; font-size:13px; margin:10px 0 0; }
#cabinet-view .access-toolbar h2 { margin:0; font-size:18px; line-height:1.3; }
#users-view .context-banner { padding:9px 12px; margin-bottom:14px; gap:9px; }
#users-view .access-toolbar { gap:12px; margin-bottom:12px; }
#users-view .access-toolbar label { gap:5px; font-size:12px; }
#users-view .access-toolbar input { padding:8px 10px; font-size:13px; }
#users-view #access-users-tbody td { padding:9px 10px; font-size:13px; }
#users-view .clients-table th { padding:9px 10px; font-size:12px; }
#users-view .access-muted { font-size:12px; line-height:1.4; }
#users-view .access-badge { margin-top:3px; padding:3px 7px; font-size:11px; }
#users-view .access-actions { gap:5px; }
#users-view #access-assignments-panel { margin-top:14px; }
#users-view #access-assignments-panel h2 { margin:0 0 3px; font-size:18px; }
#users-view .access-assignment { padding:12px 0; }
#users-view .access-assignment h3 { font-size:15px; margin:0 0 3px; }
#users-view .access-assignment p { margin:4px 0; font-size:12px; }
#users-view .access-assignment .access-actions { margin-top:8px; }
#access-user-dialog,#access-password-dialog,#access-assignment-dialog { padding:20px; border-radius:14px; }
#access-user-dialog .access-form,#access-password-dialog .access-form,#access-assignment-dialog .access-form { gap:12px; }
#access-user-dialog h2,#access-password-dialog h2,#access-assignment-dialog h2 { font-size:20px; }
#access-user-dialog .access-form input:not([type="checkbox"]),#access-user-dialog .access-form select,
#access-password-dialog .access-form input:not([type="checkbox"]),#access-assignment-dialog .access-form input:not([type="checkbox"]),#access-assignment-dialog .access-form select { padding:8px 10px; font-size:13px; }
#access-user-dialog .access-actions button,#access-password-dialog .access-actions button,#access-assignment-dialog .access-actions button { min-height:34px; padding:7px 12px; font-size:13px; }
#access-assignment-dialog #access-permission-fields { gap:9px; padding:12px; }
@media(pointer:coarse) {
  #cabinet-view button,#users-view button,#access-user-dialog button,#access-password-dialog button,#access-assignment-dialog button { min-height:40px; }
  #cabinet-view .access-permission-details summary,#users-view .access-permission-details summary { padding:8px 0; }
}
@media(max-width:660px) {
  .app-screen.access-compact-workspace .workspace-body { padding:16px 14px 100px; }
  #cabinet-view .page-header,#users-view .page-header { gap:9px; margin-bottom:12px; }
  #cabinet-view .page-header h1,#users-view .page-header h1 { font-size:23px; }
  #cabinet-view #access-profile { gap:8px; align-items:flex-start; }
  #cabinet-view .access-profile-meta { flex-basis:100%; gap:3px 12px; }
  #cabinet-view .access-project-grid { gap:10px; margin:12px 0; }
  #users-view .access-toolbar { gap:9px; }
  #access-user-dialog,#access-password-dialog,#access-assignment-dialog { padding:16px; }
}

/* Keep the administrator Users shortcut reachable in a narrow header. */
.workspace-top .top-left { min-width:0; }
.workspace-top .top-breadcrumb { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-top .menu-toggle,.workspace-top .top-right { flex-shrink:0; }
#users-shortcut { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
#users-shortcut .users-shortcut-icon { font-size:18px; line-height:1; }
@media(max-width:660px) {
  #users-shortcut { justify-content:center; min-width:40px; min-height:40px; padding:8px; }
  #users-shortcut .users-shortcut-label { display:none; }
}

/* RoofStone project card v1 */
#project-dossier-panel[hidden],.rs-project-card-body [hidden]{display:none!important}
.rs-project-card-body{min-width:0;overflow-wrap:anywhere}
.rs-project-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.rs-project-card-header h3{margin:0;overflow-wrap:anywhere}
.rs-project-card-header>div{min-width:0}
.rs-project-card-header>button{flex-shrink:0}
.rs-project-card-id{margin:6px 0 0;color:#667085;font-size:13px}
.rs-project-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.rs-project-card-field{padding:14px 16px;border:1px solid #e6e8ec;border-radius:12px;min-width:0}
.rs-project-card-field dt{font-size:13px;color:#667085;margin-bottom:6px}
.rs-project-card-field dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.rs-project-card-location{padding:18px;border:1px solid #e6e8ec;border-radius:14px;background:#f8f9fb}
.rs-project-card-location h4{margin:0 0 8px}
.rs-project-card-address{margin:0 0 16px;white-space:pre-wrap;overflow-wrap:anywhere}
.rs-project-map-link{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;max-width:100%;padding:12px 18px;border-radius:10px;background:#cf2635;color:#fff;font-weight:600;text-align:center;text-decoration:none;white-space:normal}
.rs-project-map-link:hover{background:#b91f2e;color:#fff}
.rs-project-map-link:focus-visible{outline:3px solid #cf2635;outline-offset:3px}
.rs-project-card-location>.wf-muted{margin:12px 0 0;font-size:13px}
.rs-project-location-form{display:grid;gap:14px;margin:16px 0}
.rs-project-coordinate-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.rs-project-coordinate-field,.rs-project-location-reason{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:14px;font-weight:600}
.rs-project-coordinate-field input,.rs-project-location-reason textarea{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:11px 12px;border:1px solid #cfd4dc;border-radius:9px;background:#fff;color:#202630;font-family:inherit;font-size:16px;line-height:1.4;font-weight:400}
.rs-project-location-reason textarea{min-height:82px;resize:vertical}
.rs-project-coordinate-field input:focus-visible,.rs-project-location-reason textarea:focus-visible{outline:2px solid #cf2635;outline-offset:2px}
.rs-project-coordinate-field input[readonly]{background:#f1f3f6}
.rs-project-coordinate-field input:disabled,.rs-project-location-reason textarea:disabled{background:#f1f3f6;color:#667085}
.rs-project-location-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.rs-project-location-actions>button{min-height:44px;white-space:normal}
.rs-project-location-message{margin:0;overflow-wrap:anywhere;font-size:14px}
.rs-project-location-message.is-error{color:#b42318}
.rs-project-location-message.is-success{color:#087443}
.rs-project-location-status{margin:8px 0 0;font-size:14px;color:#667085}
.rs-project-coordinate-help{margin:0;color:#667085;font-size:13px;font-weight:400}
.rs-project-card-section{border-top:1px solid #e6e8ec;margin-top:20px;padding-top:16px}
.rs-project-card-section h4{margin:0 0 10px}
@media(max-width:640px){.rs-project-card-grid,.rs-project-coordinate-fields{grid-template-columns:1fr}.rs-project-card-location{padding:14px}.rs-project-map-link{width:100%}}

/* Product photo and administrator edit controls. */
.dialog.product-dialog{width:min(680px,100%);max-height:calc(100dvh - 32px)}
.product-dialog #product-photo-fields{display:block;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.product-dialog #product-photo-fields legend{font-size:14px;font-weight:750;padding:0;color:var(--ink)}
.product-photo-editor{display:grid;grid-template-columns:140px minmax(0,1fr);gap:16px;margin-top:8px;align-items:start}
.product-photo-preview-box{width:140px;min-height:128px;aspect-ratio:1;background:#f8f9fb;border:1px solid var(--line);border-radius:12px;display:grid;place-items:center;overflow:hidden;color:var(--muted);text-align:center;font-size:12px;padding:8px}
.product-photo-preview-box img{width:100%;height:100%;max-height:160px;object-fit:contain}
.product-photo-editor-controls{min-width:0;display:flex;flex-direction:column;gap:8px}
.product-dialog input[type=file]{min-width:0;width:100%;height:auto;min-height:44px;padding:8px;font-size:12px}
.product-photo-editor-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.product-photo-editor-actions button{font-size:12px;min-height:40px;white-space:normal}
.product-photo-cell{width:98px;min-width:98px}
.product-photo-placeholder,.product-photo-open{width:64px;height:64px;display:grid;place-items:center;border:1px solid #e4e8ee;border-radius:10px;background:#f8f9fb;color:#8993a1;font-size:10px;line-height:1.35;text-align:center;padding:4px;overflow:hidden}
.product-photo-open:not(:disabled){cursor:zoom-in;border-color:#d8dfe8}
.product-photo-open img{display:block;width:100%;height:100%;object-fit:contain}
.product-actions{white-space:nowrap;width:130px}.product-actions button{font-size:12px;padding:10px 12px}
.dialog.product-photo-dialog{width:min(850px,100%);max-height:calc(100dvh - 32px)}
.product-photo-dialog .dialog-header{gap:16px;align-items:flex-start}
.product-photo-dialog h2{font-size:20px;overflow-wrap:anywhere}
.product-photo-dialog .close-button{flex:0 0 34px}
#product-photo-full{display:block;width:100%;max-height:70dvh;object-fit:contain;border-radius:12px;margin-top:16px;background:#f8f9fb}
@media(max-width:660px){.product-photo-editor{grid-template-columns:1fr}.product-photo-preview-box{width:120px;min-height:110px}.products-table{min-width:680px!important}.product-dialog .dialog-actions{position:sticky;bottom:-21px;background:#fff;border-top:1px solid var(--line);padding-top:12px}.product-photo-editor-controls{gap:7px}.product-dialog .dialog-actions button{min-width:0}.product-photo-dialog h2{font-size:18px}}

/* RoofStone shipments v0614 styles begin */
#shipments-view [hidden]{display:none!important}
#shipments-view{min-width:0;overflow-wrap:anywhere}
.rs-public-map-link{text-decoration:none}
#shipments-view>.data-card{margin-bottom:20px}
.rs-shipment-editor form{display:grid;gap:16px}
.rs-shipment-editor fieldset{display:grid;gap:16px;min-width:0;border:0;margin:0;padding:0}
.rs-shipment-editor label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:14px;font-weight:600}
.rs-shipment-editor input:not([type=checkbox]),.rs-shipment-editor select,.rs-shipment-editor textarea{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #cfd4dc;border-radius:9px;background:white;color:#202630;font-weight:400;font-size:16px;line-height:1.4;font-family:inherit}
.rs-shipment-editor input:disabled,.rs-shipment-editor select:disabled,.rs-shipment-editor textarea:disabled{background:#f1f3f6;color:#667085}
.rs-shipment-editor [aria-invalid=true]{outline:2px solid #b42318;outline-offset:1px}
.rs-shipment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.rs-shipment-editor .rs-shipment-confirm{display:flex;flex-direction:row;gap:10px;align-items:flex-start;line-height:1.5}
.rs-shipment-confirm input{width:20px;height:20px;flex:0 0 20px;margin-top:1px}
.rs-shipment-actions{display:flex;flex-wrap:wrap;gap:10px}
.rs-shipment-actions button,#rs-shipment-submit{min-height:44px;white-space:normal}
.rs-shipment-editor .wf-muted{font-weight:400;font-size:13px}
.rs-shipment-notice{padding:14px 16px;border:1px solid #e5c8c8;border-radius:10px;background:#fff8f8;line-height:1.55}
.rs-shipment-pending{border:2px solid #d69e25}
.rs-shipment-table-scroll{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.rs-shipment-table-scroll table{width:100%;min-width:680px}
#rs-shipment-lines input{min-width:120px;max-width:180px}
.rs-shipment-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:640px){.rs-shipment-grid{grid-template-columns:1fr}.rs-shipment-actions>button{width:100%}.rs-shipment-editor{padding:16px}}
/* RoofStone shipments v0614 styles end */

/* RoofStone embedded object map v1. */
.rs-project-map-panel{margin:16px 0;min-width:0;overflow:hidden}
.rs-project-map-frame{display:block;box-sizing:border-box;width:100%;height:380px;min-width:0;border:1px solid #dce2e9;border-radius:12px;background:#eef1f5}
.rs-project-map-caption{margin:8px 0 0;color:#667085;font-size:13px;line-height:1.5}
.rs-project-map-empty{margin:0;padding:20px 16px;border:1px dashed #cfd4dc;border-radius:12px;color:#667085;font-size:14px;line-height:1.6;background:#fff}
@media(max-width:640px){.rs-project-map-frame{height:300px}.rs-project-map-panel{margin:14px 0}}
/* End RoofStone embedded object map v1. */

/* RoofStone ReportMap1 */
.rs-report-location-map{display:grid;gap:8px;box-sizing:border-box;min-width:0;max-width:100%;margin:16px 0}
.rs-report-location-map-frame{display:block;box-sizing:border-box;width:100%;max-width:100%;height:230px;min-width:0;border:1px solid #dce2e9;border-radius:12px;background:#eef1f5}
.rs-report-location-map-caption{margin:0;color:#667085;font-size:13px;line-height:1.5}
.rs-report-location-map-link{justify-self:start;display:inline-flex;align-items:center;min-height:44px;max-width:100%;color:#b91f2e;font-size:14px;font-weight:600;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.rs-report-location-map-link:focus-visible{outline:3px solid #cf2635;outline-offset:3px;border-radius:3px}
@media(max-width:640px){.rs-report-location-map-frame{height:210px}}
/* End RoofStone ReportMap1 */

/* Price book inside the nomenclature catalog. */
.product-catalog-tabs{display:flex;gap:6px;padding:14px 20px 0;border-bottom:1px solid var(--line);overflow-x:auto}
.product-catalog-tabs [role=tab]{border:0;border-bottom:3px solid transparent;background:transparent;color:#6d7888;padding:12px 14px 13px;font-size:13px;font-weight:750;white-space:nowrap;min-height:46px}
.product-catalog-tabs [role=tab][aria-selected=true]{color:#b82835;border-bottom-color:var(--red)}
.product-catalog-tabs [role=tab]:hover{color:#b82835;background:#fff8f8}
#products-catalog-panel:focus-visible,#products-prices-panel:focus-visible{outline:2px solid #e6929a;outline-offset:-2px}
.product-pricebook-note{font-size:12px;color:#7a8695;margin:0;padding:14px 20px;border-bottom:1px solid var(--line)}
.product-prices-table{min-width:790px}
.product-prices-table .product-price-value,.product-prices-table .product-price-heading{white-space:nowrap;text-align:right}
.product-prices-table .product-price-value{font-variant-numeric:tabular-nums;color:#364152}
.product-prices-table td:nth-child(2){min-width:190px;max-width:380px;overflow-wrap:anywhere}
.product-dialog #product-price-fields{display:block;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.product-dialog #product-price-fields legend{font-size:14px;font-weight:750;padding:0;color:var(--ink)}
.product-prices-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.product-price-field{min-width:0;display:flex;flex-direction:column;gap:6px}
.product-dialog .product-price-field label{margin-top:0;font-size:12px;overflow-wrap:anywhere}
.product-dialog .product-price-field input{font-variant-numeric:tabular-nums;min-width:0}
@media(max-width:660px){.product-catalog-tabs{padding:8px 12px 0;gap:0}.product-catalog-tabs [role=tab]{padding:11px 10px;font-size:12px}.product-pricebook-note{padding:12px}.product-prices-table{min-width:740px!important}.product-prices-grid{grid-template-columns:1fr;gap:10px}}
