
:root{
  --bg:#f5f5f3;--surface:#fff;--ink:#18181b;--muted:#71717a;--line:#e7e5e4;
  --nav:#171717;--accent:#9b1737;--accent2:#741129;--soft:#f8eef1;
  --green:#166534;--greenbg:#eaf6ed;--amber:#92400e;--amberbg:#fff7ed;
  --shadow:0 14px 45px rgba(24,24,27,.08);
}
*{box-sizing:border-box} html,body{margin:0;height:100%;font-family:Inter,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg)}
button,input,select,textarea{font:inherit} button{cursor:pointer}
#app{height:100%;display:grid;grid-template-columns:240px minmax(0,1fr)}
.sidebar{background:var(--nav);padding:22px 14px 14px;color:#fff;display:flex;flex-direction:column;min-height:100vh}
.brand{display:flex;align-items:center;gap:11px;padding:0 8px 24px}
.brand-mark{width:47px;height:47px;border:1px solid rgba(255,255,255,.28);display:grid;place-items:center;font-weight:800;letter-spacing:-1px}
.brand-title{font-size:18px;font-weight:800}.brand-sub{font-size:11px;color:#a1a1aa;margin-top:2px}
.nav{border:0;background:transparent;color:#d4d4d8;text-align:left;padding:12px 14px;border-radius:9px;font-weight:650;margin-bottom:3px}
.nav:hover{background:#27272a;color:#fff}.nav.active{background:var(--accent);color:#fff}
.sidebar-spacer{flex:1}.version{font-size:11px;color:#71717a;padding:13px 8px 3px}
.main{min-width:0;overflow:hidden}.topbar{height:82px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 25px}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:.13em;color:#8a8a90;margin-bottom:4px}
h1,h2,h3{margin:0} h1{font-size:23px}h2{font-size:25px}.project-meta{font-size:12px;color:var(--muted);text-align:right}
.page{display:none;height:calc(100vh - 82px);overflow:auto;padding:19px}.page.active{display:block}
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:15px}
.search-wrap{background:#fff;border:1px solid var(--line);border-radius:10px;padding:0 11px;display:flex;align-items:center;gap:7px;min-width:330px}
.search-wrap input{border:0;outline:none;padding:10px 0;width:100%;background:transparent}
button.primary{background:var(--accent);color:#fff;border:0;padding:10px 14px;border-radius:9px;font-weight:750}
button.primary:hover{background:var(--accent2)}button.ghost{background:#fff;color:var(--ink);border:1px solid var(--line);padding:9px 13px;border-radius:9px;font-weight:650}
button.ghost:hover{background:#f7f7f6}.full{width:100%}
.pipeline{display:flex;gap:11px;overflow-x:auto;padding-bottom:14px;align-items:flex-start;min-height:calc(100vh - 155px)}
.stage-column{width:245px;min-width:245px;background:#efefec;border:1px solid var(--line);border-radius:13px;padding:9px;min-height:240px}
.stage-col-head{display:flex;align-items:center;gap:8px;padding:4px 3px 9px;font-weight:800;font-size:12px}.stage-col-head .count{margin-left:auto;background:#deddd9;border-radius:999px;padding:2px 7px;font-size:11px}
.project-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:8px;box-shadow:0 2px 8px rgba(0,0,0,.025);transition:.16s}
.project-card:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(0,0,0,.07);border-color:#d6c6cb}
.project-card .name{font-weight:800;font-size:13px;margin-bottom:5px}.project-card .addr{font-size:11px;color:var(--muted);line-height:1.35;min-height:15px}
.project-card .foot{display:flex;align-items:center;justify-content:space-between;margin-top:11px;font-size:10px;color:var(--muted)}
.project-card button{width:100%;margin-top:9px}
.workspace-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.workspace-actions{display:flex;gap:7px}.muted{color:var(--muted);font-size:12px;margin-top:5px}
.stage-strip{display:flex;gap:6px;overflow-x:auto;background:#fff;border:1px solid var(--line);border-radius:13px;padding:8px;margin-bottom:12px;position:sticky;top:-19px;z-index:10}
.stage-pill{min-width:125px;max-width:150px;border:0;border-radius:9px;padding:9px 9px;background:#f4f4f2;color:#52525b;font-size:11px;font-weight:650;line-height:1.25}
.stage-pill.past{background:var(--greenbg);color:var(--green)}.stage-pill.current{background:var(--soft);color:var(--accent);box-shadow:inset 0 0 0 1px #ecc9d2}
.stage-pill.selected{background:var(--accent);color:#fff}
.stage-content{background:#fff;border:1px solid var(--line);border-radius:14px;padding:19px;min-height:480px;box-shadow:0 3px 12px rgba(0,0,0,.025)}
.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.section-title h3{font-size:18px}.badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:800;background:var(--soft);color:var(--accent)}
.form-section{border:1px solid var(--line);border-radius:13px;padding:15px;margin-bottom:12px;background:#fff}.form-section-head{display:flex;gap:10px;align-items:flex-start;margin-bottom:13px}
.num{background:var(--accent);color:#fff;width:28px;height:28px;border-radius:8px;display:grid;place-items:center;font-weight:800;font-size:11px}
.form-section-head h4{margin:0;font-size:14px}.form-section-head p{margin:3px 0 0;color:var(--muted);font-size:11px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 13px}.field.full{grid-column:1/-1}
.field label{display:block;font-size:11px;font-weight:750;color:#65656d;margin:0 0 5px 1px}
.field input,.field select,.field textarea{width:100%;border:1px solid #deddda;border-radius:9px;padding:10px 11px;background:#fff;color:var(--ink);outline:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#c58a99;box-shadow:0 0 0 3px rgba(155,23,55,.08)}
.field textarea{min-height:92px;resize:vertical}.chips{display:flex;flex-wrap:wrap;gap:7px;background:#fafaf9;border:1px solid var(--line);border-radius:10px;padding:9px}
.chip{display:flex;align-items:center;gap:5px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 9px;font-size:11px}.chip input{width:auto}
.form-actions{display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:-19px;background:linear-gradient(transparent 0,#fff 24%);padding-top:25px;padding-bottom:2px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:15px}.kpi{border:1px solid var(--line);border-radius:12px;padding:13px;background:#fff}
.kpi .label{font-size:10px;color:var(--muted)}.kpi .value{font-size:18px;font-weight:800;margin-top:6px}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}table{border-collapse:collapse;width:100%;min-width:780px;background:#fff}
th{position:sticky;top:0;background:#f5f5f3;font-size:10px;text-align:left;color:#606068;padding:10px;border-bottom:1px solid var(--line)}
td{font-size:11px;padding:10px;border-bottom:1px solid #efefed;vertical-align:middle}tr:hover td{background:#fcfbfb}
.status{display:inline-flex;padding:4px 7px;border-radius:999px;font-size:10px;font-weight:750;background:#f3f4f6;color:#4b5563}.status.work{background:#fff7ed;color:#9a3412}.status.done{background:#ecfdf3;color:#166534}.status.pause{background:#fef2f2;color:#991b1b}
.inline-actions{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.file-list{border:1px solid var(--line);border-radius:10px;overflow:hidden}.file-row{display:flex;align-items:center;gap:8px;padding:9px 10px;border-bottom:1px solid var(--line);font-size:11px}.file-row:last-child{border-bottom:0}.file-row .fname{flex:1;font-weight:650}
.file-upload{border:1px dashed #cfc9c7;border-radius:11px;padding:14px;background:#faf9f8}.file-upload input{width:100%}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.48);z-index:50;display:grid;place-items:center;padding:20px}.modal-backdrop.hidden{display:none}
.modal{background:#fff;width:min(760px,96vw);max-height:92vh;overflow:auto;border-radius:16px;box-shadow:var(--shadow);padding:20px}
.modal.large{width:min(1040px,97vw)}.modal h3{font-size:19px;margin-bottom:13px}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}
.modal-close{border:0;background:#f3f4f6;border-radius:8px;width:34px;height:34px;font-size:17px}
.toast{position:fixed;right:22px;bottom:22px;background:#18181b;color:#fff;border-radius:10px;padding:11px 15px;z-index:100;box-shadow:var(--shadow);font-size:12px}.toast.hidden{display:none}
.empty{padding:32px;color:var(--muted);text-align:center;border:1px dashed var(--line);border-radius:12px;background:#fafaf9}
@media(max-width:900px){
 #app{grid-template-columns:74px minmax(0,1fr)}.sidebar{padding:15px 8px}.brand-title,.brand-sub,.nav{font-size:0}.brand{padding:0 4px 18px}.brand-mark{width:44px}.nav:before{font-size:18px}.sidebar .full{font-size:0;padding:12px}.sidebar .full:after{content:"+";font-size:20px}.version{display:none}
 .topbar{padding:0 14px}.page{padding:12px}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}.workspace-head{align-items:flex-start;gap:10px;flex-direction:column}.workspace-actions{width:100%}.workspace-actions button{flex:1}.search-wrap{min-width:0;flex:1}
}
@media(max-width:620px){
 .topbar{height:auto;min-height:72px;padding:12px}.page{height:calc(100vh - 72px)}h1{font-size:19px}.project-meta{display:none}
 .stage-content{padding:12px}.form-section{padding:11px}.pipeline{min-height:auto}.stage-column{width:220px;min-width:220px}
}

/* v3.2 — item visual editor */
.item-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:18px;align-items:start}
.visual-card{position:sticky;top:0;border:1px solid var(--line);border-radius:13px;background:#fafaf9;padding:12px}
.visual-head{margin-bottom:9px}.visual-preview{height:250px;border:1px dashed #cec9c7;border-radius:11px;background:#fff;overflow:hidden;display:grid;place-items:center;margin-bottom:9px}
.visual-preview img{width:100%;height:100%;object-fit:contain;background:#fff}
.visual-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted);gap:5px;padding:18px;font-size:11px}
.visual-empty b{color:var(--ink);font-size:12px}.visual-icon{font-size:38px;color:#b7b1af;margin-bottom:3px}
.visual-card button{margin-top:7px}.visual-card button:disabled{opacity:.45;cursor:not-allowed}
.item-thumb{width:64px;height:48px;object-fit:cover;border-radius:7px;border:1px solid var(--line);background:#fff}
.no-visual{display:inline-block;color:#a1a1aa;font-size:10px;padding:5px 7px;background:#f5f5f4;border-radius:6px}
@media(max-width:900px){.item-editor-layout{grid-template-columns:1fr}.visual-card{position:static}.visual-preview{height:300px}}

/* v3.4 Reports */
.reports-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.report-loading{padding:45px;text-align:center;color:var(--muted)}
.report-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:15px}
.report-kpi{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px 18px;min-height:116px;box-shadow:0 3px 10px rgba(0,0,0,.025)}
.report-kpi.accent{background:linear-gradient(145deg,#9b1737,#741129);border-color:transparent;color:#fff}
.report-kpi-label{font-size:11px;color:var(--muted);font-weight:750}
.report-kpi.accent .report-kpi-label,.report-kpi.accent .report-kpi-sub{color:#f0cbd5}
.report-kpi-value{font-size:27px;font-weight:850;letter-spacing:-.02em;margin-top:10px}
.report-kpi-sub{font-size:10px;color:var(--muted);margin-top:7px}
.report-section{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px;margin-bottom:14px;box-shadow:0 3px 10px rgba(0,0,0,.02)}
.report-section-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:13px}
.report-section-head h3{font-size:16px;margin:0}.report-section-head p{font-size:11px;color:var(--muted);margin:4px 0 0}
.workshop-grid{display:grid;grid-template-columns:repeat(4,minmax(220px,1fr));gap:10px}
.workshop-card{border:1px solid var(--line);border-radius:12px;padding:13px;background:#fbfbfa}
.workshop-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.workshop-name{font-size:13px;font-weight:800}.workshop-sub{font-size:9px;color:var(--muted);margin-top:3px}
.workshop-percent{font-size:17px;font-weight:850;color:var(--accent)}
.stage-progress{height:6px;background:#e9e7e5;border-radius:999px;overflow:hidden;margin:12px 0}
.stage-progress>div{height:100%;background:var(--accent);border-radius:999px}
.workshop-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.workshop-stats>div{background:#fff;border:1px solid #eeecea;border-radius:9px;padding:9px;display:grid;grid-template-columns:8px auto;column-gap:6px;align-items:center}
.workshop-stats b{font-size:16px}.workshop-stats small{grid-column:1/-1;font-size:9px;color:var(--muted);margin-top:2px;padding-left:14px}
.dot{width:7px;height:7px;border-radius:50%;display:inline-block}.dot.work{background:#f59e0b}.dot.done{background:#22c55e}.dot.wait{background:#a1a1aa}.dot.pause{background:#ef4444}
.report-two-col{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,.7fr);gap:18px}
.crm-report-list{display:flex;flex-direction:column;gap:7px}
.crm-report-row{display:grid;grid-template-columns:180px minmax(100px,1fr) 34px;gap:10px;align-items:center}
.crm-report-name{font-size:10px;font-weight:650}.crm-report-bar{height:7px;background:#efefed;border-radius:999px;overflow:hidden}.crm-report-bar div{height:100%;background:#b85a72;border-radius:999px}.crm-report-count{text-align:right;font-weight:800;font-size:11px}
.report-note-card{background:#faf7f8;border:1px solid #ead9de;border-radius:12px;padding:16px;align-self:start}.report-note-title{font-size:13px;font-weight:800;color:var(--accent);margin-bottom:10px}.report-note-card p{font-size:10px;color:#57545a;line-height:1.5;margin:8px 0}
@media(max-width:1200px){.report-kpis{grid-template-columns:repeat(2,1fr)}.workshop-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:800px){.reports-head{align-items:flex-start;gap:10px;flex-direction:column}.report-kpis{grid-template-columns:1fr}.workshop-grid{grid-template-columns:1fr}.report-two-col{grid-template-columns:1fr}.crm-report-row{grid-template-columns:125px minmax(70px,1fr) 28px}}

/* v3.5 Drive */
.hidden{display:none!important}
.drive-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}
.drive-head-actions{display:flex;gap:7px}
.drive-breadcrumbs{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);min-height:28px;margin:0 0 10px 2px}
.crumb{border:0;background:transparent;padding:0;color:var(--accent);font-weight:700;cursor:pointer}
.drive-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:11px}
.folder-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:15px;text-align:left;display:flex;gap:13px;min-height:123px;transition:.16s;box-shadow:0 3px 10px rgba(0,0,0,.02)}
.folder-card:hover{transform:translateY(-2px);border-color:#d8bcc4;box-shadow:0 10px 28px rgba(0,0,0,.07)}
.folder-icon{width:50px;height:44px;border-radius:10px;background:#f5e8ec;color:var(--accent);display:grid;place-items:center;font-size:24px;font-weight:900;flex:0 0 auto}
.folder-icon.category{background:#f3eee4;color:#9a6b1f}
.folder-info{display:flex;flex-direction:column;min-width:0;flex:1}.folder-name{font-weight:820;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.folder-meta{font-size:10px;color:var(--muted);line-height:1.4;margin-top:5px;min-height:30px}.folder-foot{display:flex;justify-content:space-between;align-items:center;margin-top:auto;font-size:9px;color:var(--muted);gap:8px}.folder-foot b{color:var(--ink)}
.drive-file-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:10px}.upload-label{display:inline-flex;align-items:center;cursor:pointer}.drive-count{margin-left:auto;font-size:10px;color:var(--muted)}
.drive-files{background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}
.drive-file-row{display:grid;grid-template-columns:44px minmax(180px,1fr) 80px auto auto;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #efefed}
.drive-file-row:last-child{border-bottom:0}.drive-file-row:hover{background:#fcfbfb}
.file-type-icon{width:38px;height:38px;border-radius:8px;background:#f4f4f2;display:grid;place-items:center;font-size:10px;font-weight:850;color:#666}
.drive-file-main{min-width:0}.drive-file-name{font-size:11px;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drive-file-meta{font-size:9px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drive-file-size{font-size:9px;color:var(--muted);text-align:right}.drive-open{text-decoration:none;text-align:center}
@media(max-width:850px){.drive-head{align-items:flex-start;flex-direction:column}.drive-head-actions{width:100%}.drive-head-actions button{flex:1}.drive-file-row{grid-template-columns:40px minmax(120px,1fr) auto}.drive-file-size{display:none}.drive-file-row .ghost{font-size:0;padding:8px}.drive-file-row .drive-open:after{content:"↗";font-size:14px}.drive-file-row .drive-delete:after{content:"×";font-size:14px}}

/* v3.6 Discount + financial report */
.discount-price{color:var(--accent)}
.old-total{font-size:9px;color:var(--muted);text-decoration:line-through;margin-top:3px}
.price-card{border:1px solid #ead9de;background:#fcf8f9;border-radius:13px;padding:14px;margin-top:14px}
.price-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}
.price-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.price-grid>div,.price-grid>label{background:#fff;border:1px solid #eadfe2;border-radius:10px;padding:11px;display:flex;flex-direction:column;gap:6px}
.price-grid span{font-size:10px;color:var(--muted);font-weight:700}.price-grid b{font-size:15px}
.price-grid input{border:1px solid var(--line);border-radius:8px;padding:8px 9px;outline:none;width:100%}.price-grid input:focus{border-color:#c58a99;box-shadow:0 0 0 3px rgba(155,23,55,.07)}
.final-price{background:#f7eaee!important;border-color:#e5bec9!important}.final-price b{color:var(--accent);font-size:18px}
.discount-badge{display:none;background:var(--accent);color:#fff;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:800}.discount-badge.show{display:inline-flex}
.price-hint{font-size:9px;color:var(--muted);margin-top:9px}
.report-kpi.money-in{background:#f0fdf4;border-color:#bbf7d0}.report-kpi.money-in .report-kpi-value{color:#166534}
.report-kpi.balance{background:#fff7ed;border-color:#fed7aa}.report-kpi.balance .report-kpi-value{color:#9a3412}
.report-kpis{grid-template-columns:repeat(6,minmax(0,1fr))}
@media(max-width:1450px){.report-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.report-kpis{grid-template-columns:repeat(2,1fr)}.price-grid{grid-template-columns:1fr}}
@media(max-width:620px){.report-kpis{grid-template-columns:1fr}}

/* v3.7 Pricing settings */
.pricing-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}
.pricing-head-actions{display:flex;gap:7px}
.pricing-notice{background:#fff7ed;border:1px solid #fed7aa;color:#92400e;border-radius:11px;padding:10px 13px;font-size:10px;line-height:1.5;margin-bottom:12px}
.pricing-section{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;margin-bottom:13px;box-shadow:0 3px 10px rgba(0,0,0,.02)}
.pricing-section-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:12px}
.pricing-section-head h3{font-size:15px;margin:0}.pricing-section-head p{font-size:10px;color:var(--muted);margin:4px 0 0}
.pricing-table{min-width:760px}.pricing-table th:nth-child(n+3),.pricing-table td:nth-child(n+3){text-align:right}
.price-input{width:100%;max-width:160px;border:1px solid #ddd9d7;border-radius:8px;padding:8px 9px;text-align:right;outline:none;background:#fff}
.price-input:focus{border-color:#c58a99;box-shadow:0 0 0 3px rgba(155,23,55,.07)}
.price-unit{font-size:9px;color:var(--muted)}
.pricing-two-col{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.material-rate-list,.extra-rate-list{display:flex;flex-direction:column;gap:7px}
.material-rate-row,.extra-rate-row{display:grid;grid-template-columns:minmax(150px,1fr) 140px;align-items:center;gap:12px;padding:10px 11px;border:1px solid #eeecea;border-radius:10px;background:#fbfbfa}
.material-rate-row div,.extra-rate-row div{display:flex;flex-direction:column;gap:2px}.material-rate-row b,.extra-rate-row b{font-size:11px}.material-rate-row span,.extra-rate-row span{font-size:9px;color:var(--muted)}
.pricing-example{background:#18181b;color:#fff;border-radius:14px;padding:16px;margin-bottom:20px}.pricing-example-title{font-size:11px;color:#a1a1aa;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.pricing-formula{display:flex;flex-direction:column;gap:5px;margin:10px 0}.pricing-formula b{font-size:14px}.pricing-formula span{font-size:11px;color:#d4d4d8}.pricing-example .muted{color:#a1a1aa}
@media(max-width:950px){.pricing-two-col{grid-template-columns:1fr}.pricing-head{align-items:flex-start;flex-direction:column}.pricing-head-actions{width:100%}.pricing-head-actions button{flex:1}}
@media(max-width:600px){.material-rate-row,.extra-rate-row{grid-template-columns:1fr}.price-input{max-width:none}}

/* v3.8 automatic production dates */
.auto-date-label{font-size:8px;font-weight:700;color:var(--accent);background:var(--soft);padding:2px 5px;border-radius:999px;margin-left:4px}

/* v3.9 Closed projects */
.report-tabs{display:flex;gap:5px;background:#eae9e6;border-radius:11px;padding:4px;width:max-content;margin-bottom:12px}
.report-tab{border:0;background:transparent;color:#666;padding:8px 13px;border-radius:8px;font-size:11px;font-weight:750}
.report-tab.active{background:#fff;color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.06)}
.report-tab span{display:inline-flex;margin-left:5px;background:#e4e4e7;border-radius:999px;padding:1px 6px;font-size:9px}
.report-tab.active span{background:var(--soft);color:var(--accent)}
.report-context{border-radius:11px;padding:10px 13px;font-size:10px;line-height:1.5;margin-bottom:12px}
.active-context{background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af}
.closed-context{background:#f7f7f6;border:1px solid #dedbd8;color:#52525b}
.report-kpi.closed{background:#f4f4f2}.closed-projects-table{min-width:1000px}
.closed-project-link{border:0;background:transparent;color:var(--accent);font-weight:800;padding:0;text-align:left}
.closed-project-link:hover{text-decoration:underline}.table-sub{font-size:9px;color:var(--muted);margin-top:3px}
.money-positive{color:#166534;font-weight:750}.money-balance{color:#9a3412;font-weight:750}
.closed-stage-column{background:#e8ede8;border-color:#cad5ca}.closed-stage-column .stage-col-head{color:#285b35}
.closed-stage-column .project-card{border-color:#cfddcf}
.closed-project-banner{display:flex;align-items:center;gap:14px;background:#eef7f0;border:1px solid #cce4d1;border-radius:14px;padding:18px;margin-bottom:14px}
.closed-check{width:48px;height:48px;border-radius:50%;background:#166534;color:#fff;display:grid;place-items:center;font-size:24px;font-weight:900}
.closed-project-banner h3{margin:0 0 4px;font-size:17px;color:#14532d}.closed-project-banner p{margin:0;color:#4b6350;font-size:11px}
.closed-status-text{color:#166534!important}.closed-project-actions{display:flex;align-items:center;gap:10px;margin-top:14px;padding-top:13px;border-top:1px solid var(--line)}
#nextStageBtn:disabled{opacity:.62;cursor:default;background:#4b7a58}
@media(max-width:700px){.report-tabs{width:100%}.report-tab{flex:1}.closed-project-actions{align-items:flex-start;flex-direction:column}}

/* v3.10 Final payment */
.final-payment-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:13px}
.payment-kpi{background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px;display:flex;flex-direction:column;gap:7px}
.payment-kpi span{font-size:9px;color:var(--muted);font-weight:750}.payment-kpi b{font-size:18px}
.payment-kpi.due{background:#fff7ed;border-color:#fed7aa}.payment-kpi.due b{color:#9a3412}
.payment-kpi.balance{background:#fef2f2;border-color:#fecaca}.payment-kpi.balance b{color:#991b1b}
.payment-kpi.paid{background:#f0fdf4;border-color:#bbf7d0}.payment-kpi.paid b{color:#166534}
.final-payment-hint{font-size:10px;line-height:1.5;color:#57534e;background:#fafaf9;border:1px solid #e7e5e4;border-radius:10px;padding:10px 12px;margin-top:10px}
@media(max-width:900px){.final-payment-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.final-payment-kpis{grid-template-columns:1fr}}

/* v3.11 Authentication and administration */
.auth-screen{min-height:100vh;background:#f3f2ef;display:grid;place-items:center;padding:24px}
.auth-shell{width:min(440px,100%);display:flex;flex-direction:column;gap:14px}
.auth-brand{display:flex;align-items:center;justify-content:center;gap:10px;color:#171717}
.auth-logo{width:46px;height:46px;border-radius:12px;background:#171717;color:#fff;display:grid;place-items:center;font-size:14px;font-weight:900;letter-spacing:.08em}
.auth-brand>div:last-child{display:flex;flex-direction:column}.auth-brand b{font-size:17px}.auth-brand span{font-size:9px;color:#777}
.auth-card{background:#fff;border:1px solid #dfddda;border-radius:18px;padding:24px;box-shadow:0 16px 50px rgba(0,0,0,.08)}
.auth-eyebrow{font-size:9px;font-weight:850;letter-spacing:.13em;color:var(--accent);margin-bottom:8px}
.auth-card h1{font-size:23px;margin:0 0 7px}.auth-sub{font-size:11px;line-height:1.5;color:#71717a;margin:0 0 18px}
.auth-form{display:flex;flex-direction:column;gap:11px}.auth-form label{display:flex;flex-direction:column;gap:5px}.auth-form label span{font-size:10px;font-weight:750;color:#444}
.auth-form input{border:1px solid #d9d5d2;border-radius:9px;padding:10px 11px;font-size:12px;outline:none}.auth-form input:focus{border-color:#bb8090;box-shadow:0 0 0 3px rgba(155,23,55,.08)}
.auth-submit{margin-top:5px;min-height:40px}.auth-error{background:#fff1f2;border:1px solid #fecdd3;color:#9f1239;border-radius:9px;padding:9px 10px;font-size:10px;line-height:1.4}
.auth-foot{text-align:center;font-size:9px;color:#999}
.topbar-right{display:flex;align-items:center;gap:14px}.user-badge{display:flex;align-items:center;gap:8px;border-left:1px solid var(--line);padding-left:12px}
.user-avatar,.mini-avatar{border-radius:50%;background:#f1e5e8;color:var(--accent);display:grid;place-items:center;font-weight:850;flex:0 0 auto}
.user-avatar{width:31px;height:31px;font-size:11px}.mini-avatar{width:32px;height:32px;font-size:10px}
.user-badge-text{display:flex;flex-direction:column;min-width:75px}.user-badge-text b{font-size:10px;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-badge-text span{font-size:8px;color:var(--muted)}
.small-btn{padding:6px 8px!important;font-size:9px!important}
.admin-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}
.admin-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}
.admin-stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px}.admin-stat span{display:block;font-size:9px;color:var(--muted);font-weight:750}.admin-stat b{display:block;font-size:22px;margin-top:6px}
.admin-table-card{background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden}.admin-table-head{padding:15px;border-bottom:1px solid var(--line)}.admin-table-head h3{margin:0;font-size:15px}.admin-table-head p{margin:4px 0 0;font-size:9px;color:var(--muted)}
.users-table{min-width:850px}.user-cell{display:flex;align-items:center;gap:8px}.user-cell>div:last-child{display:flex;align-items:center;gap:6px}.self-label{font-size:8px;color:var(--accent);background:#f7eaee;border-radius:999px;padding:2px 5px}
.role-badge{display:inline-flex;background:#f4f4f2;border-radius:999px;padding:4px 7px;font-size:9px;font-weight:750}.admin-role{background:#f7eaee;color:var(--accent)}
.user-actions{white-space:nowrap}.user-actions button+button{margin-left:4px}
.user-form-top{margin-bottom:14px}.switch-field{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:9px!important;border:1px solid #e8e5e2;border-radius:10px;padding:10px;background:#fbfbfa}.switch-field input{margin-top:2px}.switch-field span{display:flex;flex-direction:column;gap:2px}.switch-field b{font-size:10px}.switch-field small{font-size:8px;color:var(--muted)}
.admin-rights-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.rights-panel{border:1px solid var(--line);border-radius:12px;background:#fafaf9;overflow:hidden}.rights-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:12px;border-bottom:1px solid var(--line)}.rights-head h4{margin:0;font-size:12px}.rights-head p{font-size:8px;color:var(--muted);margin:3px 0 0}
.rights-group{padding:10px 12px;border-bottom:1px solid #eceae8}.rights-group:last-child{border-bottom:0}.rights-group-title{font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:#8a8682;font-weight:850;margin-bottom:7px}
.right-check,.stage-right-check{display:flex;align-items:center;gap:7px;padding:6px 3px;font-size:9px}.right-check input,.stage-right-check input{accent-color:var(--accent)}
.stage-rights-list{max-height:390px;overflow:auto;padding:8px 12px}.stage-right-check{border-bottom:1px solid #eceae8}.stage-right-check:last-child{border-bottom:0}.stage-num{width:20px;height:20px;border-radius:6px;background:#eeeae7;display:grid;place-items:center;font-size:8px;font-weight:800;color:#777}
.access-denied{border:1px solid #fed7aa;background:#fff7ed;border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:4px;color:#9a3412}.access-denied span{font-size:10px}
.read-only-note{margin-top:10px;background:#f4f4f2;border:1px solid #e4e4e0;border-radius:9px;padding:9px 10px;font-size:9px;color:#71717a}
@media(max-width:1000px){.admin-rights-grid{grid-template-columns:1fr}.topbar-right{gap:7px}.project-meta{display:none}}
@media(max-width:700px){.admin-head{align-items:flex-start;flex-direction:column}.admin-summary{grid-template-columns:1fr}.user-badge-text{display:none}.auth-card{padding:19px}}

/* v3.12 Self-service password change */
.password-rules{margin-top:10px;background:#f7f7f5;border:1px solid #e5e3df;border-radius:9px;padding:9px 10px;font-size:9px;color:#71717a;line-height:1.45}
@media(max-width:850px){
  #changePasswordBtn{font-size:0!important}
  #changePasswordBtn:after{content:"Пароль";font-size:9px}
}

/* v3.13 data visibility scopes */
.scope-mini{font-size:8px;color:var(--muted);margin-top:5px;line-height:1.4}
.scope-panel{border:1px solid #ddd9d6;border-radius:13px;background:#f8f7f5;margin:0 0 13px;overflow:hidden}
.scope-panel-head{padding:12px 13px;border-bottom:1px solid #e4e1de}
.scope-panel-head h4{margin:0;font-size:12px}.scope-panel-head p{margin:3px 0 0;font-size:9px;color:var(--muted);line-height:1.4}
.scope-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding:12px}
.scope-select-card{background:#fff;border:1px solid #e6e2df;border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:9px}
.scope-select-card>span{display:flex;flex-direction:column;gap:3px}.scope-select-card b{font-size:10px}.scope-select-card small{font-size:8px;line-height:1.35;color:var(--muted)}
.scope-select-card select{border:1px solid #d9d5d2;border-radius:8px;padding:8px;background:#fff;font-size:10px;outline:none}
.scope-select-card select:focus{border-color:#bd8795;box-shadow:0 0 0 3px rgba(155,23,55,.07)}
.scope-explain{border-top:1px solid #e4e1de;padding:9px 12px;font-size:8px;line-height:1.45;color:#6b6865;background:#f3f1ef}
.readonly-value{min-height:36px;border:1px solid #e5e2df;background:#f7f7f5;border-radius:8px;padding:9px 10px;font-size:10px;color:#555;display:flex;align-items:center}
.scope-context-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:8px;font-weight:800;background:#fff3e8;color:#9a4f14;border:1px solid #fed7aa}
@media(max-width:850px){.scope-grid{grid-template-columns:1fr}}

/* v3.16 BI drill-down + unique numbers */
.project-number{font-size:9px;font-weight:850;letter-spacing:.06em;color:var(--accent);margin-bottom:4px}
.project-code-value,.item-number-badge{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-weight:800;letter-spacing:.03em}
.item-number-badge{display:inline-flex;padding:4px 6px;border-radius:7px;background:#f4f1ef;color:#5f3a44;font-size:9px;white-space:nowrap}

.bi-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#171717;color:#fff;border-radius:12px;padding:11px 13px;margin-bottom:12px}
.bi-toolbar>div{display:flex;flex-direction:column;gap:3px}.bi-toolbar b{font-size:11px}.bi-toolbar span{font-size:8px;color:#b7b7ba}.bi-toolbar .ghost{border-color:#4a4a4e;color:#fff;background:#242427}
.bi-toolbar .ghost:hover{background:#323237}

.report-drill{cursor:pointer;position:relative;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.report-kpi.report-drill:hover,.workshop-card.report-drill:hover{transform:translateY(-2px);box-shadow:0 10px 25px rgba(0,0,0,.075);border-color:#d9b9c2}
.report-kpi.report-drill:focus-visible,.workshop-card.report-drill:focus-visible,.crm-report-row.report-drill:focus-visible{outline:2px solid #c78496;outline-offset:2px}
.drill-hint{font-size:8px;color:var(--accent);font-weight:750;margin-top:8px}
.report-kpi.accent .drill-hint{color:#ffdce6}
.workshop-card .drill-hint{text-align:right;margin-top:8px}
.crm-report-row.report-drill{border-radius:7px;padding:5px 6px;margin:-3px -6px;cursor:pointer}
.crm-report-row.report-drill:hover{background:#f7f3f4}

.workshop-stats>button.stage-stat-drill{background:#fff;border:1px solid #eeecea;border-radius:9px;padding:9px;display:grid;grid-template-columns:8px auto;column-gap:6px;align-items:center;text-align:left;cursor:pointer}
.workshop-stats>button.stage-stat-drill:hover{border-color:#d8b8c1;background:#fffafa}
.workshop-stats>button.stage-stat-drill b{font-size:16px}
.workshop-stats>button.stage-stat-drill small{grid-column:1/-1;font-size:9px;color:var(--muted);margin-top:2px;padding-left:14px}

.drill-toolbar{display:flex;align-items:center;gap:10px;margin:0 0 10px}.drill-toolbar .search-wrap{flex:1}.drill-row-count{font-size:9px;color:var(--muted);white-space:nowrap}.drill-row-count b{font-size:13px;color:var(--ink)}
.drill-filter-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.drill-filter{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 9px;font-size:9px;font-weight:700;color:#666}.drill-filter.active{background:var(--accent);border-color:var(--accent);color:#fff}
.drill-table-wrap{max-height:58vh;overflow:auto;border:1px solid var(--line);border-radius:11px}.drill-table{min-width:900px}.drill-table thead th{position:sticky;top:0;z-index:2;background:#f6f5f3}.drill-table tbody tr:hover{background:#fcf8f9}
.drill-link{border:0;background:transparent;color:var(--accent);font-size:10px;font-weight:850;padding:0;text-align:left;cursor:pointer}.drill-link:hover{text-decoration:underline}
.drill-status{display:inline-flex;border-radius:999px;background:#f3f2f0;padding:4px 7px;font-size:8px;font-weight:750;color:#555;white-space:nowrap}
.mini-progress{display:flex;align-items:center;gap:7px;min-width:100px}.mini-progress>div{width:72px;height:6px;background:#eceae8;border-radius:999px;overflow:hidden}.mini-progress>div span{display:block;height:100%;background:var(--accent);border-radius:999px}.mini-progress b{font-size:8px;color:#555;min-width:35px}
.drill-footer{font-size:8px;color:var(--muted);margin-top:8px}

@media(max-width:800px){
  .bi-toolbar{align-items:flex-start;flex-direction:column}.bi-toolbar .ghost{width:100%}
  .drill-toolbar{align-items:stretch;flex-direction:column}.drill-row-count{text-align:right}
}

/* v3.17 draggable CRM pipeline */
.stage-drop-zone{min-height:120px;height:100%}
.drag-strip{min-height:19px;display:flex;align-items:center;gap:5px;margin:-4px -2px 5px;color:#9a9692;font-size:8px;font-weight:700}
.drag-handle{display:inline-grid;place-items:center;width:22px;height:18px;border-radius:6px;background:#f0eeec;color:#6f6966;font-size:15px;cursor:grab;line-height:1}
.draggable-project{cursor:grab;user-select:none}
.draggable-project:active,.drag-handle:active{cursor:grabbing}
.draggable-project:hover .drag-strip{color:var(--accent)}
.draggable-project:hover .drag-handle{background:#f6e8ec;color:var(--accent)}
.project-card.is-dragging{opacity:.42;transform:scale(.985);box-shadow:none}
.stage-column.drop-allowed{border:2px dashed #9b1737;background:#fff8fa;box-shadow:inset 0 0 0 2px rgba(155,23,55,.035)}
.stage-column.drop-allowed .stage-col-head{color:#9b1737}
.stage-column.drop-allowed .stage-col-head:after{content:"Отпустите проект здесь";display:block;font-size:8px;font-weight:700;color:#9b1737;margin-top:2px}
.stage-column.drop-hover{background:#fceff3;border-color:#9b1737;box-shadow:0 10px 30px rgba(155,23,55,.12),inset 0 0 0 1px #9b1737}
.stage-column.drop-blocked{opacity:.52}
.pipeline-dragging .stage-column{transition:opacity .15s ease,background .15s ease,border-color .15s ease,box-shadow .15s ease}
.project-card.drop-saving{opacity:.55;pointer-events:none}
.stage-empty{pointer-events:none}
@media(max-width:700px){
  .drag-strip span:last-child{display:none}
}

/* v3.18 backward movement in pipeline */
.stage-column.drop-backward{
  border-color:#b7791f;
  background:#fffaf0;
}
.stage-column.drop-backward .stage-col-head{
  color:#92400e;
}
.stage-column.drop-backward .stage-col-head:after{
  content:"Вернуть проект сюда";
  display:block;
  font-size:8px;
  font-weight:750;
  color:#92400e;
  margin-top:2px;
}
.stage-column.drop-forward{
  border-color:#9b1737;
  background:#fff8fa;
}
.stage-column.drop-forward .stage-col-head:after{
  content:"Следующий этап";
  display:block;
  font-size:8px;
  font-weight:750;
  color:#9b1737;
  margin-top:2px;
}
.stage-column.drop-backward.drop-hover{
  background:#fff2d8;
  border-color:#b7791f;
  box-shadow:0 10px 30px rgba(183,121,31,.13),inset 0 0 0 1px #b7791f;
}

/* v3.19 project closure */
.danger-outline{border:1px solid #dc7b7b;background:#fff;color:#991b1b;border-radius:9px;padding:8px 11px;font-size:10px;font-weight:750}
.danger-outline:hover{background:#fff1f2;border-color:#b91c1c}
.danger-solid{border:1px solid #991b1b;background:#991b1b;color:#fff;border-radius:9px;padding:9px 12px;font-size:10px;font-weight:800}
.danger-solid:hover{background:#7f1d1d}.danger-solid:disabled{opacity:.55}
.close-warning{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:10px;padding:10px 12px;font-size:10px;line-height:1.5;margin-bottom:12px}
.close-project-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
.close-project-meta>div{border:1px solid var(--line);background:#fafaf9;border-radius:9px;padding:9px;display:flex;flex-direction:column;gap:4px}
.close-project-meta span,.closure-details span{font-size:8px;color:var(--muted);font-weight:750;text-transform:uppercase;letter-spacing:.04em}
.close-project-meta b{font-size:10px}
.closure-details{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0 0 14px}
.closure-details>div{border:1px solid #e5e7eb;background:#fff;border-radius:10px;padding:11px;display:flex;flex-direction:column;gap:5px}
.closure-details b{font-size:10px}.closure-comment{grid-column:1/-1}.closure-comment p{font-size:10px;line-height:1.45;margin:0;color:#444}
@media(max-width:900px){.closure-details{grid-template-columns:repeat(2,1fr)}.close-project-meta{grid-template-columns:1fr}}
@media(max-width:560px){.closure-details{grid-template-columns:1fr}.workspace-actions{flex-wrap:wrap}}

/* v4.0 operating system */
.global-search-wrap{display:flex;align-items:center;gap:6px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:0 9px;min-width:270px;height:34px}
.global-search-wrap span{color:#999}.global-search-wrap input{border:0;outline:0;width:100%;font-size:10px;background:transparent}

.home-head,.clients-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.home-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.home-kpi{border:1px solid var(--line);background:#fff;border-radius:12px;padding:13px;text-align:left;display:flex;flex-direction:column;gap:4px;cursor:pointer}
.home-kpi span{font-size:9px;color:var(--muted);font-weight:750}.home-kpi b{font-size:21px}.home-kpi small{font-size:8px;color:#8b8784}.home-kpi:hover{border-color:#d7b8c1;box-shadow:0 7px 20px rgba(0,0,0,.05)}
.home-kpi.danger{border-color:#fecaca;background:#fff7f7}.home-kpi.danger b{color:#b91c1c}.home-kpi.money b{font-size:17px}
.home-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.home-panel{border:1px solid var(--line);background:#fff;border-radius:13px;overflow:hidden}.home-panel-head{padding:12px 13px;border-bottom:1px solid var(--line)}.home-panel-head h3{margin:0;font-size:12px}.home-panel-head p{margin:3px 0 0;font-size:8px;color:var(--muted)}
.home-list{max-height:330px;overflow:auto}.home-list-row{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid #efedeb;cursor:pointer}.home-list-row:last-child{border-bottom:0}.home-list-row:hover{background:#faf8f7}.home-list-row.overdue{background:#fff8f8}.home-list-main{min-width:0}.home-list-main>div{display:flex;align-items:center;gap:6px}.home-list-main b{font-size:10px}.home-list-main small,.home-list-side small{display:block;font-size:8px;color:var(--muted);margin-top:3px}.home-list-side{text-align:right;white-space:nowrap}.home-list-side b{font-size:9px}.home-list-row.overdue .home-list-side b{color:#b91c1c}
.priority-dot{width:7px;height:7px;border-radius:50%;background:#bbb;display:inline-block}.priority-dot.критический{background:#b91c1c}.priority-dot.высокий{background:#d97706}.priority-dot.обычный{background:#7c8aa0}

.search-results-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.search-results-grid h4{font-size:10px;margin:0 0 7px}.search-result{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:3px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px;margin-bottom:6px;text-align:left;cursor:pointer}.search-result:hover{border-color:#d7b8c1;background:#fffafb}.search-result-code{font-family:monospace;font-size:8px;font-weight:850;color:var(--accent)}.search-result b{font-size:10px}.search-result small{font-size:8px;color:var(--muted)}

.client-summary{display:flex;align-items:baseline;gap:7px;margin-bottom:10px}.client-summary b{font-size:20px}.client-summary span{font-size:9px;color:var(--muted)}
.client-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.client-card{border:1px solid var(--line);background:#fff;border-radius:12px;padding:12px;text-align:left;cursor:pointer}.client-card:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(0,0,0,.06);border-color:#d7b8c1}.client-card-top{display:flex;gap:9px;align-items:center}.client-avatar{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;background:#f1e5e8;color:var(--accent);font-weight:850}.client-card h3{margin:0;font-size:11px}.client-card p{margin:3px 0 0;font-size:8px;color:var(--muted)}.client-metrics{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:11px}.client-metrics div{background:#f8f7f5;border-radius:8px;padding:7px}.client-metrics span{display:block;font-size:7px;color:var(--muted)}.client-metrics b{font-size:9px;display:block;margin-top:2px}.client-last{font-size:8px;color:var(--muted);border-top:1px solid #efedeb;margin-top:9px;padding-top:8px}.client-detail-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.client-detail-kpis>div{border:1px solid var(--line);border-radius:9px;padding:9px}.client-detail-kpis span{font-size:8px;color:var(--muted);display:block}.client-detail-kpis b{font-size:11px;display:block;margin-top:4px}

.project-tools-bar{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 10px;padding:8px;border:1px solid var(--line);background:#f8f7f5;border-radius:10px}.project-tool-btn{border:1px solid #dedad7;background:#fff;border-radius:8px;padding:7px 9px;font-size:9px;font-weight:750;color:#555;cursor:pointer}.project-tool-btn:hover{border-color:#c89aa7;color:var(--accent)}.project-tool-btn span{display:inline-grid;place-items:center;min-width:16px;height:16px;border-radius:999px;background:#f4e5e9;color:var(--accent);font-size:8px;margin-left:4px}

.modal-toolbar{display:flex;justify-content:flex-end;margin-bottom:10px}.task-list,.issue-list{display:flex;flex-direction:column;gap:7px}.task-row,.issue-row{display:flex;align-items:center;gap:9px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px}.task-row.overdue,.issue-row.overdue{border-color:#fecaca;background:#fff8f8}.task-row.done{opacity:.62}.task-check input{width:16px;height:16px;accent-color:var(--accent)}.task-main,.issue-main{flex:1;min-width:0}.task-main>div,.issue-main>div{display:flex;align-items:center;gap:6px}.task-main b,.issue-main b{font-size:10px}.task-main small,.issue-main small{font-size:8px;color:var(--muted);display:block;margin-top:3px}.task-actions{white-space:nowrap}
.priority-pill,.severity-pill{display:inline-flex;border-radius:999px;padding:3px 6px;font-size:7px;font-weight:800;background:#f2f0ee;color:#666}.priority-pill.критический{background:#fee2e2;color:#991b1b}.priority-pill.высокий{background:#ffedd5;color:#9a3412}.severity-pill{background:#fff2df;color:#92400e}

.finance-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}.finance-kpis>div{border:1px solid var(--line);border-radius:10px;padding:11px}.finance-kpis span{font-size:8px;color:var(--muted);display:block}.finance-kpis b{font-size:15px;display:block;margin-top:4px}.finance-kpis .positive b{color:#047857}.finance-kpis .danger b{color:#b91c1c}
.finance-columns{display:grid;grid-template-columns:.8fr 1.5fr;gap:12px}.finance-columns section{border:1px solid var(--line);border-radius:11px;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:10px 11px;border-bottom:1px solid var(--line)}.panel-head h4{margin:0;font-size:10px}.finance-line{display:grid;grid-template-columns:1fr auto;gap:3px 8px;padding:9px 11px;border-bottom:1px solid #efedeb}.finance-line span{font-size:9px}.finance-line b{font-size:10px}.finance-line small{grid-column:1/-1;font-size:8px;color:var(--muted)}.overdue-row{background:#fff8f8}

.history-list{position:relative}.history-row{display:grid;grid-template-columns:14px 1fr;gap:9px;padding:0 0 13px}.history-dot{width:9px;height:9px;border-radius:50%;background:var(--accent);margin-top:3px;box-shadow:0 0 0 3px #f4e5e9}.history-row.system .history-dot{background:#9ca3af;box-shadow:0 0 0 3px #f1f1f1}.history-row b{font-size:10px}.history-row p{font-size:9px;margin:3px 0;color:#555}.history-row small{font-size:8px;color:var(--muted)}

.conversion-table{border:1px solid var(--line);border-radius:10px;overflow:hidden}.conversion-row{display:grid;grid-template-columns:2fr .7fr .8fr .8fr;gap:8px;align-items:center;padding:8px 10px;border-bottom:1px solid #efedeb}.conversion-row:last-child{border-bottom:0}.conversion-stage{display:flex;align-items:center;gap:7px}.conversion-stage span{width:20px;height:20px;border-radius:6px;background:#f3eeee;display:grid;place-items:center;font-size:8px;color:var(--accent);font-weight:850}.conversion-stage b{font-size:9px}.conversion-reached,.conversion-rate,.conversion-days{font-size:10px;font-weight:850}.conversion-reached small,.conversion-rate small,.conversion-days small{display:block;font-size:7px;color:var(--muted);font-weight:500;margin-top:2px}.loss-list{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.loss-row{border:1px solid var(--line);border-radius:9px;padding:9px;display:flex;align-items:center;justify-content:space-between;gap:8px}.loss-row b{font-size:9px}.loss-row small{display:block;font-size:8px;color:var(--muted);margin-top:2px}.loss-row strong{font-size:10px}

@media(max-width:1100px){.home-kpis{grid-template-columns:1fr 1fr}.client-grid{grid-template-columns:1fr 1fr}.global-search-wrap{min-width:180px}.finance-columns{grid-template-columns:1fr}}
@media(max-width:760px){.home-grid,.client-grid{grid-template-columns:1fr}.home-kpis{grid-template-columns:1fr 1fr}.global-search-wrap{display:none}.client-detail-kpis{grid-template-columns:1fr 1fr}.search-results-grid{grid-template-columns:1fr}.finance-kpis{grid-template-columns:1fr}.conversion-row{grid-template-columns:1.5fr .7fr .8fr}.conversion-days{display:none}.loss-list{grid-template-columns:1fr}}

.project-tool-btn.tool-overdue{border-color:#fca5a5;background:#fff1f2;color:#b91c1c}

/* v4.1 save + choose stage */
.save-move-success{display:flex;gap:9px;align-items:center;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:11px;padding:10px 12px;margin-bottom:12px}
.save-move-success>span{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#16a34a;color:#fff;font-weight:900}
.save-move-success b{display:block;font-size:10px;color:#166534}.save-move-success small{display:block;font-size:8px;color:#578064;margin-top:2px}
.stage-move-layout{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.stage-move-layout>section{border:1px solid var(--line);border-radius:12px;background:#faf9f7;padding:10px}
.stage-move-section-head{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}.stage-move-section-head b{font-size:10px}.stage-move-section-head span{font-size:8px;color:var(--muted)}
.stage-move-options{display:flex;flex-direction:column;gap:6px;max-height:390px;overflow:auto}
.stage-move-option{display:grid;grid-template-columns:72px 1fr;grid-template-rows:auto auto;column-gap:8px;align-items:center;border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px;text-align:left;cursor:pointer}
.stage-move-option:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.05)}
.stage-move-option .move-direction{grid-row:1/3;font-size:7px;font-weight:850;letter-spacing:.04em}
.stage-move-option b{font-size:10px}.stage-move-option small{font-size:8px;color:var(--muted);margin-top:2px}
.stage-move-option.backward{border-left:3px solid #b7791f}.stage-move-option.backward .move-direction{color:#92400e}
.stage-move-option.forward{border-left:3px solid var(--accent)}.stage-move-option.forward .move-direction{color:var(--accent)}
.stage-move-option.close-target{border-color:#fecaca;border-left-color:#b91c1c;background:#fff8f8}.stage-move-option.close-target .move-direction{color:#b91c1c}
.stage-move-option:disabled{opacity:.5;cursor:wait}
.stage-move-empty{font-size:9px;color:var(--muted);padding:12px;border:1px dashed #ddd;border-radius:8px;background:#fff}
@media(max-width:760px){.stage-move-layout{grid-template-columns:1fr}}

/* v4.3 qualification required-field highlighting */
.field.qual-missing{position:relative;border-radius:10px;background:#fff6f6;padding:7px;border:1px solid #fecaca;animation:missingFieldPulse .26s ease-out}
.field.qual-missing>label{color:#b91c1c;font-weight:850}
.field.qual-missing input:not([type="checkbox"]),
.field.qual-missing select,
.field.qual-missing textarea{border-color:#dc2626!important;background:#fff!important;box-shadow:0 0 0 3px rgba(220,38,38,.08)!important}
.field.qual-missing .chips{border:1px solid #dc2626;border-radius:9px;padding:7px;background:#fff}
.field.qual-missing .chip{border-color:#f3b4b4}
.field-error-text{font-size:8px;font-weight:800;color:#b91c1c;margin-top:5px;display:flex;align-items:center;gap:4px}
.field-error-text:before{content:"!";display:inline-grid;place-items:center;width:14px;height:14px;border-radius:50%;background:#dc2626;color:#fff;font-size:8px}
.form-section.has-missing{border-color:#fecaca;box-shadow:0 0 0 1px rgba(220,38,38,.04)}
.form-section.has-missing .form-section-head{background:#fff8f8}
.section-missing-count{margin-left:auto;align-self:center;display:inline-flex;border-radius:999px;padding:4px 8px;background:#fee2e2;color:#991b1b;font-size:8px;font-weight:850;white-space:nowrap}
@keyframes missingFieldPulse{0%{transform:translateX(-3px)}50%{transform:translateX(3px)}100%{transform:translateX(0)}}

/* v4.4 dynamic product catalog */
.custom-product-label{font-size:7px;color:#7c3aed;margin-top:3px;font-weight:750}
.pricing-add-hint{margin-top:9px;border:1px solid #e5e7eb;background:#fafafa;border-radius:9px;padding:9px 10px;font-size:9px;color:#555;line-height:1.45}
.pricing-table td:last-child,.pricing-table th:last-child{width:84px;text-align:right}

/* v4.5 manager price */
.manager-price-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.manager-price-grid label{display:flex;flex-direction:column;gap:5px}
.manager-price-grid label>span,.manager-price-grid>div>span{font-size:8px;color:var(--muted);font-weight:750}
.manager-price-grid input{width:100%}
.price-hint b{color:#4b5563}
@media(max-width:700px){.manager-price-grid{grid-template-columns:1fr}}

/* v4.6 project passport */
.project-tool-btn.passport-tool-btn{border-color:#d8b7c1;background:#fff8fa;color:#7d1735}
.project-tool-btn.passport-tool-btn:hover{background:#f9e9ee;border-color:#b98091}

.status.skip{background:#f3f4f6;color:#6b7280;border:1px dashed #c7cbd1}

/* v5.0 material approval PDF */
.material-sheet-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 8px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:#fff}
.material-sheet-toolbar>div{display:flex;flex-direction:column;gap:2px}.material-sheet-toolbar b{font-size:10px}.material-sheet-toolbar span{font-size:8px;color:var(--muted)}
.material-pdf-download{text-decoration:none;white-space:nowrap}
.material-sheet-note{font-size:8px;line-height:1.5;color:var(--muted);background:#faf8f7;border:1px solid var(--line);border-radius:9px;padding:8px 10px;margin-bottom:9px}
@media(max-width:760px){.material-sheet-toolbar{align-items:stretch;flex-direction:column}.material-pdf-download{text-align:center}}

/* v5.2 premium material approval table */
.material-grid-wrap{
  overflow:auto;
  border:1px solid #e1dbd8;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 24px rgba(55,35,31,.055);
}
.material-grid{
  min-width:1540px;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
.material-grid th,
.material-grid td{
  border:0;
  vertical-align:top;
}
.material-grid thead th{
  position:sticky;
  top:0;
  z-index:3;
  padding:11px 10px;
  background:#6f102b;
  color:#fff;
  font-size:8px;
  line-height:1.25;
  font-weight:850;
  letter-spacing:.01em;
  text-align:left;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.12);
}
.material-grid thead th:first-child{border-radius:13px 0 0 0}
.material-grid thead th:last-child{border-radius:0 13px 0 0}
.material-grid tbody td{
  padding:12px 10px;
  font-size:9px;
  line-height:1.5;
  color:#2f2927;
  border-bottom:1px solid #ebe6e3;
  background:#fff;
}
.material-grid tbody tr:nth-child(even) td{background:#fbf9f8}
.material-grid tbody tr:last-child td{border-bottom:0}
.material-grid tbody tr:hover td{background:#f8f3f2}
.material-grid th:nth-child(3),
.material-grid td:nth-child(3),
.material-grid th:nth-child(6),
.material-grid td:nth-child(6),
.material-grid th:nth-child(9),
.material-grid td:nth-child(9){
  border-right:1px solid #ded7d4;
}
.material-grid td:nth-child(1){
  position:sticky;
  left:0;
  z-index:2;
  min-width:92px;
  box-shadow:1px 0 0 #e6dfdc;
}
.material-grid thead th:nth-child(1){
  position:sticky;
  left:0;
  z-index:5;
  min-width:92px;
}
.material-grid tbody tr:nth-child(odd) td:nth-child(1){background:#fff}
.material-grid tbody tr:nth-child(even) td:nth-child(1){background:#fbf9f8}
.material-grid tbody tr:hover td:nth-child(1){background:#f8f3f2}
.material-grid td:nth-child(2){font-weight:700;color:#625a56}
.material-grid td:nth-child(3){font-weight:850;color:#211d1b}
.material-grid .item-number-badge{
  display:inline-flex;
  align-items:center;
  border:1px solid #d9c6cd;
  background:#f8f0f3;
  color:#6f102b;
  border-radius:999px;
  padding:5px 8px;
  font-size:8px;
  font-weight:900;
  letter-spacing:.025em;
}
.material-grid .status{
  white-space:nowrap;
  padding:5px 8px;
  font-size:8px;
  border-radius:999px;
}
.material-grid .edit-material{
  border-radius:8px;
  padding:6px 9px;
  background:#fff;
  border:1px solid #ddd5d1;
  white-space:nowrap;
}
.material-grid .edit-material:hover{
  border-color:#6f102b;
  color:#6f102b;
  background:#fbf6f7;
}
.material-sheet-toolbar{
  border:1px solid #e1dbd8;
  border-radius:14px;
  box-shadow:0 6px 20px rgba(55,35,31,.04);
  padding:13px 14px;
}
.material-sheet-toolbar b{font-size:11px;color:#261f1d}
.material-sheet-toolbar span{font-size:8.5px}
.material-sheet-note{
  border:0;
  border-left:3px solid #8e1738;
  border-radius:0 10px 10px 0;
  background:#faf7f7;
  padding:10px 12px;
}

/* v5.3 adaptive and readable material approval workspace */
.material-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
  margin:10px 0 12px;
}
.material-summary-card{
  position:relative;
  overflow:hidden;
  min-height:72px;
  padding:13px 14px;
  border:1px solid #e5dfdc;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(46,31,27,.035);
}
.material-summary-card:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:#b9b0ac;
}
.material-summary-card span{
  display:block;
  color:#7b736f;
  font-size:8px;
  font-weight:750;
  margin-bottom:8px;
}
.material-summary-card b{
  display:block;
  color:#251f1d;
  font-size:21px;
  line-height:1;
}
.material-summary-card.agreed:before{background:#198754}
.material-summary-card.pending:before{background:#c28521}
.material-summary-card.replace:before{background:#b13a3a}
.material-summary-card.total:before{background:#71142f}

.material-controlbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px;
  margin-bottom:9px;
  border:1px solid #e4dedb;
  border-radius:14px;
  background:#fff;
  box-shadow:0 4px 16px rgba(46,31,27,.025);
}
.material-filter-group{
  min-width:0;
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
}
.material-search-wrap{
  position:relative;
  flex:1;
  min-width:220px;
  max-width:520px;
}
.material-search-wrap input{
  width:100%;
  height:36px;
  padding:0 12px 0 34px;
  border:1px solid #ddd6d2;
  border-radius:10px;
  background:#faf9f8;
  font-size:9px;
}
.material-search-wrap input:focus{
  outline:none;
  border-color:#b98b98;
  background:#fff;
  box-shadow:0 0 0 3px rgba(113,20,47,.07);
}
.material-search-icon{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-52%);
  color:#8b817c;
  font-size:15px;
  pointer-events:none;
}
#materialStatusFilter{
  height:36px;
  min-width:158px;
  border:1px solid #ddd6d2;
  border-radius:10px;
  background:#faf9f8;
  padding:0 30px 0 10px;
  font-size:9px;
}
.material-visible-count{
  white-space:nowrap;
  color:#817873;
  font-size:8px;
  font-weight:700;
}
.material-pdf-download{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  white-space:nowrap;
  text-decoration:none;
}
.material-attention{
  margin:0 0 9px;
  padding:8px 11px;
  border-left:3px solid #c28521;
  border-radius:0 9px 9px 0;
  background:#fff9ef;
  color:#73531e;
  font-size:8px;
  line-height:1.45;
}
.material-attention b{color:#5e4215}

/* Wide desktop table */
.material-desktop-view{display:block}
.material-card-view{display:none}
.material-table-shell{
  position:relative;
  width:100%;
  overflow:auto;
  border:1px solid #dfd8d4;
  border-radius:15px;
  background:#fff;
  box-shadow:0 7px 24px rgba(51,34,29,.045);
}
.material-grid{
  width:100%;
  min-width:1420px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.material-grid th,
.material-grid td{
  border:0!important;
  text-align:left;
  vertical-align:top;
}
.material-grid .material-group-head th{
  position:sticky;
  top:0;
  z-index:8;
  height:29px;
  padding:8px 10px 7px;
  background:#5f1028;
  color:rgba(255,255,255,.86);
  border-right:1px solid rgba(255,255,255,.12)!important;
  font-size:7px;
  font-weight:850;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.material-grid thead tr:nth-child(2) th{
  position:sticky;
  top:29px;
  z-index:7;
  padding:9px 9px;
  background:#f4f0ef;
  color:#4e4541;
  border-bottom:1px solid #d9d1cd!important;
  font-size:7.5px;
  font-weight:850;
  line-height:1.25;
}
.material-grid thead tr:nth-child(2) th:nth-child(3),
.material-grid thead tr:nth-child(2) th:nth-child(11){
  border-right:1px solid #cfc5c1!important;
}
.material-grid tbody td{
  padding:11px 9px;
  background:#fff;
  color:#3f3835;
  border-bottom:1px solid #eee9e6!important;
  font-size:8.5px;
  line-height:1.48;
  overflow-wrap:anywhere;
}
.material-grid tbody tr:nth-child(even) td{background:#fbfaf9}
.material-grid tbody tr:hover td{background:#f9f4f5}
.material-grid tbody tr:last-child td{border-bottom:0!important}
.material-grid .mat-id{width:96px}
.material-grid .mat-room{width:95px;color:#756b66;font-weight:720}
.material-grid .mat-product{width:112px;color:#251f1d}
.material-grid .mat-product b{font-size:9px}
.material-grid th:nth-child(1),.material-grid td:nth-child(1){width:96px}
.material-grid th:nth-child(2),.material-grid td:nth-child(2){width:95px}
.material-grid th:nth-child(3),.material-grid td:nth-child(3){width:112px}
.material-grid th:nth-child(4),.material-grid td:nth-child(4){width:125px}
.material-grid th:nth-child(5),.material-grid td:nth-child(5){width:125px}
.material-grid th:nth-child(6),.material-grid td:nth-child(6){width:150px}
.material-grid th:nth-child(7),.material-grid td:nth-child(7){width:135px}
.material-grid th:nth-child(8),.material-grid td:nth-child(8){width:125px}
.material-grid th:nth-child(9),.material-grid td:nth-child(9){width:82px}
.material-grid th:nth-child(10),.material-grid td:nth-child(10){width:105px}
.material-grid th:nth-child(11),.material-grid td:nth-child(11){width:115px}
.material-grid th:nth-child(12),.material-grid td:nth-child(12){width:116px}
.material-grid th:nth-child(13),.material-grid td:nth-child(13){width:82px}
.material-grid tbody td:nth-child(3),
.material-grid tbody td:nth-child(11){
  border-right:1px solid #ded6d2!important;
}
.material-grid thead tr:nth-child(2) th:first-child,
.material-grid tbody td:first-child{
  position:sticky;
  left:0;
}
.material-grid thead tr:nth-child(2) th:first-child{
  z-index:10;
  background:#eee8e6;
}
.material-grid tbody td:first-child{
  z-index:4;
  box-shadow:1px 0 0 #e5ddda;
}
.material-grid tbody tr:nth-child(odd) td:first-child{background:#fff}
.material-grid tbody tr:nth-child(even) td:first-child{background:#fbfaf9}
.material-grid tbody tr:hover td:first-child{background:#f9f4f5}
.material-grid thead tr:nth-child(2) th:last-child,
.material-grid tbody td:last-child{
  position:sticky;
  right:0;
}
.material-grid thead tr:nth-child(2) th:last-child{
  z-index:10;
  background:#eee8e6;
}
.material-grid tbody td:last-child{
  z-index:4;
  box-shadow:-1px 0 0 #e6dfdc;
}
.material-grid tbody tr:nth-child(odd) td:last-child{background:#fff}
.material-grid tbody tr:nth-child(even) td:last-child{background:#fbfaf9}
.material-grid tbody tr:hover td:last-child{background:#f9f4f5}
.material-grid .item-number-badge{
  display:inline-flex;
  padding:5px 7px;
  border:1px solid #dbcbd0;
  border-radius:999px;
  background:#faf2f5;
  color:#71142f;
  font-size:7.5px;
  font-weight:900;
  letter-spacing:.02em;
  white-space:nowrap;
}
.mat-status-cell{white-space:nowrap}
.mat-action{text-align:right!important}
.mat-action .ghost{
  padding:6px 8px;
  border-radius:8px;
  font-size:8px;
}

/* Consistent agreement badges */
.material-status{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  border-radius:999px;
  font-size:7.5px;
  line-height:1;
  font-weight:850;
  white-space:nowrap;
}
.material-status:before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
  opacity:.8;
}
.material-status.agreed{background:#edf8f2;color:#187448}
.material-status.pending{background:#fff7e8;color:#9a6715}
.material-status.replace{background:#fff0f0;color:#a53535}
.material-status.not-agreed{background:#f4f2f1;color:#746b66}

/* Adaptive cards used on laptops/tablets/smaller windows */
.material-card-view{gap:10px}
.material-card{
  border:1px solid #e3dcda;
  border-radius:15px;
  background:#fff;
  box-shadow:0 6px 20px rgba(46,31,27,.04);
  overflow:hidden;
}
.material-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 13px;
  border-bottom:1px solid #ebe5e2;
  background:linear-gradient(180deg,#fff,#fcfaf9);
}
.material-card-identity{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.material-card-identity>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.material-card-identity>div>b{
  color:#241f1d;
  font-size:10px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.material-card-identity>div>span{
  color:#827974;
  font-size:8px;
}
.material-card-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
  padding:4px 13px 8px;
}
.material-detail{
  min-width:0;
  padding:10px 12px 10px 0;
  border-bottom:1px solid #f0ecea;
}
.material-detail:nth-child(3n+2),
.material-detail:nth-child(3n+3){padding-left:12px;border-left:1px solid #f0ecea}
.material-detail span{
  display:block;
  margin-bottom:4px;
  color:#8a817d;
  font-size:7px;
  font-weight:750;
}
.material-detail b{
  display:block;
  color:#39322f;
  font-size:8.6px;
  line-height:1.42;
  font-weight:680;
  overflow-wrap:anywhere;
}
.material-detail.wide{grid-column:auto}
.material-card-footer{
  display:flex;
  align-items:flex-end;
  gap:12px;
  justify-content:space-between;
  padding:11px 13px 13px;
  background:#faf8f7;
}
.material-card-meta{
  min-width:0;
  flex:1;
  display:flex;
  gap:18px;
  flex-wrap:wrap;
}
.material-card-meta>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.material-card-meta span{
  color:#8a817d;
  font-size:7px;
  font-weight:750;
}
.material-card-meta b{
  color:#38312e;
  font-size:8px;
  font-weight:750;
}
.material-card-comment{flex-basis:100%}
.material-card-comment b{font-weight:600;line-height:1.4}
.material-card-footer>.primary{
  flex:0 0 auto;
  min-height:32px;
  border-radius:9px;
  font-size:8px;
}

@media(max-width:1499px){
  .material-desktop-view{display:none}
  .material-card-view{display:grid}
  .material-summary-grid{grid-template-columns:repeat(4,minmax(120px,1fr))}
}
@media(max-width:900px){
  .material-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .material-controlbar{align-items:stretch;flex-direction:column}
  .material-filter-group{align-items:stretch;flex-wrap:wrap}
  .material-search-wrap{max-width:none;flex-basis:100%}
  #materialStatusFilter{flex:1;min-width:150px}
  .material-visible-count{display:flex;align-items:center}
  .material-pdf-download{width:100%}
  .material-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .material-detail:nth-child(3n+2),
  .material-detail:nth-child(3n+3){padding-left:0;border-left:0}
  .material-detail:nth-child(even){padding-left:12px;border-left:1px solid #f0ecea}
}
@media(max-width:580px){
  .material-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .material-summary-card{min-height:62px;padding:11px}
  .material-summary-card b{font-size:18px}
  .material-filter-group{display:grid;grid-template-columns:1fr}
  #materialStatusFilter{width:100%}
  .material-visible-count{padding:0 2px}
  .material-card-head{align-items:flex-start;flex-direction:column}
  .material-card-grid{grid-template-columns:1fr;padding:4px 12px 7px}
  .material-detail,
  .material-detail:nth-child(even){
    padding:9px 0;
    border-left:0;
  }
  .material-card-footer{align-items:stretch;flex-direction:column}
  .material-card-meta{gap:10px}
  .material-card-footer>.primary{width:100%}
}

.material-filter-empty{
  margin:10px 0;
  padding:22px 14px;
  border:1px dashed #d9d1cd;
  border-radius:13px;
  background:#fcfbfa;
  text-align:center;
}
.material-filter-empty b{display:block;color:#403835;font-size:10px;margin-bottom:4px}
.material-filter-empty span{color:#867d78;font-size:8px}

/* v5.4 structured technical specification */
.tz-overview{
  display:grid;
  grid-template-columns:minmax(220px,.85fr) minmax(320px,1.4fr);
  gap:10px;
  margin:10px 0 12px;
}
.tz-overview-main,
.tz-overview-hint{
  border:1px solid #e4dedb;
  border-radius:14px;
  background:#fff;
  padding:13px 14px;
  box-shadow:0 5px 18px rgba(46,31,27,.035);
}
.tz-overview-main span,
.tz-overview-main small,
.tz-overview-hint span{
  display:block;
  color:#7d746f;
  font-size:8px;
  line-height:1.45;
}
.tz-overview-main b{
  display:block;
  margin:5px 0 3px;
  font-size:22px;
  line-height:1;
  color:#6f102b;
}
.tz-overview-hint b{
  display:block;
  margin-bottom:5px;
  font-size:9px;
  color:#322b28;
}
.tz-item-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.tz-item-card{
  border:1px solid #e3dcda;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 5px 18px rgba(46,31,27,.035);
}
.tz-item-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:12px 13px 10px;
  border-bottom:1px solid #eee9e6;
  background:linear-gradient(180deg,#fff,#fcfaf9);
}
.tz-item-id{
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}
.tz-item-id>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.tz-item-id b{
  color:#28221f;
  font-size:10px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tz-item-id span:not(.item-number-badge){
  color:#867d78;
  font-size:8px;
}
.tz-progress-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 38px;
  align-items:center;
  gap:9px;
  padding:11px 13px 4px;
}
.tz-progress-row>b{
  text-align:right;
  color:#473e3a;
  font-size:9px;
}
.tz-progress-track{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#eee9e6;
}
.tz-progress-track.large{height:8px}
.tz-progress-track i{
  display:block;
  height:100%;
  border-radius:inherit;
  transition:width .18s ease;
}
.tz-progress-track i.starting{background:#c0b6b2}
.tz-progress-track i.progressing{background:#b37a24}
.tz-progress-track i.complete{background:#268259}
.tz-item-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  padding:5px 13px 10px;
  color:#7e756f;
  font-size:7.5px;
}
.tz-item-meta b{color:#443c38}
.tz-item-meta .tz-missing{color:#985b18}
.tz-item-meta .tz-ready{color:#18744b;font-weight:800}
.tz-item-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 13px 12px;
  background:#faf8f7;
  border-top:1px solid #eee9e6;
}
.tz-item-actions .primary{
  min-height:32px;
  border-radius:9px;
  font-size:8px;
}
.tz-item-actions>span{
  color:#8a817c;
  font-size:7px;
}

.modal.tz-modal-wide{
  width:min(1380px,98vw);
  max-height:96vh;
  padding:16px;
}
.tz-modal-head{
  position:sticky;
  top:-16px;
  z-index:15;
  margin:-16px -16px 12px!important;
  padding:15px 16px 12px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(8px);
  border-bottom:1px solid #e7e1de;
}
.tz-modal-head h3{margin-bottom:3px!important}
.tz-control-panel{
  display:grid;
  grid-template-columns:minmax(0,1.8fr) minmax(240px,.8fr);
  gap:10px;
  margin-bottom:11px;
}
.tz-control-fields{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  padding:10px;
  border:1px solid #e4dedb;
  border-radius:13px;
  background:#faf9f8;
}
.tz-control-fields .field{margin:0}
.tz-live-progress{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  padding:11px 13px;
  border:1px solid #e4dedb;
  border-radius:13px;
  background:#fff;
}
.tz-live-progress>div:first-child{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.tz-live-progress span{
  color:#7e756f;
  font-size:8px;
  font-weight:750;
}
.tz-live-progress b{
  color:#6f102b;
  font-size:16px;
}
.tz-live-progress small{
  color:#817873;
  font-size:7px;
}
.tz-spec-table{
  overflow:hidden;
  border:1px solid #ddd5d1;
  border-radius:14px;
  background:#fff;
}
.tz-spec-header,
.tz-spec-row{
  display:grid;
  grid-template-columns:minmax(280px,1.2fr) 130px minmax(330px,1.35fr) minmax(280px,1fr);
}
.tz-spec-header{
  position:sticky;
  top:64px;
  z-index:10;
  background:#5f1028;
  color:#fff;
}
.tz-spec-header>div{
  padding:9px 10px;
  border-right:1px solid rgba(255,255,255,.12);
  font-size:7.5px;
  line-height:1.25;
  font-weight:850;
  letter-spacing:.035em;
  text-transform:uppercase;
}
.tz-spec-header>div:last-child{border-right:0}
.tz-spec-row{
  min-height:96px;
  border-bottom:1px solid #eee9e6;
  background:#fff;
}
.tz-spec-row:nth-child(odd){background:#fbfaf9}
.tz-spec-row:last-child{border-bottom:0}
.tz-spec-row>div{
  min-width:0;
  padding:9px 10px;
  border-right:1px solid #eee8e5;
}
.tz-spec-row>div:last-child{border-right:0}
.tz-spec-row.not-required{
  background:#f5f3f2;
}
.tz-spec-row.not-required .tz-spec-name{
  opacity:.72;
}
.tz-spec-row.not-required textarea{
  background:#f0edeb!important;
  color:#9b918b!important;
}
.tz-spec-name{
  display:flex;
  align-items:flex-start;
  gap:9px;
}
.tz-spec-index{
  flex:0 0 auto;
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#f7edf1;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.tz-spec-name>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.tz-spec-name b{
  color:#302926;
  font-size:9px;
}
.tz-spec-name small{
  color:#7e756f;
  font-size:7px;
  line-height:1.42;
}
.tz-applicability select{
  width:100%;
  height:34px;
  border:1px solid #ddd5d1;
  border-radius:9px;
  background:#fff;
  padding:0 8px;
  font-size:8px;
}
.tz-requirement textarea,
.tz-source textarea{
  width:100%;
  min-height:76px;
  resize:vertical;
  border:1px solid #ded7d3;
  border-radius:9px;
  background:#fff;
  padding:8px 9px;
  color:#332c29;
  font:inherit;
  font-size:8px;
  line-height:1.45;
}
.tz-requirement textarea:focus,
.tz-source textarea:focus{
  outline:none;
  border-color:#b98b98;
  box-shadow:0 0 0 3px rgba(113,20,47,.06);
}
.tz-general-comment{margin-top:10px}
.tz-files{margin-top:10px}
.sticky-actions{
  position:sticky;
  bottom:-16px;
  z-index:12;
  margin:12px -16px -16px!important;
  padding:10px 16px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(8px);
  border-top:1px solid #e7e1de;
}

@media(max-width:1100px){
  .tz-item-list{grid-template-columns:1fr}
  .tz-control-panel{grid-template-columns:1fr}
  .tz-control-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tz-spec-table{
    overflow:visible;
    border:0;
    background:transparent;
  }
  .tz-spec-header{display:none}
  .tz-spec-row{
    display:grid;
    grid-template-columns:1fr 160px;
    min-height:0;
    margin-bottom:9px;
    overflow:hidden;
    border:1px solid #e1d9d6;
    border-radius:12px;
    box-shadow:0 4px 14px rgba(46,31,27,.03);
  }
  .tz-spec-row>div{border-right:0}
  .tz-spec-name{
    grid-column:1 / 2;
    border-bottom:1px solid #eee8e5;
  }
  .tz-applicability{
    grid-column:2 / 3;
    border-bottom:1px solid #eee8e5;
    background:#faf8f7;
  }
  .tz-requirement,
  .tz-source{
    grid-column:1 / -1;
  }
  .tz-requirement{border-bottom:1px solid #eee8e5}
}
@media(max-width:700px){
  .tz-overview{grid-template-columns:1fr}
  .tz-control-fields{grid-template-columns:1fr}
  .tz-spec-row{grid-template-columns:1fr}
  .tz-spec-name,.tz-applicability,.tz-requirement,.tz-source{grid-column:1!important}
  .tz-applicability{border-top:0}
  .tz-item-head{flex-direction:column}
  .tz-item-actions{align-items:stretch;flex-direction:column}
  .tz-item-actions .primary{width:100%}
}

/* v5.5 — ТЗ: список изделий + читабельная таблица внутри */

/* ---- Список изделий ---- */
.tz-list-summary{
  display:grid;
  grid-template-columns:150px 150px 190px minmax(280px,1fr);
  gap:8px;
  margin:10px 0 12px;
}
.tz-list-summary>div{
  min-width:0;
  padding:11px 12px;
  border:1px solid #e5dfdc;
  border-radius:11px;
  background:#fff;
}
.tz-list-summary span{
  display:block;
  color:#827873;
  font-size:8px;
  line-height:1.35;
}
.tz-list-summary>div>b{
  display:block;
  margin-top:4px;
  color:#2b2421;
  font-size:18px;
  line-height:1;
}
.tz-list-summary-note{
  display:flex!important;
  flex-direction:column;
  justify-content:center;
  background:#faf7f7!important;
  border-left:3px solid #6f102b!important;
}
.tz-list-summary-note b{
  margin:0 0 3px!important;
  color:#6f102b!important;
  font-size:8px!important;
}
.tz-list-summary-note span{font-size:8px;line-height:1.45}

.tz-list-shell{
  overflow:hidden;
  border:1px solid #e0d9d6;
  border-radius:13px;
  background:#fff;
  box-shadow:0 5px 18px rgba(45,31,27,.035);
}
.tz-list-header,
.tz-list-row{
  display:grid;
  grid-template-columns:minmax(220px,1.45fr) 115px minmax(145px,.95fr) minmax(180px,1.15fr) 86px 92px 102px;
  align-items:center;
  gap:0;
}
.tz-list-header{
  min-height:37px;
  padding:0 12px;
  background:#f3efed;
  border-bottom:1px solid #dbd3cf;
  color:#6c625d;
}
.tz-list-header>div{
  padding:0 9px;
  font-size:7px;
  font-weight:850;
  letter-spacing:.035em;
  text-transform:uppercase;
}
.tz-list-body{background:#fff}
.tz-list-row{
  min-height:68px;
  padding:0 12px;
  border-bottom:1px solid #eee9e6;
  transition:background .12s ease;
}
.tz-list-row:last-child{border-bottom:0}
.tz-list-row:nth-child(even){background:#fcfbfa}
.tz-list-row:hover{background:#faf5f6}
.tz-list-row>div{min-width:0;padding:10px 9px}
.tz-list-product{
  display:flex;
  align-items:center;
  gap:10px;
}
.tz-list-product>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.tz-list-product b{
  color:#292321;
  font-size:9.5px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tz-list-product>div>span{
  color:#817873;
  font-size:8px;
}
.tz-list-responsible,
.tz-list-source,
.tz-list-date{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.tz-list-responsible span,
.tz-list-source span,
.tz-list-date span{
  display:none;
  color:#8a817c;
  font-size:7px;
}
.tz-list-responsible b,
.tz-list-source b,
.tz-list-date b{
  color:#49413d;
  font-size:8px;
  line-height:1.35;
  font-weight:720;
}
.tz-list-progress{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.tz-progress-inline{
  display:grid;
  grid-template-columns:minmax(0,1fr) 34px;
  align-items:center;
  gap:7px;
}
.tz-progress-inline>b{
  text-align:right;
  color:#403835;
  font-size:8px;
}
.tz-list-progress>span{
  color:#8b817c;
  font-size:7px;
}
.tz-list-action{text-align:right}
.tz-list-action .primary{
  min-height:31px;
  padding:0 10px;
  border-radius:8px;
  font-size:8px;
}

/* ---- Модальное окно ТЗ ---- */
.modal.tz-modal-wide{
  width:min(1420px,98vw);
  max-height:96vh;
  padding:16px;
}
.tz-topbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) 255px;
  gap:10px;
  margin-bottom:10px;
}
.tz-top-fields{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  padding:10px;
  border:1px solid #e3dcda;
  border-radius:11px;
  background:#faf9f8;
}
.tz-top-fields .field{margin:0}
.tz-top-progress{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  padding:11px 13px;
  border:1px solid #e3dcda;
  border-radius:11px;
  background:#fff;
}
.tz-top-progress>div:first-child{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.tz-top-progress span{
  color:#7d746f;
  font-size:8px;
  font-weight:750;
}
.tz-top-progress b{
  color:#6f102b;
  font-size:16px;
}
.tz-top-progress small{
  color:#857b76;
  font-size:7px;
}

/* Четыре колонки как в рабочем ТЗ */
.tz-readable-table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid #dcd4d0;
  border-radius:12px;
  background:#fff;
}
.tz-readable-table{
  width:100%;
  min-width:1080px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.tz-readable-table .tz-w-block{width:16%}
.tz-readable-table .tz-w-fixed{width:24%}
.tz-readable-table .tz-w-requirement{width:34%}
.tz-readable-table .tz-w-source{width:26%}
.tz-readable-table th{
  position:sticky;
  top:0;
  z-index:5;
  padding:10px 11px;
  background:#5f1028;
  color:#fff;
  border-right:1px solid rgba(255,255,255,.12);
  border-bottom:0;
  text-align:left;
  font-size:8.5px;
  line-height:1.25;
  font-weight:850;
  letter-spacing:.015em;
}
.tz-readable-table th:last-child{border-right:0}
.tz-readable-table td{
  padding:10px 11px;
  vertical-align:top;
  border-right:1px solid #e8e2df;
  border-bottom:1px solid #e8e2df;
  background:#fff;
}
.tz-readable-table tr:nth-child(even) td{background:#fcfbfa}
.tz-readable-table tr:last-child td{border-bottom:0}
.tz-readable-table td:last-child{border-right:0}
.tz-readable-table tr:hover td{background:#faf6f7}

.tz-col-block{background:#fbf8f8!important}
.tz-block-title{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:9px;
}
.tz-block-title>span{
  flex:0 0 auto;
  width:25px;
  height:25px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:#f1e5e9;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.tz-block-title>b{
  color:#2d2623;
  font-size:9.5px;
  line-height:1.3;
}
.tz-na-toggle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  color:#726964;
  font-size:7.5px;
  font-weight:700;
}
.tz-na-toggle input{
  width:14px;
  height:14px;
  margin:0;
  accent-color:#6f102b;
}
.tz-required-note{
  display:inline-flex;
  padding:4px 7px;
  border-radius:999px;
  background:#f8ebef;
  color:#8d2745;
  font-size:7px;
  font-weight:800;
}
.tz-col-fixed>div{
  color:#665e59;
  font-size:8.7px;
  line-height:1.5;
}
.tz-readable-table textarea{
  display:block;
  width:100%;
  min-height:88px;
  resize:vertical;
  padding:9px 10px;
  border:1px solid #dcd5d1;
  border-radius:8px;
  background:#fff;
  color:#302a27;
  font:inherit;
  font-size:9px;
  line-height:1.5;
}
.tz-readable-table textarea::placeholder{color:#aaa19c}
.tz-readable-table textarea:focus{
  outline:none;
  border-color:#ac7e8b;
  box-shadow:0 0 0 3px rgba(111,16,43,.06);
}
.tz-table-row.not-required td{
  background:#f4f2f1!important;
}
.tz-table-row.not-required .tz-col-fixed,
.tz-table-row.not-required .tz-block-title{
  opacity:.65;
}
.tz-table-row.not-required textarea{
  min-height:58px;
  background:#ece9e7!important;
  color:#9a918c!important;
  border-color:#e2ddda;
}
.tz-bottom-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:10px;
  margin-top:10px;
}
.tz-bottom-grid .field textarea{min-height:80px}

/* Сохраняем табличный вид внутри ТЗ и на ноутбуке */
@media(max-width:1180px){
  .tz-list-summary{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .tz-list-summary-note{grid-column:1 / -1}
  .tz-list-header{display:none}
  .tz-list-row{
    grid-template-columns:minmax(210px,1.4fr) 110px minmax(135px,1fr) minmax(180px,1.2fr) 80px 90px 100px;
  }
  .tz-list-responsible span,
  .tz-list-source span,
  .tz-list-date span{display:block}
  .tz-topbar{grid-template-columns:1fr}
  .tz-top-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:850px){
  .tz-list-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tz-list-summary-note{grid-column:1 / -1}
  .tz-list-row{
    grid-template-columns:1fr 110px;
    padding:10px 12px;
    gap:6px 10px;
  }
  .tz-list-row>div{padding:4px 0}
  .tz-list-product{grid-column:1 / 2;grid-row:1 / 2}
  .tz-list-status{grid-column:2 / 3;grid-row:1 / 2;text-align:right}
  .tz-list-responsible{grid-column:1 / 2}
  .tz-list-progress{grid-column:1 / -1}
  .tz-list-source,.tz-list-date{display:none}
  .tz-list-action{grid-column:2 / 3;grid-row:2 / 3;align-self:end}
  .tz-top-fields{grid-template-columns:1fr}
}
@media(max-width:560px){
  .tz-list-summary{grid-template-columns:1fr 1fr}
  .tz-list-summary>div{padding:9px 10px}
  .tz-list-summary-note{grid-column:1 / -1}
  .tz-list-row{grid-template-columns:1fr}
  .tz-list-product,.tz-list-status,.tz-list-responsible,.tz-list-progress,.tz-list-action{
    grid-column:1!important;
    grid-row:auto!important;
    text-align:left;
  }
  .tz-list-action .primary{width:100%}
}

/* v5.6.1 — v5.5 layout retained, TZ split into 5 logical parts */
.tz-parts-nav{
  position:sticky;
  top:64px;
  z-index:11;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
  margin:0 0 10px;
  padding:7px;
  border:1px solid #e0d9d5;
  border-radius:11px;
  background:rgba(250,248,247,.97);
  backdrop-filter:blur(8px);
}
.tz-part-nav{
  min-width:0;
  min-height:43px;
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  align-items:center;
  gap:6px;
  padding:6px 7px;
  border:1px solid #e3dcda;
  border-radius:8px;
  background:#fff;
  color:#544b47;
  cursor:pointer;
  text-align:left;
}
.tz-part-nav:hover{
  border-color:#c9aeb6;
  background:#fcf7f8;
}
.tz-part-nav>span{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:#f1e8eb;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.tz-part-nav>b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:7.4px;
  line-height:1.2;
}
.tz-part-nav>small{
  padding:3px 5px;
  border-radius:999px;
  background:#fff5e5;
  color:#986615;
  font-size:6.6px;
  font-weight:850;
}
.tz-part-nav.complete>small{
  background:#eaf7f0;
  color:#187448;
}

.tz-parts{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.tz-part{
  scroll-margin-top:122px;
  overflow:hidden;
  border:1px solid #ded7d3;
  border-radius:12px;
  background:#fff;
  box-shadow:0 4px 14px rgba(46,31,27,.025);
}
.tz-part-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:58px;
  padding:10px 12px;
  border-bottom:1px solid #e3dcda;
  background:linear-gradient(180deg,#fff,#faf8f7);
}
.tz-part-title{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.tz-part-title>span{
  flex:0 0 auto;
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#ede3e6;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.tz-part-title>div{
  min-width:0;
}
.tz-part-title h4{
  margin:0 0 2px;
  color:#302926;
  font-size:10px;
  line-height:1.3;
}
.tz-part-title p{
  margin:0;
  color:#817873;
  font-size:7.5px;
  line-height:1.4;
}
.tz-part-progress{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:6px;
  padding:5px 8px;
  border-radius:999px;
  background:#fff5e5;
  color:#986615;
}
.tz-part-progress.complete{
  background:#eaf7f0;
  color:#187448;
}
.tz-part-progress b,
.tz-part-progress span{
  font-size:7.3px;
  font-weight:850;
}
.tz-part-table-wrap{
  border:0!important;
  border-radius:0!important;
}
.tz-part .tz-readable-table th{
  top:111px;
}
.tz-part .tz-readable-table tr:last-child td{
  border-bottom:0;
}

@media(max-width:1050px){
  .tz-parts-nav{
    grid-template-columns:repeat(2,minmax(0,1fr));
    position:static;
  }
  .tz-part .tz-readable-table th{top:0}
}
@media(max-width:620px){
  .tz-parts-nav{grid-template-columns:1fr}
  .tz-part-head{align-items:flex-start}
  .tz-part-title p{font-size:7px}
}

/* v5.6.3 — readable adaptive editor inside structured TZ */

/* Give the editor real working width. */
.modal.tz-modal-wide{
  width:min(1520px,98vw)!important;
  max-height:96vh;
  padding:18px!important;
}
.tz-modal-head{
  margin:-18px -18px 12px!important;
  padding:15px 18px 12px!important;
}

/* Compact top controls: metadata left, progress right. */
.tz-topbar{
  grid-template-columns:minmax(0,1fr) 270px!important;
  gap:10px!important;
  margin-bottom:10px!important;
}
.tz-top-fields{
  gap:8px!important;
  padding:10px!important;
  border-radius:11px!important;
}
.tz-top-fields .field label{font-size:8px}
.tz-top-fields input,
.tz-top-fields select{
  min-height:34px;
  font-size:9px;
}
.tz-top-progress{
  padding:11px 13px!important;
  border-radius:11px!important;
}

/* Five steps: readable horizontal navigator instead of five squeezed boxes. */
.tz-parts-nav{
  position:sticky!important;
  top:58px!important;
  z-index:12!important;
  display:flex!important;
  gap:7px!important;
  overflow-x:auto!important;
  scrollbar-width:thin;
  padding:7px!important;
  margin-bottom:10px!important;
  border-radius:11px!important;
}
.tz-part-nav{
  flex:1 0 175px!important;
  min-width:175px!important;
  min-height:44px!important;
  grid-template-columns:25px minmax(0,1fr) auto!important;
  padding:7px 8px!important;
}
.tz-part-nav>b{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  font-size:7.8px!important;
  line-height:1.25!important;
}
.tz-part-nav>small{font-size:7px!important}

/* Logical sections behave like accordions. */
.tz-part{
  overflow:hidden!important;
  scroll-margin-top:122px;
}
.tz-part>summary{
  list-style:none;
  cursor:pointer;
}
.tz-part>summary::-webkit-details-marker{display:none}
.tz-part-head{
  min-height:64px!important;
  padding:11px 13px!important;
}
.tz-part-title h4{
  font-size:11px!important;
  line-height:1.3!important;
}
.tz-part-title p{
  max-width:780px;
  font-size:8px!important;
  line-height:1.45!important;
}
.tz-part-head-right{
  display:flex;
  align-items:center;
  gap:9px;
}
.tz-part-chevron{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:8px;
  background:#f0ebe9;
  color:#6f625c;
  font-size:14px;
  transition:transform .16s ease;
}
.tz-part[open] .tz-part-chevron{transform:rotate(180deg)}
.tz-part-progress{
  padding:6px 9px!important;
}
.tz-part-progress b,
.tz-part-progress span{
  font-size:7.8px!important;
}

/* Desktop table: more room, calmer typography, bigger writing fields. */
.tz-part-table-wrap{
  overflow:auto!important;
  background:#fff;
}
.tz-readable-table{
  min-width:1040px!important;
  table-layout:fixed;
}
.tz-readable-table .tz-w-block{width:15%!important}
.tz-readable-table .tz-w-fixed{width:23%!important}
.tz-readable-table .tz-w-requirement{width:37%!important}
.tz-readable-table .tz-w-source{width:25%!important}
.tz-part .tz-readable-table th{
  position:static!important;
  padding:10px 11px!important;
  background:#f1edeb!important;
  color:#554b46!important;
  border-right:1px solid #ddd5d1!important;
  border-bottom:1px solid #d8d0cc!important;
  font-size:8px!important;
  letter-spacing:.01em!important;
  text-transform:none!important;
}
.tz-part .tz-readable-table th:last-child{border-right:0!important}
.tz-readable-table td{
  padding:11px!important;
}
.tz-block-title{
  margin-bottom:10px!important;
}
.tz-block-title>b{
  font-size:10px!important;
}
.tz-col-fixed>div{
  font-size:9px!important;
  line-height:1.55!important;
}
.tz-na-toggle{
  padding:5px 7px;
  border-radius:7px;
  background:#f4f0ee;
  font-size:7.5px!important;
}
.tz-readable-table textarea{
  min-height:105px!important;
  padding:10px 11px!important;
  border-radius:9px!important;
  font-size:9.5px!important;
  line-height:1.55!important;
}
.tz-readable-table textarea::placeholder{
  color:#aaa19c;
  font-size:8.7px;
}

/* A skipped line should visually collapse instead of wasting vertical space. */
.tz-table-row.not-required textarea{
  min-height:52px!important;
}
.tz-table-row.not-required .tz-col-fixed{
  opacity:.58;
}

/* Bottom areas are visually separate from the technical matrix. */
.tz-bottom-grid{
  margin-top:12px!important;
  gap:12px!important;
}
.tz-general-comment,
.tz-files{
  padding:10px;
  border:1px solid #e4dedb;
  border-radius:11px;
  background:#faf9f8;
}
.sticky-actions{
  margin:12px -18px -18px!important;
  padding:11px 18px!important;
}

/* Laptop: each TZ line becomes a readable work card.
   No tiny 4-column table and no forced horizontal scrolling. */
@media(max-width:1240px){
  .modal.tz-modal-wide{
    width:97vw!important;
  }
  .tz-topbar{
    grid-template-columns:1fr!important;
  }
  .tz-top-fields{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .tz-parts-nav{
    position:static!important;
  }

  .tz-part-table-wrap{
    overflow:visible!important;
    padding:9px;
    background:#f8f6f5;
  }
  .tz-readable-table{
    min-width:0!important;
    width:100%!important;
    display:block;
  }
  .tz-readable-table colgroup,
  .tz-readable-table thead{
    display:none!important;
  }
  .tz-readable-table tbody{
    display:block;
  }
  .tz-readable-table tr.tz-table-row{
    display:grid!important;
    grid-template-columns:235px minmax(0,1.35fr) minmax(0,1fr);
    grid-template-rows:auto auto;
    margin-bottom:9px;
    overflow:hidden;
    border:1px solid #ddd5d1;
    border-radius:11px;
    background:#fff;
    box-shadow:0 3px 12px rgba(45,31,27,.03);
  }
  .tz-readable-table tr.tz-table-row:last-child{margin-bottom:0}
  .tz-readable-table tr.tz-table-row td{
    display:block!important;
    border:0!important;
    background:#fff!important;
  }
  .tz-readable-table .tz-col-block{
    grid-column:1;
    grid-row:1;
    padding:11px 11px 7px!important;
    background:#faf7f7!important;
  }
  .tz-readable-table .tz-col-fixed{
    grid-column:1;
    grid-row:2;
    padding:7px 11px 11px!important;
    background:#faf7f7!important;
    border-top:1px solid #eee7e4!important;
  }
  .tz-readable-table .tz-col-input{
    grid-column:2;
    grid-row:1 / span 2;
    padding:10px!important;
    border-left:1px solid #e7e0dd!important;
  }
  .tz-readable-table .tz-col-source{
    grid-column:3;
    grid-row:1 / span 2;
    padding:10px!important;
    border-left:1px solid #e7e0dd!important;
  }
  .tz-col-input::before,
  .tz-col-source::before{
    display:block;
    margin-bottom:6px;
    color:#786e69;
    font-size:7.5px;
    font-weight:850;
    letter-spacing:.02em;
  }
  .tz-col-input::before{content:"Требование по изделию"}
  
  .tz-readable-table textarea{
    min-height:125px!important;
  }
  .tz-table-row.not-required .tz-col-input,
  .tz-table-row.not-required .tz-col-source{
    background:#f1efed!important;
  }
}

/* Smaller laptop/tablet: title/help on top, two large writing areas below. */
@media(max-width:900px){
  .tz-top-fields{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .tz-readable-table tr.tz-table-row{
    grid-template-columns:1fr 1fr;
    grid-template-rows:auto auto;
  }
  .tz-readable-table .tz-col-block{
    grid-column:1;
    grid-row:1;
    border-bottom:1px solid #ece5e2!important;
  }
  .tz-readable-table .tz-col-fixed{
    grid-column:2;
    grid-row:1;
    padding:11px!important;
    border-top:0!important;
    border-left:1px solid #e7e0dd!important;
    border-bottom:1px solid #ece5e2!important;
    background:#faf7f7!important;
  }
  .tz-readable-table .tz-col-fixed::before{
    content:"Что фиксируется";
    display:block;
    margin-bottom:5px;
    color:#8a807b;
    font-size:7px;
    font-weight:850;
  }
  .tz-readable-table .tz-col-input{
    grid-column:1;
    grid-row:2;
    border-left:0!important;
  }
  .tz-readable-table .tz-col-source{
    grid-column:2;
    grid-row:2;
  }
  .tz-readable-table textarea{
    min-height:115px!important;
  }
}

/* Phone/narrow: fully stacked, readable labels and full-width controls. */
@media(max-width:640px){
  .modal.tz-modal-wide{
    width:100vw!important;
    max-height:100vh!important;
    border-radius:0!important;
    padding:13px!important;
  }
  .tz-modal-head{
    margin:-13px -13px 10px!important;
    padding:13px!important;
  }
  .tz-top-fields{
    grid-template-columns:1fr!important;
  }
  .tz-parts-nav{
    margin-left:-3px!important;
    margin-right:-3px!important;
    padding:5px!important;
  }
  .tz-part-nav{
    flex-basis:155px!important;
    min-width:155px!important;
  }
  .tz-part-head{
    align-items:flex-start!important;
    padding:10px!important;
  }
  .tz-part-title p{display:none}
  .tz-readable-table tr.tz-table-row{
    grid-template-columns:1fr;
    grid-template-rows:auto auto auto auto;
  }
  .tz-readable-table .tz-col-block,
  .tz-readable-table .tz-col-fixed,
  .tz-readable-table .tz-col-input,
  .tz-readable-table .tz-col-source{
    grid-column:1!important;
    grid-row:auto!important;
    border-left:0!important;
  }
  .tz-readable-table .tz-col-block{
    border-bottom:0!important;
  }
  .tz-readable-table .tz-col-fixed{
    border-top:1px solid #ece5e2!important;
  }
  .tz-readable-table .tz-col-input,
  .tz-readable-table .tz-col-source{
    border-top:1px solid #ece5e2!important;
  }
  .tz-readable-table textarea{
    min-height:100px!important;
  }
  .sticky-actions{
    margin:12px -13px -13px!important;
    padding:10px 13px!important;
  }
}

/* v5.6.4 — TZ without source/agreement column */

/* Outer TZ list now has 6 useful columns. */
.tz-list-header,
.tz-list-row{
  grid-template-columns:minmax(220px,1.5fr) 115px minmax(145px,1fr) minmax(190px,1.2fr) 96px 106px!important;
}
.tz-list-source{display:none!important}

/* Inside TZ: exactly 3 columns. */
.tz-readable-table .tz-w-block{width:18%!important}
.tz-readable-table .tz-w-fixed{width:27%!important}
.tz-readable-table .tz-w-requirement{width:55%!important}
.tz-readable-table .tz-w-source{display:none!important}
.tz-col-source{display:none!important}

/* Give the actual requirement area the visual priority. */
.tz-readable-table textarea{
  min-height:112px!important;
}
.tz-col-input::before{
  content:"Требование по изделию";
}

/* Laptop: left information column + one large work field. */
@media(max-width:1240px){
  .tz-readable-table tr.tz-table-row{
    grid-template-columns:245px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
  }
  .tz-readable-table .tz-col-block{
    grid-column:1!important;
    grid-row:1!important;
  }
  .tz-readable-table .tz-col-fixed{
    grid-column:1!important;
    grid-row:2!important;
  }
  .tz-readable-table .tz-col-input{
    grid-column:2!important;
    grid-row:1 / span 2!important;
    border-left:1px solid #e7e0dd!important;
  }
  .tz-readable-table .tz-col-input textarea{
    min-height:145px!important;
  }
}

/* Compact screen: block + explanation on top, requirement full width below. */
@media(max-width:900px){
  .tz-list-row{
    grid-template-columns:1fr 110px!important;
  }
  .tz-list-product{grid-column:1 / 2!important;grid-row:1 / 2!important}
  .tz-list-status{grid-column:2 / 3!important;grid-row:1 / 2!important;text-align:right}
  .tz-list-responsible{grid-column:1 / 2!important}
  .tz-list-progress{grid-column:1 / -1!important}
  .tz-list-date{display:none!important}
  .tz-list-action{grid-column:2 / 3!important;grid-row:2 / 3!important;align-self:end}

  .tz-readable-table tr.tz-table-row{
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:auto auto!important;
  }
  .tz-readable-table .tz-col-block{
    grid-column:1!important;
    grid-row:1!important;
  }
  .tz-readable-table .tz-col-fixed{
    grid-column:2!important;
    grid-row:1!important;
    border-left:1px solid #e7e0dd!important;
    border-top:0!important;
  }
  .tz-readable-table .tz-col-input{
    grid-column:1 / -1!important;
    grid-row:2!important;
    border-left:0!important;
    border-top:1px solid #e7e0dd!important;
  }
  .tz-readable-table .tz-col-input textarea{
    min-height:120px!important;
  }
}

/* Phone: fully stacked. */
@media(max-width:640px){
  .tz-list-row{
    grid-template-columns:1fr!important;
  }
  .tz-list-product,
  .tz-list-status,
  .tz-list-responsible,
  .tz-list-progress,
  .tz-list-action{
    grid-column:1!important;
    grid-row:auto!important;
    text-align:left!important;
  }
  .tz-list-action .primary{width:100%!important}

  .tz-readable-table tr.tz-table-row{
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto auto!important;
  }
  .tz-readable-table .tz-col-block,
  .tz-readable-table .tz-col-fixed,
  .tz-readable-table .tz-col-input{
    grid-column:1!important;
    grid-row:auto!important;
    border-left:0!important;
  }
}

/* material approval: read-only structured TZ inside each item */
.material-tz-summary{
  margin:12px 0 2px;
  overflow:hidden;
  border:1px solid #e1dad6;
  border-radius:12px;
  background:#fff;
}
.material-tz-summary>summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  cursor:pointer;
  background:#faf8f7;
}
.material-tz-summary>summary::-webkit-details-marker{display:none}
.material-tz-summary>summary>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.material-tz-summary>summary b{
  color:#342d29;
  font-size:9px;
}
.material-tz-summary>summary span{
  color:#817873;
  font-size:7px;
}
.material-tz-summary-mark{
  flex:0 0 auto;
  padding:5px 8px;
  border-radius:999px;
  background:#f1e7ea;
  color:#6f102b!important;
  font-size:7px!important;
  font-weight:850;
}
.material-tz-summary-body{
  padding:9px 11px 11px;
  border-top:1px solid #e7e1de;
}
.material-tz-group{
  margin-bottom:9px;
}
.material-tz-group:last-child{margin-bottom:0}
.material-tz-group h5{
  margin:0 0 5px;
  color:#6f102b;
  font-size:7.5px;
  letter-spacing:.02em;
}
.material-tz-row{
  display:grid;
  grid-template-columns:minmax(130px,180px) minmax(0,1fr);
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid #f0ecea;
}
.material-tz-row:last-child{border-bottom:0}
.material-tz-row span{
  color:#827873;
  font-size:7.5px;
  font-weight:750;
}
.material-tz-row b{
  color:#3c3431;
  font-size:8px;
  line-height:1.45;
  font-weight:650;
  overflow-wrap:anywhere;
}
.material-tz-empty{
  padding:5px 0;
  color:#8b817c;
  font-size:8px;
}
@media(max-width:640px){
  .material-tz-row{
    grid-template-columns:1fr;
    gap:3px;
  }
}

/* v5.7 unified quote stage */
.quote-workflow-card{
  margin:10px 0 12px;
  overflow:hidden;
  border:1px solid #ded7d3;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(46,31,27,.035);
}
.quote-workflow-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:13px 14px;
  border-bottom:1px solid #ebe5e2;
  background:linear-gradient(180deg,#fff,#fcfaf9);
}
.quote-workflow-head>div:first-child>span{
  display:block;
  margin-bottom:6px;
  color:#817873;
  font-size:7px;
  font-weight:850;
  letter-spacing:.055em;
}
.quote-workflow-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:7px;
}
.quote-workflow-actions button{
  min-height:34px;
  border-radius:9px;
  font-size:8px;
}
.quote-status-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 9px;
  border-radius:999px;
  font-size:8px;
  font-weight:850;
}
.quote-status-badge:before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:currentColor;
  opacity:.75;
}
.quote-status-badge.draft{background:#f2efed;color:#756c67}
.quote-status-badge.formed{background:#eef3ff;color:#4565a8}
.quote-status-badge.sent{background:#fff7e8;color:#996715}
.quote-status-badge.agreed{background:#edf8f2;color:#187448}

.quote-status-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:12px 14px 11px;
}
.quote-status-step{
  position:relative;
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  padding-right:20px;
}
.quote-status-step:not(:last-child):after{
  content:"";
  position:absolute;
  left:29px;
  right:0;
  top:13px;
  height:2px;
  background:#e6e0dd;
  z-index:0;
}
.quote-status-step.done:not(:last-child):after{
  background:#b9d9c8;
}
.quote-step-dot{
  position:relative;
  z-index:1;
  flex:0 0 auto;
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid #d9d1cd;
  background:#fff;
  color:#8b817c;
  font-size:7px;
  font-weight:900;
}
.quote-status-step.done .quote-step-dot{
  border-color:#9bc8b0;
  background:#eaf7f0;
  color:#187448;
}
.quote-status-step.active .quote-step-dot{
  box-shadow:0 0 0 4px rgba(24,116,72,.08);
}
.quote-status-step>div{
  position:relative;
  z-index:1;
  min-width:0;
  background:#fff;
  padding-right:7px;
}
.quote-status-step b{
  display:block;
  color:#3a322f;
  font-size:8.5px;
}
.quote-status-step small{
  display:block;
  margin-top:2px;
  color:#8c827d;
  font-size:7px;
}
.quote-workflow-note{
  padding:9px 14px 11px;
  border-top:1px solid #f0ece9;
  background:#faf9f8;
  color:#746b66;
  font-size:8px;
  line-height:1.45;
}
@media(max-width:760px){
  .quote-workflow-head{
    align-items:stretch;
    flex-direction:column;
  }
  .quote-workflow-actions{
    justify-content:stretch;
  }
  .quote-workflow-actions button{
    flex:1 1 150px;
  }
  .quote-status-steps{
    grid-template-columns:1fr;
    gap:9px;
  }
  .quote-status-step:not(:last-child):after{
    left:13px;
    right:auto;
    top:26px;
    bottom:-10px;
    width:2px;
    height:auto;
  }
}

/* =====================================================================
   v5.8.1 MOBILE — full responsive shell / phone usability
   ===================================================================== */
.mobile-menu-btn,.mobile-nav-close,.mobile-nav-backdrop,.mobile-account-actions,.nav-icon{display:none}
.topbar-title-wrap{display:flex;align-items:center;min-width:0}.topbar-title-copy{min-width:0}

@media (max-width:900px){
  html,body{height:100%;min-height:100%;overflow:hidden}
  body{overscroll-behavior:none}
  #app{display:block!important;width:100%;height:100dvh;min-height:100dvh}
  #app.hidden{display:none!important}

  /* Off-canvas navigation */
  .sidebar{
    position:fixed!important;inset:0 auto 0 0!important;z-index:120!important;
    width:min(86vw,320px)!important;min-height:100dvh!important;height:100dvh!important;
    padding:calc(14px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom))!important;
    transform:translateX(-104%);transition:transform .22s ease;overflow-y:auto;
    box-shadow:18px 0 48px rgba(0,0,0,.24)
  }
  body.mobile-nav-open .sidebar{transform:translateX(0)}
  .mobile-nav-backdrop{
    display:block;position:fixed;inset:0;z-index:110;background:rgba(0,0,0,.44);
    opacity:0;visibility:hidden;transition:opacity .18s ease,visibility .18s ease
  }
  body.mobile-nav-open .mobile-nav-backdrop{opacity:1;visibility:visible}
  .brand{padding:0 4px 16px!important;gap:10px!important;position:relative}
  .brand-copy{display:block!important;min-width:0}
  .brand-title{font-size:17px!important}.brand-sub{font-size:10px!important}
  .brand-mark{width:42px!important;height:42px!important;flex:0 0 auto}
  .mobile-nav-close{
    display:grid;place-items:center;margin-left:auto;width:40px;height:40px;border:1px solid #3f3f46;
    border-radius:10px;background:#262626;color:#fff;font-size:23px;line-height:1
  }
  .nav{
    display:flex!important;align-items:center;gap:11px;width:100%;min-height:46px!important;
    padding:10px 11px!important;font-size:13px!important;border-radius:10px!important;margin-bottom:3px!important
  }
  .nav-icon{display:grid;place-items:center;width:24px;flex:0 0 24px;color:#bdbdc4;font-size:16px;font-weight:800}
  .nav.active .nav-icon{color:#fff}.nav-label{display:inline!important;font-size:13px!important}
  .nav:before{display:none!important}
  .sidebar .full{min-height:46px!important;font-size:12px!important;padding:10px 12px!important}
  .sidebar .full:after{display:none!important}
  .mobile-account-actions{display:block;border-top:1px solid #343438;margin:10px 0;padding-top:10px}
  .secondary-nav{color:#bdbdc4!important}
  .version{display:block!important;font-size:9px!important;padding:10px 6px 0!important}

  /* Main shell and mobile top bar */
  .main{height:100dvh!important;width:100%!important;min-width:0!important;overflow:hidden!important}
  .topbar{
    position:relative;z-index:30;height:64px!important;min-height:64px!important;
    padding:calc(8px + env(safe-area-inset-top)) 10px 8px!important;
    gap:8px;border-bottom:1px solid var(--line)
  }
  .topbar-title-wrap{gap:9px;min-width:0;flex:1}
  .mobile-menu-btn{
    display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;
    width:42px;height:42px;flex:0 0 42px;border:1px solid var(--line);border-radius:10px;background:#fff
  }
  .mobile-menu-btn span{display:block;width:18px;height:2px;border-radius:2px;background:#292929}
  .topbar-title-copy{min-width:0;overflow:hidden}
  .topbar .eyebrow{font-size:7px!important;margin-bottom:2px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar h1{font-size:16px!important;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:56vw}
  .topbar-right{margin-left:auto!important;gap:6px!important;min-width:0}
  .global-search-wrap,.project-meta{display:none!important}
  .user-badge{border-left:0!important;padding-left:0!important;gap:0!important}
  .user-avatar{width:38px!important;height:38px!important;font-size:12px!important}
  .user-badge-text,#changePasswordBtn,#logoutBtn{display:none!important}

  /* Page sizing */
  .page{
    height:calc(100dvh - 64px - env(safe-area-inset-top))!important;
    padding:10px 10px calc(22px + env(safe-area-inset-bottom))!important;
    overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch
  }
  h2{font-size:20px!important;line-height:1.2}
  .muted{font-size:10px!important;line-height:1.45}
  .eyebrow{font-size:8px!important}

  /* Touch targets and iOS form zoom prevention */
  button,.ghost,.primary,.danger-outline{min-height:44px}
  input,select,textarea{font-size:16px!important}
  .field label{font-size:10px!important;margin-bottom:6px!important}
  .field input,.field select,.field textarea{min-height:44px;padding:10px 11px!important;border-radius:10px!important}
  .field textarea{min-height:110px}
  .form-grid{grid-template-columns:1fr!important;gap:10px!important}
  .field.full{grid-column:auto!important}
  .chips{gap:6px!important}.chip{min-height:38px;font-size:11px!important;padding:7px 9px!important}
  .form-section{padding:11px!important;border-radius:12px!important;margin-bottom:10px!important}
  .form-section-head{margin-bottom:10px!important}.form-section-head h4{font-size:13px!important}.form-section-head p{font-size:9px!important}
  .num{width:27px!important;height:27px!important}

  /* Page heads and toolbars */
  .home-head,.clients-head,.reports-head,.drive-head,.pricing-head,.admin-head,.workspace-head,.section-title{
    flex-direction:column!important;align-items:stretch!important;gap:9px!important
  }
  .home-head>button,.clients-head>button,.reports-head>button,.admin-head>button{width:100%}
  .drive-head-actions,.pricing-head-actions,.workspace-actions{width:100%!important;display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
  .drive-head-actions button,.pricing-head-actions button,.workspace-actions button{width:100%!important}
  .toolbar{flex-direction:column!important;align-items:stretch!important;gap:7px!important;margin-bottom:10px!important}
  .toolbar>button{width:100%}
  .search-wrap{width:100%!important;min-width:0!important;height:46px!important}
  .search-wrap input{font-size:16px!important}

  /* CRM funnel becomes a vertical mobile list instead of tiny horizontal columns */
  .pipeline{display:flex!important;flex-direction:column!important;gap:9px!important;overflow:visible!important;padding-bottom:8px!important;min-height:auto!important;width:100%}
  .stage-column{width:100%!important;min-width:0!important;min-height:0!important;padding:8px!important;border-radius:12px!important}
  .stage-col-head{min-height:38px!important;font-size:12px!important;padding:4px 4px 8px!important}
  .project-card{padding:11px!important;margin-bottom:7px!important;border-radius:11px!important}
  .project-card .name{font-size:13px!important}.project-card .addr{font-size:10px!important}.project-card .foot{font-size:9px!important}
  .project-card button{min-height:42px!important}

  /* Project workspace */
  .workspace-head{margin-bottom:9px!important}
  .workspace-actions{display:grid!important}
  .stage-strip{
    position:sticky!important;top:-10px!important;z-index:15!important;
    margin:0 -2px 9px!important;padding:6px!important;gap:6px!important;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;border-radius:11px!important
  }
  .stage-pill{min-width:145px!important;max-width:170px!important;min-height:44px!important;scroll-snap-align:start;font-size:10px!important}
  .project-tools-bar{
    flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;margin:7px 0 9px!important;padding:6px!important
  }
  .project-tool-btn{white-space:nowrap!important;flex:0 0 auto;min-height:40px!important;font-size:9px!important}
  .stage-content{padding:10px!important;min-height:0!important;border-radius:12px!important;overflow:hidden}
  .section-title h3{font-size:16px!important}
  .form-actions{
    position:sticky!important;bottom:-10px!important;z-index:12!important;
    display:grid!important;grid-template-columns:1fr!important;gap:7px!important;
    margin-top:10px!important;padding:18px 0 2px!important
  }
  .form-actions button{width:100%!important}

  /* KPI/grid-heavy screens */
  .kpis,.home-kpis,.report-kpis,.final-payment-kpis,.finance-kpis,.admin-summary,.client-detail-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important
  }
  .kpi,.home-kpi,.report-kpi,.payment-kpi,.finance-kpis>div,.admin-stat,.client-detail-kpis>div{padding:10px!important;min-height:0!important}
  .kpi .value,.home-kpi b,.report-kpi-value,.payment-kpi b,.admin-stat b{font-size:17px!important}
  .home-grid,.client-grid,.report-two-col,.finance-columns,.pricing-two-col,.admin-rights-grid,.scope-grid,.loss-list{grid-template-columns:1fr!important;gap:9px!important}
  .workshop-grid{grid-template-columns:1fr!important;gap:8px!important}
  .home-list-row{align-items:flex-start!important;padding:10px!important;gap:8px!important}
  .home-list-main b{font-size:10px!important}.home-list-side{font-size:8px!important}
  .report-section{padding:11px!important;border-radius:12px!important}
  .report-section-head{flex-direction:column!important;gap:5px!important}
  .crm-report-row{grid-template-columns:minmax(110px,1fr) minmax(70px,1fr) 28px!important;gap:6px!important}
  .conversion-row{grid-template-columns:1fr auto auto!important;gap:6px!important}.conversion-days{display:none!important}
  .report-tabs{width:100%!important;overflow-x:auto!important}.report-tab{flex:1 0 auto!important;min-height:40px!important}

  /* Drive/files */
  .drive-grid{grid-template-columns:1fr!important;gap:8px!important}
  .drive-file-toolbar{flex-wrap:wrap!important}.drive-count{width:100%;margin-left:0!important}
  .drive-file-row{grid-template-columns:38px minmax(0,1fr) auto!important;gap:8px!important;padding:9px!important}
  .drive-file-size{display:none!important}
  .drive-file-row .ghost{min-width:40px!important;padding:8px!important}

  /* Pricing/admin */
  .pricing-section{padding:11px!important}.pricing-notice{font-size:9px!important}
  .material-rate-row,.extra-rate-row{grid-template-columns:1fr!important;gap:7px!important}
  .price-input{max-width:none!important;font-size:16px!important;min-height:44px!important}
  .user-actions{white-space:normal!important;display:flex!important;gap:5px!important;flex-wrap:wrap!important}
  .user-actions button{margin:0!important;flex:1 1 120px}
  .rights-head{flex-direction:column!important}.stage-rights-list{max-height:none!important}

  /* Tables: contained horizontal scroll, never force whole page wider than phone */
  .table-wrap,.pricing-table-wrap,.drill-table-wrap,.material-table-shell,.tz-readable-table-wrap{
    width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;overscroll-behavior-x:contain;border-radius:10px!important
  }
  .table-wrap table{min-width:680px!important}
  table th,table td{padding:9px 8px!important;font-size:9px!important}
  table th{white-space:nowrap}
  .users-table{min-width:760px!important}.pricing-table{min-width:720px!important}.closed-projects-table{min-width:900px!important}

  /* Lists / task / issue / finance */
  .task-row,.issue-row{align-items:flex-start!important;flex-wrap:wrap!important;padding:10px!important}
  .task-main,.issue-main{width:calc(100% - 30px)!important;flex:1 1 calc(100% - 30px)!important}
  .task-actions{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
  .task-actions button{width:100%!important}
  .finance-line{padding:9px!important}.panel-head{padding:9px!important}
  .file-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;align-items:center!important}
  .file-row .fname{grid-column:1/-1!important;overflow-wrap:anywhere}

  /* Modal = full-screen sheet on phone/tablet */
  .modal-backdrop{padding:0!important;place-items:stretch!important;background:rgba(0,0,0,.34)!important}
  .modal,.modal.large,.modal.tz-modal-wide{
    width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;
    margin:0!important;border-radius:0!important;padding:calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom))!important;
    box-shadow:none!important;overflow-x:hidden!important;overflow-y:auto!important
  }
  .modal-head{
    position:sticky!important;top:calc(-12px - env(safe-area-inset-top))!important;z-index:30!important;
    background:#fff!important;margin:calc(-12px - env(safe-area-inset-top)) -10px 10px!important;
    padding:calc(10px + env(safe-area-inset-top)) 10px 10px!important;border-bottom:1px solid var(--line)!important;
    align-items:flex-start!important;gap:8px!important
  }
  .modal-head>div{min-width:0}.modal-head h3{font-size:17px!important;line-height:1.2!important;overflow-wrap:anywhere}
  .modal-close{width:42px!important;height:42px!important;flex:0 0 42px!important;position:sticky;top:0}
  .modal-toolbar{justify-content:stretch!important}.modal-toolbar button{width:100%!important}
  .stage-move-layout{grid-template-columns:1fr!important}

  /* Quote workflow */
  .quote-workflow-head{align-items:stretch!important;flex-direction:column!important;padding:11px!important}
  .quote-workflow-actions{display:grid!important;grid-template-columns:1fr!important}
  .quote-workflow-actions button{width:100%!important}
  .quote-status-steps{grid-template-columns:1fr!important;gap:8px!important;padding:10px 11px!important}
  .quote-status-step:not(:last-child):after{left:13px!important;right:auto!important;top:26px!important;bottom:-9px!important;width:2px!important;height:auto!important}

  /* Material approval summary/cards */
  .material-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .material-toolbar{flex-direction:column!important;align-items:stretch!important}.material-toolbar .search-wrap{width:100%!important}
  .material-card-view{display:block!important}.material-card{margin-bottom:9px!important}
  .material-card-grid{grid-template-columns:1fr!important}
  .material-tz-row{grid-template-columns:1fr!important;gap:3px!important}

  /* TZ */
  .tz-list-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tz-list-summary-note{grid-column:1/-1!important}
  .tz-parts-nav{position:static!important;display:flex!important;overflow-x:auto!important;gap:6px!important}
  .tz-part-nav{flex:0 0 160px!important;min-width:160px!important}
  .tz-top-fields{grid-template-columns:1fr!important}.tz-topbar{grid-template-columns:1fr!important}
}

@media (max-width:520px){
  .page{padding-left:8px!important;padding-right:8px!important}
  .topbar h1{max-width:52vw!important;font-size:15px!important}
  .kpis,.home-kpis,.report-kpis,.final-payment-kpis,.finance-kpis,.admin-summary,.client-detail-kpis,.material-summary-grid{
    grid-template-columns:1fr!important
  }
  .home-list-row{flex-direction:column!important}.home-list-side{text-align:left!important;white-space:normal!important}
  .workspace-actions{grid-template-columns:1fr!important}
  .stage-pill{min-width:135px!important}
  .project-tools-bar{margin-left:-2px!important;margin-right:-2px!important}
  .crm-report-row{grid-template-columns:1fr 60px 24px!important}
  .conversion-row{grid-template-columns:1fr auto!important}.conversion-rate{display:none!important}
  .task-actions{grid-template-columns:1fr!important}
  .price-grid,.manager-price-grid{grid-template-columns:1fr!important}
  .tz-list-summary{grid-template-columns:1fr!important}
}

@media (hover:none) and (pointer:coarse){
  button,.nav,.stage-pill,.project-tool-btn,.project-card{touch-action:manipulation}
  .project-card:hover,.report-drill:hover{transform:none!important}
}

/* v5.9 — custom item names, VAT quote controls, project-level preliminary measurement */
.vat-toggle{
  min-height:34px;
  padding:0 12px;
  border:1px solid #d8cec9;
  border-radius:9px;
  background:#fff;
  color:#5f5550;
  font-size:8px;
  font-weight:850;
  cursor:pointer;
}
.vat-toggle:hover{border-color:#b995a1;background:#fbf6f7}
.vat-toggle.active{
  border-color:#198754;
  background:#edf8f2;
  color:#187448;
}
.quote-vat-note{
  margin:0 0 10px;
  padding:9px 11px;
  border:1px solid #eadfbd;
  border-radius:10px;
  background:#fff9e9;
  color:#6f5a22;
  font-size:8px;
  line-height:1.45;
}
.quote-kpis .kpi.vat{border-left:3px solid #c99618}
.item-name-hint{
  margin:7px 0 10px;
  padding:8px 10px;
  border:1px solid #e4dedb;
  border-radius:9px;
  background:#faf9f8;
  color:#766d68;
  font-size:7.5px;
  line-height:1.45;
}
.quote-items-table .table-sub{margin-top:3px}
@media(max-width:760px){
  .quote-workflow-actions .vat-toggle{flex:1 1 130px}
  .quote-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .item-name-hint{font-size:8px}
}
@media(max-width:480px){
  .quote-kpis{grid-template-columns:1fr!important}
}

/* v5.9.1 — automatic designer markup from qualification */
.quote-designer-note{
  margin:8px 0 10px;
  padding:9px 11px;
  border:1px solid #dfd2d6;
  border-left:3px solid #6f102b;
  border-radius:9px;
  background:#fbf6f7;
  color:#625653;
  font-size:8px;
  line-height:1.45;
}
.quote-kpis .kpi.designer .value{color:#6f102b}

/* v5.10 — unified TZ + material approval */
.unified-tz-summary{margin-bottom:10px}
.unified-tz-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid #e2dbd7;
  border-radius:12px;
  background:#faf8f7;
}
.unified-tz-rule{
  color:#6f6661;
  font-size:8px;
  line-height:1.45;
}
.unified-tz-list{
  display:grid;
  gap:9px;
}
.unified-tz-item{
  display:grid;
  grid-template-columns:minmax(210px,1.25fr) minmax(360px,2fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid #e1dad6;
  border-radius:13px;
  background:#fff;
  box-shadow:0 3px 12px rgba(42,30,25,.025);
}
.unified-tz-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.unified-tz-identity{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.unified-tz-identity>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.unified-tz-identity b{
  color:#332c29;
  font-size:9px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.unified-tz-identity span:not(.item-number-badge){
  color:#8a817c;
  font-size:7.3px;
}
.unified-tz-status{display:flex}
.unified-tz-meta{
  display:grid;
  grid-template-columns:1.2fr 1fr 1fr .65fr;
  gap:7px;
}
.unified-tz-meta>div{
  min-width:0;
  padding:7px 8px;
  border-radius:9px;
  background:#faf8f7;
}
.unified-tz-meta span,
.unified-tz-comment span{
  display:block;
  margin-bottom:3px;
  color:#8b817c;
  font-size:6.8px;
  font-weight:750;
}
.unified-tz-meta b,
.unified-tz-comment b{
  display:block;
  color:#403733;
  font-size:7.8px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.unified-tz-meta .tz-progress-track{
  margin-top:5px;
}
.unified-tz-comment{
  grid-column:1 / -1;
  padding:8px 9px;
  border-radius:9px;
  background:#fbfaf9;
}
.unified-tz-actions{
  justify-self:end;
}
.unified-tz-actions .primary{
  min-width:105px;
}

.unified-tz-modal{
  width:min(1180px,96vw)!important;
}
.unified-tz-form-meta{
  display:grid;
  grid-template-columns:1fr 1.2fr 1.1fr 130px;
  gap:9px;
  margin-bottom:11px;
  padding:10px;
  border:1px solid #e4ddda;
  border-radius:11px;
  background:#faf8f7;
}
.unified-tz-form-meta .field{margin:0}
.unified-tz-form-meta .readonly-value{
  min-height:36px;
  display:flex;
  align-items:center;
  padding:8px 9px;
  border:1px solid #ddd5d1;
  border-radius:8px;
  background:#fff;
  color:#4a403c;
  font-size:8px;
}
.unified-tz-live{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-end;
  padding:7px 9px;
  border-radius:9px;
  background:#f1e9eb;
}
.unified-tz-live span{
  color:#7c6f6a;
  font-size:7px;
}
.unified-tz-live b{
  color:#6f102b;
  font-size:17px;
  line-height:1.1;
}
.unified-tz-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.unified-tz-field{
  min-width:0;
  overflow:hidden;
  border:1px solid #ddd6d2;
  border-radius:11px;
  background:#fff;
}
.unified-tz-field-head{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding:8px 9px;
  border-bottom:1px solid #ebe5e2;
  background:#faf8f7;
}
.unified-tz-field-title{
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
}
.unified-tz-field-title>span{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:23px;
  height:23px;
  border-radius:7px;
  background:#f0e6e9;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.unified-tz-field-title>b{
  color:#3b322e;
  font-size:8.6px;
}
.unified-tz-field textarea{
  display:block;
  width:100%;
  min-height:76px;
  resize:vertical;
  padding:9px 10px;
  border:0;
  outline:0;
  background:#fff;
  color:#342d29;
  font:inherit;
  font-size:8.5px;
  line-height:1.45;
}
.unified-tz-field textarea:focus{
  box-shadow:inset 0 0 0 1.5px #8e1738;
}
.unified-tz-field.not-required{
  background:#f2efed;
  border-color:#e3dedb;
}
.unified-tz-field.not-required .unified-tz-field-head,
.unified-tz-field.not-required textarea{
  background:#f2efed;
  opacity:.72;
}
.unified-tz-comment-field{
  margin-top:10px;
  padding:9px;
  border:1px solid #e2dcD8;
  border-radius:11px;
  background:#faf8f7;
}
.unified-tz-comment-field textarea{
  min-height:76px;
}

@media(max-width:1100px){
  .unified-tz-item{
    grid-template-columns:1fr auto;
  }
  .unified-tz-meta{
    grid-column:1 / -1;
    grid-row:2;
  }
  .unified-tz-actions{
    grid-column:2;
    grid-row:1;
  }
  .unified-tz-form-meta{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .unified-tz-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
  .unified-tz-toolbar .primary{
    width:100%;
    text-align:center;
  }
  .unified-tz-item{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .unified-tz-main,
  .unified-tz-meta,
  .unified-tz-actions{
    grid-column:1;
    grid-row:auto;
  }
  .unified-tz-meta{
    grid-template-columns:1fr 1fr;
  }
  .unified-tz-actions{
    justify-self:stretch;
  }
  .unified-tz-actions .primary{
    width:100%;
  }
  .unified-tz-form-meta{
    grid-template-columns:1fr;
  }
  .unified-tz-live{
    align-items:flex-start;
  }
  .unified-tz-fields{
    grid-template-columns:1fr;
  }
  .unified-tz-field textarea{
    min-height:92px;
  }
}
@media(max-width:480px){
  .unified-tz-meta{
    grid-template-columns:1fr;
  }
  .unified-tz-field-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .unified-tz-field .tz-na-toggle{
    align-self:flex-start;
  }
}

/* v5.11 — preliminary measurement status + sketch/technologist rework flow */
.status.rework{
  background:#fff0e8;
  color:#9a3d14;
  border:1px solid #f0c3aa;
  font-weight:850;
}
.sketch-rework-row>td{
  background:#fffaf5!important;
  border-top-color:#efcbb8!important;
  border-bottom-color:#efcbb8!important;
}
.sketch-rework-row>td:first-child{
  box-shadow:inset 3px 0 0 #c65c28;
}
.sketch-rework-label{
  margin-top:4px;
  color:#a64b20;
  font-size:7px;
  font-weight:850;
  line-height:1.25;
}
.stage-row-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  white-space:nowrap;
}
.danger-soft{
  appearance:none;
  border:1px solid #e7bca9;
  background:#fff5f0;
  color:#9a3d14;
  border-radius:8px;
  padding:7px 9px;
  font:inherit;
  font-size:7.5px;
  font-weight:800;
  cursor:pointer;
}
.danger-soft:hover{
  background:#ffebe1;
  border-color:#d99575;
}
.danger-btn{
  appearance:none;
  border:1px solid #9f351f;
  background:#a83f26;
  color:#fff;
  border-radius:9px;
  min-height:36px;
  padding:8px 12px;
  font:inherit;
  font-size:8px;
  font-weight:850;
  cursor:pointer;
}
.danger-btn:disabled{opacity:.55;cursor:wait}
.rework-warning{
  margin-bottom:12px;
  padding:10px 12px;
  border:1px solid #edc8b7;
  border-left:3px solid #b64d26;
  border-radius:10px;
  background:#fff8f4;
  color:#6c5145;
  font-size:8px;
  line-height:1.5;
}
.technologist-empty-note{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 10px;
  padding:10px 12px;
  border:1px dashed #d9ceca;
  border-radius:11px;
  background:#faf8f7;
  color:#766b66;
  font-size:8px;
}
.technologist-empty-note b{color:#463b36}
.workshop-stats .rework-stat{
  grid-column:1 / -1;
  background:#fff7f2;
}
.dot.rework{background:#c65c28}
.sketch-quality-report{
  border-left:3px solid #7b1734;
}
.sketch-quality-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.rework-kpi{
  border-color:#e5c2b2!important;
  background:#fffaf7!important;
}
.rework-kpi .report-kpi-value{color:#a04620}

@media(max-width:900px){
  .stage-row-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .stage-row-actions button{width:100%}
  .sketch-quality-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:520px){
  .sketch-quality-kpis{
    grid-template-columns:1fr;
  }
  .technologist-empty-note{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* v5.12 — controlled stage handoffs, shared docs, admin project deletion */
.file-origin{
  display:inline-block;
  margin-right:7px;
  padding:2px 5px;
  border-radius:6px;
  background:#f1ece9;
  color:#746862;
  font-size:6.5px;
  font-weight:850;
  vertical-align:middle;
}
.stage-doc-section .file-row .fname{
  min-width:0;
  overflow-wrap:anywhere;
}
.flow-quality-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.flow-quality-card{
  border:1px solid #ded7d3;
  border-radius:13px;
  background:#fff;
  overflow:hidden;
}
.flow-quality-route{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid #ece6e3;
  background:#faf8f7;
  color:#423733;
  font-size:8.5px;
}
.flow-quality-route span{
  color:#9b8e88;
}
.flow-quality-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.flow-quality-stats>div,
.flow-quality-stats>button{
  appearance:none;
  border:0;
  border-right:1px solid #eee8e5;
  background:#fff;
  padding:9px 10px;
  text-align:left;
  font:inherit;
}
.flow-quality-stats>div:last-child,
.flow-quality-stats>button:last-child{
  border-right:0;
}
.flow-quality-stats span{
  display:block;
  color:#8a7e78;
  font-size:6.6px;
  font-weight:800;
}
.flow-quality-stats b{
  display:block;
  margin:2px 0;
  color:#3e3531;
  font-size:15px;
}
.flow-quality-stats small{
  display:block;
  color:#9d928d;
  font-size:6.3px;
}
.flow-quality-stats .accent b{color:#6f102b}
.flow-return-stat{
  cursor:pointer;
  background:#fff8f4!important;
}
.flow-return-stat:hover{
  background:#ffefe7!important;
}
.flow-return-stat b{color:#a64b20}
.danger-project-delete{
  appearance:none;
  border:1px solid #d8b8b0;
  background:#fff8f6;
  color:#9c3020;
  border-radius:9px;
  min-height:36px;
  padding:8px 11px;
  font:inherit;
  font-size:8px;
  font-weight:850;
  cursor:pointer;
}
.danger-project-delete:hover{
  background:#ffede9;
  border-color:#c88474;
}
.danger-eyebrow{color:#a63c27!important}
.project-delete-warning{
  margin-bottom:12px;
  padding:11px 12px;
  border:1px solid #e7beb2;
  border-left:3px solid #ad4028;
  border-radius:10px;
  background:#fff7f4;
  color:#6b5047;
  font-size:8px;
  line-height:1.5;
}
.project-delete-warning b{
  color:#8c2f20;
}
.project-delete-check{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:10px 0 4px;
  color:#635751;
  font-size:8px;
}
.project-delete-check input{
  margin-top:1px;
}
@media(max-width:900px){
  .flow-quality-grid{
    grid-template-columns:1fr;
  }
  .flow-quality-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .flow-quality-stats>div,
  .flow-quality-stats>button{
    border-bottom:1px solid #eee8e5;
  }
}
@media(max-width:520px){
  .flow-quality-stats{
    grid-template-columns:1fr;
  }
  .flow-quality-stats>div,
  .flow-quality-stats>button{
    border-right:0;
  }
  .danger-project-delete{
    width:100%;
  }
}

/* v5.13 — production masters directory */
.master-directory-card{
  margin-bottom:14px;
  border-color:#d9ced1;
}
.master-directory-card .admin-table-head{
  gap:12px;
}
.master-directory-note{
  margin:0 12px 10px;
  padding:9px 11px;
  border:1px solid #e3d9dc;
  border-left:3px solid #6f102b;
  border-radius:9px;
  background:#fbf7f8;
  color:#6b5d59;
  font-size:8px;
  line-height:1.45;
}
.master-stat b{color:#6f102b}
.master-avatar{
  background:#f1e7ea!important;
  color:#6f102b!important;
}
.master-no-login{
  display:block;
  margin-top:2px;
  color:#948984;
  font-size:6.6px;
}
.master-form-note{
  margin-top:10px;
  padding:9px 10px;
  border-radius:9px;
  background:#faf8f7;
  color:#716660;
  font-size:8px;
  line-height:1.4;
}
.field-help{
  margin-top:4px;
  color:#8d827d;
  font-size:6.8px;
  line-height:1.35;
}
.masters-table td:last-child{
  min-width:150px;
}
@media(max-width:700px){
  .master-directory-card .admin-table-head{
    align-items:stretch;
    flex-direction:column;
  }
  .master-directory-card .admin-table-head .primary{
    width:100%;
  }
}

/* v5.14 — automatic workflow, contract editor, payment statuses, sketch approval */
.contract-editor-section{
  margin-top:12px;
}
.contract-editor-section .form-section-head{
  align-items:center;
}
.contract-editor-section .form-section-head .ghost{
  margin-left:auto;
}
.contract-editor-toolbar{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border:1px solid #e4ddda;
  border-bottom:0;
  border-radius:9px 9px 0 0;
  background:#faf8f7;
  color:#81756f;
  font-size:7px;
}
.contract-text-editor{
  display:block;
  width:100%;
  min-height:430px;
  padding:18px 20px;
  border:1px solid #dcd3cf;
  border-radius:0 0 10px 10px;
  outline:0;
  resize:vertical;
  background:#fff;
  color:#332c29;
  font-family:Georgia,"Times New Roman",serif;
  font-size:9px;
  line-height:1.65;
  white-space:pre-wrap;
}
.contract-text-editor:focus{
  border-color:#8a2944;
  box-shadow:0 0 0 2px rgba(111,16,43,.08);
}
.contract-workflow-card{
  margin-bottom:12px;
}
.payment-status-card{
  display:grid;
  grid-template-columns:minmax(220px,1.4fr) 1fr 1fr;
  gap:8px;
  align-items:stretch;
  margin-bottom:12px;
  padding:10px;
  border:1px solid #ded6d2;
  border-radius:12px;
  background:#faf8f7;
}
.payment-status-card>.field{
  margin:0;
}
.payment-status-card>div:not(.field){
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:8px 10px;
  border-radius:9px;
  background:#fff;
}
.payment-status-card>div:not(.field) span{
  color:#8a7e78;
  font-size:6.7px;
  font-weight:800;
}
.payment-status-card>div:not(.field) b{
  margin-top:3px;
  color:#413733;
  font-size:8.5px;
}
.payment-workflow-note{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid #e2d8db;
  border-left:3px solid #6f102b;
  border-radius:9px;
  background:#fbf7f8;
  color:#6d605b;
  font-size:7.5px;
  line-height:1.45;
}
.sketch-approval{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:3px 7px;
  border-radius:999px;
  font-size:6.8px;
  font-weight:850;
  white-space:nowrap;
}
.sketch-approval.empty{
  background:#f4f1ef;
  color:#968b85;
}
.sketch-approval.pending{
  background:#fff5df;
  color:#916217;
  border:1px solid #edd9a7;
}
.sketch-approval.agreed{
  background:#edf7ef;
  color:#2e7244;
  border:1px solid #bedbc7;
}
@media(max-width:760px){
  .contract-editor-section .form-section-head{
    align-items:stretch;
    flex-direction:column;
  }
  .contract-editor-section .form-section-head .ghost{
    margin-left:0;
    width:100%;
  }
  .contract-text-editor{
    min-height:360px;
    padding:14px;
    font-size:8.5px;
  }
  .payment-status-card{
    grid-template-columns:1fr;
  }
}

/* v5.15 — production master report */
.master-report-toolbar{
  margin-bottom:10px;
}
.master-report-filter{
  display:grid;
  grid-template-columns:180px 180px minmax(240px,1fr) auto;
  gap:10px;
  align-items:end;
  margin-bottom:10px;
  padding:12px;
  border:1px solid #ddd6d2;
  border-radius:12px;
  background:#faf8f7;
}
.master-report-filter .field{
  margin:0;
}
.master-filter-actions{
  display:flex;
  gap:7px;
  align-items:center;
  padding-bottom:1px;
}
.master-report-context{
  margin-bottom:12px;
}
.master-report-kpis{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.master-summary-table th,
.master-summary-table td,
.master-detail-table th,
.master-detail-table td{
  vertical-align:top;
}
.master-summary-table td:nth-child(4),
.master-summary-table td:nth-child(6),
.master-detail-table td:nth-child(7),
.master-detail-table td:nth-child(8){
  white-space:nowrap;
}
.master-detail-count{
  color:#81756f;
  font-size:7px;
}
.master-detail-count b{
  color:#3f3531;
  font-size:10px;
}
@media(max-width:1180px){
  .master-report-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .master-report-filter{
    grid-template-columns:1fr 1fr;
  }
  .master-filter-select{
    grid-column:1 / -1;
  }
  .master-filter-actions{
    grid-column:1 / -1;
  }
}
@media(max-width:680px){
  .master-report-kpis{
    grid-template-columns:1fr 1fr;
  }
  .master-report-filter{
    grid-template-columns:1fr;
  }
  .master-filter-select,
  .master-filter-actions{
    grid-column:1;
  }
  .master-filter-actions{
    align-items:stretch;
    flex-direction:column;
  }
  .master-filter-actions button{
    width:100%;
  }
}
@media(max-width:420px){
  .master-report-kpis{
    grid-template-columns:1fr;
  }
}

/* v5.16 — fixed employee role model */
.role-profile-card{
  margin-top:12px;
  padding:13px;
  border:1px solid #dcd3d6;
  border-radius:12px;
  background:#fbf8f9;
}
.role-profile-title{
  color:#4a3038;
  font-size:11px;
  font-weight:900;
}
.role-profile-description{
  margin-top:4px;
  color:#766a65;
  font-size:8px;
  line-height:1.5;
}
.role-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:11px;
}
.role-profile-grid>div{
  padding:9px 10px;
  border:1px solid #e5dddf;
  border-radius:9px;
  background:#fff;
}
.role-profile-grid>div.wide{
  grid-column:1 / -1;
}
.role-profile-grid span{
  display:block;
  margin-bottom:3px;
  color:#968a85;
  font-size:6.5px;
  font-weight:850;
  text-transform:uppercase;
}
.role-profile-grid b{
  color:#413733;
  font-size:7.8px;
  line-height:1.4;
}
.fixed-role-note{
  margin-top:10px;
  padding:9px 11px;
  border-left:3px solid #6f102b;
  border-radius:8px;
  background:#f8f3f5;
  color:#6e605b;
  font-size:7.5px;
  line-height:1.45;
}
.legacy-role-warning{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid #e5c793;
  border-left:3px solid #b87816;
  border-radius:8px;
  background:#fff9ec;
  color:#79561f;
  font-size:7.5px;
  line-height:1.45;
}
@media(max-width:620px){
  .role-profile-grid{
    grid-template-columns:1fr;
  }
  .role-profile-grid>div.wide{
    grid-column:1;
  }
}

/* v5.18 — finance department report */
.finance-report-kpis{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.finance-report-note{
  margin:10px 0 12px;
  padding:10px 12px;
  border:1px solid #e2d8db;
  border-left:3px solid #6f102b;
  border-radius:10px;
  background:#fbf7f8;
  color:#6d605b;
  font-size:7.5px;
  line-height:1.5;
}
.finance-report-table{
  min-width:1500px;
}
.finance-report-table th,
.finance-report-table td{
  vertical-align:middle;
}
.finance-report-table td:nth-child(4),
.finance-report-table td:nth-child(5),
.finance-report-table td:nth-child(6){
  white-space:nowrap;
}
.finance-doc-actions{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  min-width:210px;
}
.finance-doc-actions .ghost{
  min-height:30px;
  padding:5px 8px;
  font-size:6.8px;
}
.finance-doc-actions .ghost:disabled{
  opacity:.35;
  cursor:not-allowed;
}
.finance-status{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:3px 7px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:6.7px;
  font-weight:850;
  white-space:nowrap;
}
.finance-status.empty{
  background:#f4f1ef;
  color:#938781;
}
.finance-status.ok{
  background:#edf7ef;
  border-color:#bfdcc7;
  color:#2d7142;
}
.finance-status.pending{
  background:#fff5df;
  border-color:#ead7a6;
  color:#8b611c;
}
.finance-status.neutral{
  background:#f2eff5;
  border-color:#d8cee0;
  color:#66516f;
}
.finance-payment-progress{
  min-width:92px;
  display:flex;
  align-items:center;
  gap:6px;
}
.finance-payment-progress>div{
  width:58px;
  height:6px;
  overflow:hidden;
  border-radius:999px;
  background:#ece7e4;
}
.finance-payment-progress>div>span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#6f102b;
}
.finance-payment-progress b{
  min-width:34px;
  font-size:7px;
}
.finance-balance-row{
  background:#fffaf4;
}
@media(max-width:1180px){
  .finance-report-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:680px){
  .finance-report-kpis{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:420px){
  .finance-report-kpis{
    grid-template-columns:1fr;
  }
}

/* v5.18 — adaptive admin panel */
.admin-head-modern{
  padding:2px 0 4px;
}
.admin-head-modern h2{
  margin:2px 0 3px;
}
.admin-summary{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.admin-metric{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
  padding:13px 14px;
  border:1px solid #e1dad7;
  border-radius:14px;
  background:linear-gradient(180deg,#fff,#fcfbfa);
  box-shadow:0 4px 16px rgba(40,28,22,.025);
}
.admin-metric-icon{
  flex:0 0 38px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#f4ecef;
  color:#6f102b;
  font-size:12px;
  font-weight:900;
}
.admin-metric>div:last-child{
  min-width:0;
}
.admin-metric span{
  display:block;
  color:#827670;
  font-size:7px;
  font-weight:850;
  letter-spacing:.02em;
}
.admin-metric b{
  display:block;
  margin-top:2px;
  color:#382f2c;
  font-size:20px;
  line-height:1;
}
.admin-metric small{
  display:block;
  margin-top:4px;
  overflow:hidden;
  color:#9b908b;
  font-size:6.6px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-nav-tabs{
  display:flex;
  gap:6px;
  margin-bottom:11px;
  padding:5px;
  overflow-x:auto;
  border:1px solid #e0d8d4;
  border-radius:12px;
  background:#f6f3f1;
  scrollbar-width:none;
}
.admin-nav-tabs::-webkit-scrollbar{display:none}
.admin-nav-tab{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:36px;
  padding:7px 11px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#776b65;
  font:inherit;
  font-size:8px;
  font-weight:850;
  white-space:nowrap;
  cursor:pointer;
}
.admin-nav-tab b{
  min-width:20px;
  padding:2px 6px;
  border-radius:999px;
  background:#ebe6e3;
  color:#837872;
  font-size:6.6px;
}
.admin-nav-tab.active{
  background:#fff;
  color:#4d343c;
  box-shadow:0 2px 8px rgba(39,27,22,.07);
}
.admin-nav-tab.active b{
  background:#f3e6ea;
  color:#6f102b;
}

.admin-panel-section{
  overflow:hidden;
  border:1px solid #e0d8d4;
  border-radius:15px;
  background:#fff;
  box-shadow:0 5px 22px rgba(40,28,22,.025);
}
.admin-section-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:15px 16px;
  border-bottom:1px solid #eee8e5;
}
.admin-section-toolbar h3{
  margin:0;
  color:#3f3531;
  font-size:14px;
}
.admin-section-toolbar p{
  margin:4px 0 0;
  color:#8b807a;
  font-size:7.5px;
  line-height:1.4;
}
.admin-section-toolbar .primary{
  flex:0 0 auto;
}

.admin-directory-toolbar{
  display:grid;
  grid-template-columns:minmax(240px,1fr) 210px auto;
  gap:8px;
  align-items:center;
  padding:10px 16px;
  border-bottom:1px solid #eee9e6;
  background:#fbfaf9;
}
.admin-directory-toolbar.master-toolbar{
  grid-template-columns:minmax(240px,1fr) auto;
}
.admin-search-box{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  min-height:36px;
  padding:0 10px;
  border:1px solid #ded6d2;
  border-radius:9px;
  background:#fff;
}
.admin-search-box span{
  color:#9a8f89;
  font-size:13px;
}
.admin-search-box input{
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  color:#413733;
  font:inherit;
  font-size:8px;
}
.admin-directory-toolbar select{
  min-height:36px;
  border:1px solid #ded6d2;
  border-radius:9px;
  outline:0;
  background:#fff;
  color:#514640;
  padding:0 10px;
  font:inherit;
  font-size:8px;
}
.admin-result-count{
  color:#938781;
  font-size:7px;
  font-weight:800;
  white-space:nowrap;
}

.admin-employee-grid,
.admin-master-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  padding:12px;
}
.admin-employee-card,
.admin-master-card{
  display:flex;
  min-width:0;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #e2dcD8;
  border-radius:12px;
  background:#fff;
  transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;
}
.admin-employee-card:hover,
.admin-master-card:hover{
  transform:translateY(-1px);
  border-color:#d2c2c7;
  box-shadow:0 8px 20px rgba(40,28,22,.055);
}
.admin-employee-card.is-disabled,
.admin-master-card.is-disabled{
  background:#faf9f8;
  opacity:.78;
}
.admin-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:9px;
  padding:12px;
}
.admin-person{
  display:flex;
  min-width:0;
  align-items:center;
  gap:9px;
}
.admin-person-avatar{
  flex:0 0 36px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#efe8e5;
  color:#5b4148;
  font-size:10px;
  font-weight:900;
}
.admin-person-main{
  min-width:0;
}
.admin-person-name{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
  color:#3f3531;
  font-size:9px;
  font-weight:850;
  line-height:1.25;
}
.admin-person-login{
  margin-top:2px;
  overflow:hidden;
  color:#978b85;
  font-size:6.7px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-state{
  flex:0 0 auto;
  padding:3px 6px;
  border-radius:999px;
  font-size:6.3px;
  font-weight:850;
  white-space:nowrap;
}
.admin-state.active{
  background:#edf7ef;
  color:#337348;
}
.admin-state.inactive{
  background:#f2efed;
  color:#847872;
}
.admin-role-line{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 12px 10px;
  padding:9px;
  border:1px solid #ece5e2;
  border-radius:9px;
  background:#faf8f7;
}
.admin-role-icon{
  flex:0 0 28px;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#f2e7ea;
  color:#6f102b;
  font-size:7px;
  font-weight:900;
}
.admin-role-line>div{
  min-width:0;
}
.admin-role-line b{
  display:block;
  overflow:hidden;
  color:#493c37;
  font-size:8px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-role-line small{
  display:block;
  margin-top:2px;
  color:#91857f;
  font-size:6.4px;
  line-height:1.3;
}
.admin-card-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1px;
  margin-top:auto;
  border-top:1px solid #eee9e6;
  border-bottom:1px solid #eee9e6;
  background:#eee9e6;
}
.admin-card-meta.single{
  grid-template-columns:1fr;
}
.admin-card-meta>div{
  min-width:0;
  padding:8px 10px;
  background:#fff;
}
.admin-card-meta span{
  display:block;
  color:#998e88;
  font-size:6px;
  font-weight:800;
}
.admin-card-meta b{
  display:block;
  margin-top:3px;
  overflow:hidden;
  color:#514641;
  font-size:6.9px;
  font-weight:750;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-card-actions{
  display:flex;
  gap:6px;
  padding:9px 10px;
}
.admin-card-actions button{
  flex:1;
  min-height:32px;
}
.danger-soft{
  color:#9b4032!important;
  border-color:#ead2cd!important;
  background:#fff9f7!important;
}
.danger-soft:hover{
  background:#fff0ec!important;
}

.admin-info-strip{
  margin:11px 14px 0;
  padding:9px 11px;
  border:1px solid #e7dce0;
  border-left:3px solid #6f102b;
  border-radius:9px;
  background:#fbf7f8;
  color:#746761;
  font-size:7px;
  line-height:1.5;
}
.admin-info-strip.role-info{
  margin-bottom:0;
}
.admin-master-purpose{
  margin:0 12px 10px;
  padding:9px 10px;
  border-radius:9px;
  background:#f8f6f5;
  color:#81756f;
}
.admin-master-purpose span{
  display:block;
  font-size:6.4px;
}
.admin-master-purpose b{
  display:block;
  margin-top:3px;
  color:#493c37;
  font-size:8px;
}
.admin-empty-state{
  grid-column:1 / -1;
  display:flex;
  min-height:150px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:#938781;
  text-align:center;
}
.admin-empty-state b{
  color:#625650;
  font-size:9px;
}
.admin-empty-state span{
  font-size:7px;
}

.admin-role-directory{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:12px;
}
.admin-role-card{
  overflow:hidden;
  border:1px solid #e2dbd7;
  border-radius:12px;
  background:#fff;
}
.admin-role-card-head{
  display:flex;
  gap:10px;
  padding:12px;
}
.admin-role-card-icon{
  flex:0 0 36px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#f3e8eb;
  color:#6f102b;
  font-size:8px;
  font-weight:900;
}
.admin-role-card-head h4{
  margin:0;
  color:#3f3531;
  font-size:10px;
}
.admin-role-card-head p{
  margin:4px 0 0;
  color:#897d77;
  font-size:6.8px;
  line-height:1.45;
}
.admin-role-facts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1px;
  border-top:1px solid #eee8e5;
  background:#eee8e5;
}
.admin-role-facts>div{
  padding:8px 10px;
  background:#fbfaf9;
}
.admin-role-facts>div.wide{
  grid-column:1 / -1;
}
.admin-role-facts span{
  display:block;
  color:#9a8e88;
  font-size:6px;
  font-weight:800;
}
.admin-role-facts b{
  display:block;
  margin-top:3px;
  color:#514641;
  font-size:6.8px;
  line-height:1.4;
}

@media(max-width:1180px){
  .admin-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .admin-employee-grid,
  .admin-master-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:800px){
  .admin-head-modern{
    align-items:stretch;
  }
  .admin-head-modern .primary{
    min-height:42px;
  }
  .admin-section-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
  .admin-section-toolbar .primary{
    width:100%;
    min-height:40px;
  }
  .admin-directory-toolbar,
  .admin-directory-toolbar.master-toolbar{
    grid-template-columns:1fr;
  }
  .admin-result-count{
    justify-self:end;
  }
  .admin-role-directory{
    grid-template-columns:1fr;
  }
}
@media(max-width:600px){
  .admin-summary{
    grid-template-columns:1fr 1fr;
    gap:7px;
  }
  .admin-metric{
    align-items:flex-start;
    padding:10px;
  }
  .admin-metric-icon{
    flex-basis:32px;
    width:32px;
    height:32px;
    font-size:9px;
  }
  .admin-metric b{
    font-size:17px;
  }
  .admin-metric small{
    white-space:normal;
    line-height:1.25;
  }
  .admin-nav-tabs{
    margin-left:-2px;
    margin-right:-2px;
  }
  .admin-nav-tab{
    flex:0 0 auto;
    min-height:40px;
  }
  .admin-employee-grid,
  .admin-master-grid{
    grid-template-columns:1fr;
    padding:8px;
  }
  .admin-card-top{
    padding:11px;
  }
  .admin-card-actions{
    position:sticky;
    bottom:0;
    background:#fff;
  }
  .admin-card-actions button{
    min-height:38px;
  }
}
@media(max-width:390px){
  .admin-summary{
    grid-template-columns:1fr;
  }
  .admin-card-meta{
    grid-template-columns:1fr;
  }
}

/* v5.19 — PM → Project Engineer sketch delegation */
.constructor-field select{
  font-weight:750;
}
.constructor-flow-note{
  margin-top:2px;
  padding:10px 12px;
  border:1px solid #dfd5d8;
  border-left:3px solid #6f102b;
  border-radius:10px;
  background:#fbf7f8;
  color:#6e615c;
  font-size:7.6px;
  line-height:1.5;
}
.sketch-manager-readonly{
  margin:0 0 10px;
  padding:10px 12px;
  border:1px solid #dfd8d4;
  border-left:3px solid #6f102b;
  border-radius:10px;
  background:#faf8f7;
  color:#70645e;
  font-size:7.7px;
  line-height:1.5;
}
.sketch-manager-readonly b{
  color:#4a363c;
}
.sketch-readonly-modal-note{
  margin-top:10px;
  padding:9px 11px;
  border-radius:9px;
  background:#f6f3f2;
  color:#776b65;
  font-size:7.5px;
  line-height:1.45;
}
@media(max-width:620px){
  .constructor-flow-note,
  .sketch-manager-readonly,
  .sketch-readonly-modal-note{
    font-size:8px;
  }
}

/* v5.20 — persistent specialist work queues */
.role-queue-card{
  border-color:#d9c9ce;
  background:linear-gradient(180deg,#fff,#fdfafa);
}
.role-queue-card .drag-strip{
  color:#6f102b;
  background:#f7eef1;
}
.role-queue-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:8px 0 0;
  padding:7px 8px;
  border:1px solid #eadde1;
  border-radius:8px;
  background:#fbf6f8;
  color:#756761;
  font-size:6.6px;
}
.role-queue-meta span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.role-queue-meta b{
  flex:0 0 auto;
  color:#5e2334;
  font-size:6.8px;
}
.role-queue-main-stage{
  margin-top:5px;
  color:#8a7e78;
  font-size:6.3px;
  line-height:1.35;
}
.role-queue-main-stage b{
  color:#62554f;
}
@media(max-width:600px){
  .role-queue-meta{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* v5.21 — Production / Painting / Installation multi-queue + input package */
.production-input-package{
  margin:0 0 12px;
  padding:10px;
  border:1px solid #ddd2d6;
  border-radius:12px;
  background:#faf7f8;
}
.production-input-package-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:9px;
  padding:2px 2px 8px;
  border-bottom:1px solid #e7dfe1;
}
.production-input-package-head>div{
  min-width:0;
}
.production-input-package-head b{
  display:block;
  color:#49353c;
  font-size:8.8px;
}
.production-input-package-head span{
  display:block;
  margin-top:3px;
  color:#897b76;
  font-size:6.8px;
  line-height:1.4;
}
.production-package-count{
  flex:0 0 auto;
  padding:4px 7px;
  border-radius:999px;
  background:#f0e3e7;
  color:#6f102b!important;
  font-size:6.5px!important;
  font-weight:850;
  white-space:nowrap;
}
.production-input-package .stage-doc-section{
  background:#fff;
}
.production-stage-overview{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:10px 0;
}
.production-stage-card{
  padding:11px 12px;
  border:1px solid #dfd6d3;
  border-radius:11px;
  background:#fff;
}
.production-stage-card span{
  display:block;
  color:#857872;
  font-size:6.6px;
  font-weight:850;
  text-transform:uppercase;
}
.production-stage-card b{
  display:block;
  margin-top:4px;
  color:#49383a;
  font-size:10px;
}
.production-stage-card small{
  display:block;
  margin-top:3px;
  color:#9a8f89;
  font-size:6.4px;
}
@media(max-width:760px){
  .production-stage-overview{
    grid-template-columns:1fr;
  }
  .production-input-package-head{
    flex-direction:column;
  }
}

.document-company-selector{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--muted,#666);min-width:190px}.document-company-selector select{padding:9px 12px;border:1px solid #ded9dc;border-radius:8px;background:white;color:#272228;font-size:14px;max-width:100%}.quote-workflow-actions{flex-wrap:wrap}

.settings-head{margin-bottom:20px}.settings-head h2{margin-bottom:6px}.settings-tabs{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:24px}.settings-tab.active{background:var(--accent,#781b29);color:#fff;border-color:var(--accent,#781b29)}.settings-panel .admin-head h3,.settings-panel .pricing-head h3{margin:4px 0 8px}
