@layer module-structure {
/* Shared list, directory and draft-form components for Estimation. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:calc(-1 * var(--space-4));overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
[hidden]{display:none!important}
.estimation-module{min-width:0}
.estimation-module .page-heading{align-items:flex-end;margin-bottom:var(--space-24)}
.estimation-module .page-heading h1{font-size:var(--text-page);letter-spacing:-1.3px}
.estimation-module .page-heading p{max-width:800px}
.estimation-module .primary{box-shadow:0 8px 22px #cc35461a}
.filters-panel{padding:var(--space-16)}
.search-pair{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-12);padding-bottom:var(--space-12);border-bottom:1px solid var(--line)}
.search-pair .input-wrap{border-radius:var(--radius-control);min-height:42px}
.search-pair input{font-size:var(--text-meta)}
.filter-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-12);padding-top:var(--space-12);flex-wrap:wrap}
.filter-group,.toolbar-end{display:flex;align-items:center;gap:var(--space-8);flex-wrap:wrap;min-width:0}
.toolbar-end{justify-content:flex-end}
.filter-select{display:flex;align-items:center;gap:var(--space-12);border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-control);min-height:39px;padding:0 var(--space-12);min-width:145px}
.filter-select>span{font-size:var(--text-meta);font-weight:600;color:var(--muted)}
.filter-select select,.sort-select select{min-width:0;flex:1;color:var(--text);border:0;background:transparent;min-height:37px;font-size:var(--text-meta);padding-right:var(--space-12);cursor:pointer;max-width:220px}
.filter-select:focus-within,.sort-select:focus-within{outline:2px solid var(--focus);outline-offset:2px}
.filter-select select:focus-visible,.sort-select select:focus-visible{outline:0}
.sort-select{display:flex;align-items:center;gap:var(--space-8);border:1px solid var(--line);border-radius:var(--radius-control);padding:0 var(--space-8);min-height:39px;background:var(--surface)}
.sort-select svg{width:15px;color:var(--accent)}
.record-count,.directory-totals{font-size:var(--text-meta);color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.view-switch{display:flex;gap:var(--space-4);background:var(--soft);border:1px solid var(--line);border-radius:var(--radius-control);padding:var(--space-4);flex-shrink:0}
.view-switch button{display:flex;gap:var(--space-4);align-items:center;border-radius:var(--radius-control);font-size:var(--text-meta);font-weight:600;padding:var(--space-8) var(--space-8);min-height:31px;color:var(--muted);white-space:nowrap}
.view-switch button svg{width:13px;height:13px}
.view-switch button.active{background:var(--surface);box-shadow:0 1px 5px #1b282216;color:var(--accent)}
.view-switch button:hover{color:var(--accent)}
.active-filter-row{display:flex;align-items:center;justify-content:space-between;min-height:15px;gap:var(--space-12);font-size:var(--text-meta);color:var(--muted)}
.active-filter-row:has(:not(:empty)):has(button:not([hidden])){padding:var(--space-8) var(--space-4)}
.active-filter-row>span:not(:empty){padding:var(--space-8) var(--space-4)}
.est-empty{display:flex;min-height:335px;flex-direction:column;align-items:center;justify-content:center;padding:var(--space-40) var(--space-24);text-align:center;white-space:normal}
.empty-symbol{display:flex;align-items:center;justify-content:center;width:60px;height:60px;border-radius:var(--radius-dialog);background:#cc354608;color:var(--accent);border:1px solid #cc354615;margin-bottom:var(--space-16)}
.empty-symbol svg{width:26px;height:26px;stroke-width:1.4}
.est-empty h2{font-size:var(--text-section);letter-spacing:-.4px;margin:0 0 var(--space-8)}
.est-empty p{color:var(--muted);font-size:var(--text-body);max-width:400px;line-height:1.7;margin:0 0 var(--space-20)}
.est-empty small{font-size:var(--text-meta);color:var(--muted);margin-top:var(--space-16)}
.draft-footnote{color:var(--muted);font-size:var(--text-meta);display:flex;align-items:center;justify-content:center;gap:var(--space-4);margin:var(--space-20) 0 0;text-align:center}
.draft-footnote svg{width:13px;height:13px}
.directory-toolbar{padding:var(--space-16);display:flex;align-items:center;justify-content:space-between;gap:var(--space-16);flex-wrap:wrap}
.directory-toolbar>.input-wrap{width:min(420px,100%);min-height:40px;border-radius:var(--radius-control);flex:1;min-width:220px}
.directory-toolbar .input-wrap input{font-size:var(--text-meta)}
.directory-toolbar .filter-select{min-width:210px}
.records-grid,.directory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-12)}
.client-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.record-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--space-16);box-shadow:var(--shadow);min-width:0;display:flex;flex-direction:column}
.record-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-8);margin-bottom:var(--space-16)}
.status-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-dialog);padding:var(--space-4) var(--space-8);background:#8f66710d;border:1px solid #8f667129;font-size:var(--text-meta);font-weight:700;color:#84646e;white-space:nowrap;line-height:1.3}
.status-badge.kind{color:var(--accent);background:#cc354609;border-color:transparent}
.status-badge.quote-type{border-color:#c29a5c40;color:#916223;background:#c29a5c12;text-transform:uppercase;align-self:flex-start;margin-top:calc(-1 * var(--space-8))}
.status-badge.active,.status-badge.approved{background:#198e6810;border-color:#198e6830;color:#188660}
.status-badge.onhold{background:#cf941210;border-color:#cf941230;color:#a0771f}
.status-badge.closed{background:var(--soft);color:var(--muted);border-color:var(--line)}
.number-pair{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-8);margin-bottom:var(--space-20)}
.number-pair>div{background:var(--soft);border:1px solid var(--line);border-radius:var(--radius-control);padding:var(--space-8) var(--space-8)}
.number-pair span,.field-caption{display:block;font-size:var(--text-meta);text-transform:uppercase;letter-spacing:.25px;color:var(--muted);font-weight:700}
.number-pair strong{display:block;margin-top:var(--space-4);font-size:var(--text-body);font-variant-numeric:tabular-nums}
.record-name h2{font-size:var(--text-card);font-weight:500;letter-spacing:-.15px;margin-top:var(--space-8);overflow-wrap:anywhere}
.record-name p{font-size:var(--text-meta);color:var(--muted);margin:var(--space-4) 0 var(--space-16);overflow-wrap:anywhere}
.record-summary{display:grid;gap:var(--space-12);border-top:1px solid var(--line);padding:var(--space-16) 0;color:var(--muted);font-size:var(--text-meta);margin-top:auto}
.record-summary>span{display:flex;align-items:center;gap:var(--space-8)}
.record-summary svg{width:15px;height:15px;color:var(--accent)}
.record-summary b{color:var(--text);width:13px}
.record-card footer{display:flex;align-items:center;justify-content:space-between;gap:var(--space-8);border-top:1px solid var(--line);padding-top:var(--space-16);margin-top:auto;font-size:var(--text-meta);color:var(--muted)}
.record-card footer>span{display:flex;align-items:center;gap:var(--space-4)}
.record-card footer svg{width:12px;height:12px}
.record-open{display:flex;align-items:center;gap:var(--space-4);color:var(--accent);font-size:var(--text-meta);font-weight:700;text-align:right;padding:var(--space-4) 0}
.record-open:hover,.table-name:hover{text-decoration:underline}
.quote-number{display:block;font-size:var(--text-stat);font-weight:750;line-height:1.2;margin-top:var(--space-4);letter-spacing:-.5px}
.quote-card .record-name{margin:var(--space-16) 0 var(--space-20);min-height:55px}
.quote-card .record-name h2{font-weight:650;font-size:var(--text-card)}
.quote-project{padding:var(--space-12);border-radius:var(--radius-card);background:var(--soft);border:1px solid var(--line);font-size:var(--text-meta);margin-bottom:var(--space-12);overflow-wrap:anywhere}
.quote-project strong{display:block;margin:var(--space-4) 0 var(--space-12);font-size:var(--text-meta)}
.quote-project>span:last-child{display:block;margin-top:var(--space-4);color:var(--muted)}
.quote-summary{display:grid;grid-template-columns:1fr 1.3fr .6fr;gap:var(--space-4);padding:var(--space-12) 0;border-top:1px solid var(--line)}
.quote-summary span{font-size:var(--text-meta);text-transform:uppercase;display:block;font-weight:700;color:var(--muted)}
.quote-summary strong{display:block;font-size:var(--text-meta);margin-top:var(--space-4)}
.directory-card{display:flex;align-items:center;gap:var(--space-12);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow);background:var(--surface);padding:var(--space-20) var(--space-16);text-align:left;width:100%;min-width:0;min-height:90px}
.directory-card:hover{border-color:#cc354640;background:var(--soft)}
.directory-avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:var(--radius-control);background:var(--line);color:var(--muted);width:34px;height:34px;font-size:var(--text-meta);font-weight:750}
.directory-info{display:flex;flex-direction:column;gap:var(--space-4);min-width:0;flex:1}
.directory-info strong{font-size:var(--text-body);overflow-wrap:anywhere}
.directory-info>span,.directory-info small{font-size:var(--text-meta);color:var(--muted);overflow-wrap:anywhere}
.directory-card>svg{width:16px;color:var(--muted)}
.client-grid .directory-card{min-height:99px}
.table-scroll{overflow-x:auto;border-radius:inherit;max-width:100%}
.table-scroll:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.table-panel table{border-collapse:collapse;width:100%;text-align:left;min-width:810px;font-size:var(--text-meta)}
.table-panel th{font-size:var(--text-meta);font-weight:700;text-transform:uppercase;letter-spacing:.45px;color:var(--muted);background:var(--soft);padding:var(--space-12) var(--space-16);border-bottom:1px solid var(--line)}
.table-panel td{padding:var(--space-16) var(--space-16);border-bottom:1px solid var(--line);vertical-align:middle;max-width:280px;overflow-wrap:anywhere}
.table-panel td[colspan]{padding:0}
.table-panel tbody tr:last-child td{border-bottom:0}
.table-panel tbody tr:has(.table-name):hover{background:var(--soft)}
.table-panel td strong{font-size:var(--text-meta);font-weight:500}
.table-name{text-align:left;font-weight:650;font-size:var(--text-body);padding:var(--space-4) 0}
.record-number{font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}
.table-open{display:flex;align-items:center;justify-content:center;padding:var(--space-4);background:var(--soft);border-radius:var(--radius-control)}
.table-open svg{width:15px;height:15px}
.bid-metrics{gap:var(--space-12);margin-bottom:var(--space-12)}
.bid-metric{padding:var(--space-20) var(--space-16);min-height:124px;display:flex;align-items:center;gap:var(--space-12)}
.bid-metric>div{flex:1;text-align:center;min-width:0}
.bid-metric>div>span{font-size:var(--text-meta);color:var(--muted)}
.bid-metric strong{display:block;margin:var(--space-8) 0 var(--space-8);font-size:var(--text-stat);letter-spacing:-.6px}
.bid-metric small{display:block;font-size:var(--text-meta);line-height:1.6;color:var(--muted)}
.metric-symbol{width:39px;height:39px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-card);flex-shrink:0}
.metric-symbol.blue{background:#397ff010;color:#3478e5}.metric-symbol.red{background:#cc354609;color:var(--accent)}.metric-symbol.green{background:#139f7310;color:#15916a}.metric-symbol.purple{background:#8955ed10;color:#8c5ce5}
.bid-table th:nth-child(2){width:30%}
.bid-table .est-empty{min-height:335px}
.form-modal{max-width:660px}
.estimation-form,.record-detail{padding:var(--space-20)}
.form-note{display:flex;align-items:flex-start;gap:var(--space-8);padding:var(--space-12);background:var(--soft);border:1px solid var(--line);border-radius:var(--radius-control);color:var(--muted);font-size:var(--text-meta);line-height:1.6}
.form-note p{margin:0}
.form-note svg{width:16px;height:16px;margin-top:var(--space-4);color:var(--accent)}
.required-help{color:var(--muted);font-size:var(--text-meta);margin:var(--space-16) 0 var(--space-8)}
.required-mark{color:var(--accent)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-16)}
.form-field{display:flex;flex-direction:column;gap:var(--space-4);min-width:0;font-size:var(--text-meta);font-weight:600}
.form-field.span-2{grid-column:1/-1}
.form-field input,.form-field select,.form-field textarea{width:100%;min-width:0;min-height:41px;padding:var(--space-8) var(--space-12);border-radius:var(--radius-control);border:1px solid var(--line);background:var(--surface);color:var(--text);font:var(--text-body)/1.5 var(--font-ui)}
.form-field textarea{resize:vertical}
.form-field textarea:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.form-help{font-size:var(--text-meta);line-height:1.7;color:var(--muted);margin:var(--space-16) 0 0}
.form-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-8);margin-top:var(--space-24);padding-top:var(--space-16);border-top:1px solid var(--line)}
.record-detail dl{margin:var(--space-16) 0}
.record-detail dl>div{display:grid;grid-template-columns:145px minmax(0,1fr);gap:var(--space-16);padding:var(--space-12) 0;border-bottom:1px solid var(--line);font-size:var(--text-body)}
.record-detail dt{color:var(--muted)}
.record-detail dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.toast{position:fixed;bottom:23px;left:50%;transform:translateX(-50%);z-index:150;max-width:calc(100vw - 32px);padding:var(--space-12) var(--space-20);border:1px solid var(--line);border-radius:var(--radius-control);background:var(--text);color:var(--surface);box-shadow:var(--shadow);font-size:var(--text-body);text-align:center}
html[data-theme=dark] .status-badge{color:#d2aab4}
html[data-theme=dark] .status-badge.kind{color:#f18b98}
html[data-theme=dark] .status-badge.quote-type{color:#dbb372}
html[data-theme=dark] .status-badge.active{color:#69c7a2}
html[data-theme=dark] .status-badge.onhold{color:#dbb372}
@media(min-width:1800px){.estimation-module .page-heading h1{font-size:var(--text-page)}.filters-panel{padding:var(--space-16)}.record-card{padding:var(--space-16)}.record-name h2{font-size:var(--text-card)}.est-empty{min-height:375px}.bid-metric{min-height:125px}.table-panel th{font-size:var(--text-meta)}}
@media(max-width:1400px){.records-grid,.directory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-row>.toolbar-end{margin-left:auto}.bid-metric{padding:var(--space-16) var(--space-12);gap:var(--space-8)}.metric-symbol{width:32px;height:32px}.bid-metric small{font-size:var(--text-meta)}.estimation-module .page-heading h1{font-size:var(--text-page)}}
@media(max-width:1150px){.estimation-module .page-heading{flex-wrap:wrap}.estimation-module .heading-actions{margin-left:auto}.directory-toolbar>.toolbar-end{margin-left:auto}.bid-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.bid-metric{min-height:110px}.bid-metric small{font-size:var(--text-meta)}.bid-metric>div{text-align:left}.metric-symbol{width:39px;height:39px}.bid-metric>div>span{font-size:var(--text-meta)}.bid-metric strong{margin:var(--space-4) 0;font-size:var(--text-stat)}.directory-toolbar>.input-wrap{max-width:none}}
@media(max-width:800px){.filter-row{align-items:stretch}.filter-group{flex:1}.filter-select{flex:1}.toolbar-end{gap:var(--space-8)}.filter-row>.toolbar-end{width:100%;justify-content:flex-start}.record-count{margin-left:auto}.directory-totals{margin-left:auto}.directory-toolbar>.toolbar-end{width:100%;justify-content:flex-start}.estimation-module .heading-actions{margin-left:0}.estimation-module .page-heading h1{font-size:var(--text-page)}.table-panel table:has(.est-empty){min-width:700px}.table-panel .est-empty{position:sticky;left:0;width:calc(100vw - 42px)}.table-panel .est-empty p{max-width:320px}.form-modal{max-height:90dvh}}
@media(max-width:600px){.search-pair{grid-template-columns:1fr;gap:var(--space-8)}.records-grid,.directory-grid{grid-template-columns:1fr}.filter-select{min-width:0;padding:0 var(--space-8);gap:var(--space-8)}.filter-select select{max-width:100%;font-size:var(--text-meta)}.filters-panel{padding:var(--space-12)}.sort-select select{font-size:var(--text-meta)}.sort-select{padding:0 var(--space-8);gap:var(--space-4)}.sort-select svg{width:12px}.view-switch button{font-size:var(--text-meta);padding:var(--space-8)}.record-count{font-size:var(--text-meta)}.filter-row>.toolbar-end{gap:var(--space-8)}.estimation-module .page-heading h1{font-size:var(--text-page)}.directory-toolbar{padding:var(--space-12)}.directory-toolbar .filter-select{min-width:180px}.est-empty{padding:var(--space-32) var(--space-16);min-height:335px}.est-empty h2{font-size:var(--text-section)}.est-empty p{font-size:var(--text-meta)}.bid-metric{gap:var(--space-8);padding:var(--space-16) var(--space-12);align-items:flex-start}.bid-metric>div>span{font-size:var(--text-meta)}.bid-metric small{font-size:var(--text-meta)}.bid-metric .metric-symbol{width:27px;height:27px;border-radius:var(--radius-control)}.metric-symbol svg{width:16px;height:16px}.form-grid{grid-template-columns:1fr}.form-field{grid-column:1/-1}.estimation-form,.record-detail{padding:var(--space-16)}.form-actions{flex-wrap:wrap}.record-detail dl>div{grid-template-columns:110px minmax(0,1fr)}.draft-footnote{align-items:flex-start;text-align:left}.table-panel .est-empty{width:calc(100vw - 34px)}.estimation-module .heading-actions .primary{padding:var(--space-8) var(--space-12)}.directory-toolbar .input-wrap{min-width:0;flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.toast{transition:none}}

}
