:root{--primary:#0f9f83;--primary2:#0b7b68;--bg:#eef7f4;--text:#12322d;--muted:#6d827e;--danger:#b91c1c;--shadow:0 18px 45px rgba(7,61,51,.13)}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,Arial,sans-serif;background:linear-gradient(180deg,#e8f7f2,#f7fbfa);color:var(--text);direction:rtl}.shell{min-height:100vh;display:grid;place-items:center;padding:24px}.card{width:min(430px,100%);background:#fff;border-radius:26px;box-shadow:var(--shadow);padding:22px}.brand{text-align:center;margin-bottom:18px}.logo{width:76px;height:76px;border-radius:22px;margin:0 auto 10px;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-size:28px;font-weight:900}.brand h1{font-size:18px;margin:0}.brand p{font-size:12px;color:var(--muted);margin:5px 0 0}.field{margin:12px 0}.field label{display:block;font-size:12px;color:var(--muted);font-weight:800;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;border:1px solid #dbe7e4;background:#f8fbfa;border-radius:15px;padding:11px 13px;font:inherit;color:var(--text);outline:none}.field input,.field select{height:48px}.field textarea{resize:vertical;min-height:92px}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(15,159,131,.10)}.btn{width:100%;height:48px;border:0;border-radius:16px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-weight:900;font-size:15px;cursor:pointer;display:inline-grid;place-items:center;text-decoration:none}.btn.secondary{background:#eef7f4;color:var(--primary2)}.btn.compact{width:auto;height:42px;padding:0 18px;font-size:13px;border-radius:13px}.action-link{text-decoration:none}.alert{border-radius:14px;padding:11px 12px;margin-bottom:12px;font-size:12px;line-height:1.6}.alert.error{background:#fee2e2;color:#991b1b}.alert.success{background:#dcfce7;color:#166534}.hint{font-size:11px;color:var(--muted);line-height:1.7;margin:10px 0}.topbar{position:sticky;top:0;z-index:20;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;padding:14px 18px;display:flex;justify-content:space-between;align-items:center;box-shadow:var(--shadow)}.topbar b{font-size:15px}.topbar a{color:#fff;text-decoration:none;font-weight:900}.page{max-width:900px;margin:0 auto;padding:20px}.wide-page{max-width:1100px}.form-page{max-width:900px}.panel{background:#fff;border-radius:22px;box-shadow:var(--shadow);padding:18px;margin-bottom:14px}.panel h2{margin:0 0 10px;font-size:18px}.roles{display:flex;gap:7px;flex-wrap:wrap}.role{background:#eef7f4;color:var(--primary2);border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.stat{background:#f8fbfa;border:1px solid #e4efec;border-radius:16px;padding:14px;text-align:center}.stat b{display:block;font-size:20px}.stat span{font-size:11px;color:var(--muted)}.inline-form{margin:0}.link-button{border:0;background:transparent;color:#fff;font:inherit;font-weight:900;cursor:pointer;padding:0}.top-actions{display:flex;align-items:center;gap:16px}.summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}.summary-grid.two-cols{grid-template-columns:repeat(2,1fr)}.summary-grid.three-cols{grid-template-columns:repeat(3,1fr)}.summary-card{background:#fff;border:1px solid #e2eeeb;border-radius:18px;box-shadow:0 8px 25px rgba(7,61,51,.07);padding:16px;text-align:center;text-decoration:none;color:var(--text)}.summary-card.selected{border-color:var(--primary);box-shadow:0 0 0 3px rgba(15,159,131,.10)}.summary-card strong{display:block;font-size:22px;margin-bottom:5px}.summary-card span{font-size:11px;color:var(--muted)}.toolbar-panel{display:flex;justify-content:space-between;align-items:center;gap:12px}.search-form{display:grid;grid-template-columns:minmax(240px,1fr) 160px auto;gap:9px;flex:1}.search-form input,.search-form select{height:42px;border:1px solid #dbe7e4;background:#f8fbfa;border-radius:13px;padding:0 12px;font:inherit;outline:none}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.section-heading h2{margin:0}.section-heading span{color:var(--muted);font-size:12px}.customer-list{display:grid;gap:10px}.customer-row{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid #e4efec;background:#fbfdfc;border-radius:17px;padding:14px}.customer-name{font-weight:900;color:var(--text);text-decoration:none;font-size:15px}.customer-meta,.customer-submeta{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}.customer-meta span,.customer-submeta span{font-size:11px;color:var(--muted)}.customer-meta span:not(:last-child)::after,.customer-submeta span:not(:last-child)::after{content:'•';margin-right:8px}.customer-side{display:flex;align-items:flex-end;flex-direction:column;gap:10px;flex:0 0 auto}.status-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900}.status-badge.active{background:#dcfce7;color:#166534}.status-badge.inactive{background:#f1f5f9;color:#475569}.row-actions{display:flex;gap:10px}.row-actions a{font-size:12px;color:var(--primary2);font-weight:900;text-decoration:none}.empty-state{text-align:center;color:var(--muted);padding:30px 10px;font-size:13px}.pagination{display:flex;justify-content:center;gap:6px;margin-top:16px;flex-wrap:wrap}.pagination a{min-width:34px;height:34px;border-radius:10px;background:#eef7f4;color:var(--primary2);display:grid;place-items:center;text-decoration:none;font-weight:900;font-size:12px}.pagination a.current{background:var(--primary);color:#fff}.data-form{padding:20px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 14px}.form-grid .full{grid-column:1/-1}.form-actions{display:flex;gap:10px;margin-top:16px}.readonly-code{display:flex;justify-content:space-between;align-items:center;background:#eef7f4;border-radius:14px;padding:12px 14px;margin-bottom:10px}.readonly-code span{font-size:12px;color:var(--muted)}.customer-header-card{display:flex;justify-content:space-between;align-items:center;gap:14px}.title-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.title-line h1{margin:0;font-size:22px}.code-line{margin:5px 0 0;color:var(--muted);font-size:12px}.header-actions{display:flex;gap:8px;flex-wrap:wrap}.details-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.details-grid>div{border:1px solid #e4efec;background:#fbfdfc;border-radius:15px;padding:12px}.details-grid .full{grid-column:1/-1}.details-grid span{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}.details-grid strong{font-size:13px;line-height:1.7}.note-form{display:grid;grid-template-columns:1fr auto;gap:9px;margin-bottom:14px}.note-form textarea{border:1px solid #dbe7e4;background:#f8fbfa;border-radius:14px;padding:11px 12px;font:inherit;resize:vertical;min-height:80px}.notes-list{display:grid;gap:9px}.note-card{background:#f8fbfa;border:1px solid #e4efec;border-radius:15px;padding:12px}.note-card p{margin:0 0 8px;font-size:13px;line-height:1.8}.note-card small{color:var(--muted);font-size:10px}.danger-zone{border:1px solid #fecaca}.danger-button{border:0;border-radius:13px;background:#fee2e2;color:#991b1b;padding:11px 16px;font:inherit;font-weight:900;cursor:pointer}.module-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.module-card{display:block;border:1px solid #e4efec;background:#f8fbfa;border-radius:17px;padding:16px;text-decoration:none;color:var(--text)}.module-card strong{display:block;margin-bottom:6px}.module-card span{color:var(--muted);font-size:11px}.module-card.disabled{opacity:.55}.module-card:not(.disabled):hover{border-color:var(--primary)}
@media(max-width:760px){.summary-grid,.summary-grid.three-cols{grid-template-columns:repeat(2,1fr)}.toolbar-panel{align-items:stretch;flex-direction:column}.search-form{grid-template-columns:1fr}.toolbar-panel>.btn{width:100%}.details-grid{grid-template-columns:repeat(2,1fr)}.customer-header-card{align-items:flex-start;flex-direction:column}.module-grid{grid-template-columns:1fr}}
@media(max-width:620px){.grid{grid-template-columns:1fr}.page{padding:14px}.topbar{padding:13px 14px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.form-actions{flex-direction:column}.customer-row{align-items:flex-start}.customer-side{align-items:flex-start}.summary-grid,.summary-grid.two-cols,.summary-grid.three-cols{grid-template-columns:repeat(2,1fr)}.details-grid{grid-template-columns:1fr}.details-grid .full{grid-column:auto}.note-form{grid-template-columns:1fr}.note-form .btn{width:100%}}
@media(max-width:380px){.summary-grid,.summary-grid.two-cols,.summary-grid.three-cols{grid-template-columns:1fr}.customer-row{flex-direction:column}.customer-side{width:100%;flex-direction:row;justify-content:space-between;align-items:center}.top-actions{gap:10px}.topbar{font-size:12px}}
.order-summary-grid{grid-template-columns:repeat(5,1fr)}.warning-card{border-color:#fdba74!important;background:#fff7ed!important}.order-search-form{grid-template-columns:minmax(220px,1fr) 150px 170px auto}.order-list{display:grid;gap:10px}.order-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid #e4efec;background:#fbfdfc;border-radius:18px;padding:15px}.order-row.is-overdue{border-color:#fdba74;background:#fffaf5}.order-main{min-width:0;flex:1}.order-title-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.order-name{font-size:16px;font-weight:950;color:var(--text);text-decoration:none}.order-customer{font-weight:850;margin-top:7px}.order-customer small{color:var(--muted);font-weight:600}.order-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.order-meta span{font-size:11px;color:var(--muted)}.order-meta span:not(:last-child)::after{content:'•';margin-right:8px}.order-description{margin:8px 0 0;color:#48645f;font-size:12px}.order-side{display:flex;flex-direction:column;align-items:flex-end;gap:9px;flex:0 0 auto}.pricing-badge,.priority-label{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:900}.pricing-badge{background:#e0f2fe;color:#075985}.pricing-not_priced{background:#fef3c7;color:#92400e}.pricing-approved{background:#dcfce7;color:#166534}.pricing-rejected{background:#fee2e2;color:#991b1b}.priority-label{background:#f1f5f9;color:#475569}.priority-urgent{background:#fee2e2;color:#991b1b}.priority-high{background:#ffedd5;color:#9a3412}.status-badge.overdue{background:#ffedd5;color:#9a3412}.order-status{background:#e2e8f0;color:#334155}.status-new{background:#dbeafe;color:#1d4ed8}.status-in_production{background:#ede9fe;color:#6d28d9}.status-ready{background:#dcfce7;color:#166534}.status-delivered,.status-closed{background:#d1fae5;color:#065f46}.status-cancelled{background:#fee2e2;color:#991b1b}.items-heading{margin-top:22px}.items-editor{display:grid;gap:12px}.item-editor-card{border:1px solid #dceae6;background:#f9fcfb;border-radius:18px;padding:14px}.item-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.remove-item{border:0;background:#fee2e2;color:#991b1b;border-radius:11px;padding:8px 11px;font:inherit;font-size:11px;font-weight:900;cursor:pointer}.remove-item:disabled{opacity:.4;cursor:not-allowed}.item-form-grid{grid-template-columns:repeat(4,1fr)}.order-header-card{display:flex;align-items:center;justify-content:space-between;gap:14px}.disabled-button{opacity:.55;cursor:not-allowed}.order-items-list{display:grid;gap:10px}.order-item-card{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:12px;border:1px solid #e4efec;background:#fbfdfc;border-radius:17px;padding:13px}.order-item-number{width:36px;height:36px;border-radius:12px;background:#e8f7f2;color:var(--primary2);display:grid;place-items:center;font-weight:950}.order-item-content h3{margin:0;font-size:14px}.order-item-content p{margin:8px 0 0;font-size:11px;color:var(--muted)}.order-item-qty{text-align:center;min-width:75px}.order-item-qty strong{display:block;font-size:18px}.order-item-qty span,.order-item-qty small{display:block;color:var(--muted);font-size:10px}.order-note-form{display:grid;grid-template-columns:140px 1fr auto;gap:9px;margin-bottom:14px}.order-note-form select,.order-note-form textarea{border:1px solid #dbe7e4;background:#f8fbfa;border-radius:14px;padding:11px 12px;font:inherit}.order-note-form textarea{min-height:76px;resize:vertical}.note-type-label{display:inline-flex;background:#eef7f4;color:var(--primary2);font-size:10px;font-weight:900;border-radius:999px;padding:4px 8px;margin-bottom:7px}.timeline{display:grid;gap:0}.timeline-row{position:relative;display:grid;grid-template-columns:20px 1fr;gap:8px;padding:0 0 17px}.timeline-row:not(:last-child)::before{content:'';position:absolute;right:6px;top:12px;bottom:-2px;width:2px;background:#dceae6}.timeline-dot{width:14px;height:14px;border-radius:50%;background:var(--primary);margin-top:2px;z-index:1}.timeline-row strong{display:block;font-size:12px}.timeline-row small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.danger-button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:900px){.order-summary-grid{grid-template-columns:repeat(3,1fr)}.item-form-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.order-search-form{grid-template-columns:1fr}.order-header-card{align-items:flex-start;flex-direction:column}.order-note-form{grid-template-columns:1fr}.order-note-form .btn{width:100%}}
@media(max-width:620px){.order-summary-grid{grid-template-columns:repeat(2,1fr)}.order-row{flex-direction:column}.order-side{width:100%;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap}.item-form-grid{grid-template-columns:1fr}.order-item-card{grid-template-columns:36px 1fr}.order-item-qty{grid-column:2;text-align:right;display:flex;align-items:center;gap:7px}.order-item-qty strong,.order-item-qty span,.order-item-qty small{display:inline}.order-header-card .header-actions{width:100%}.order-header-card .header-actions .btn{flex:1}.order-details-grid{grid-template-columns:1fr}}
@media(max-width:380px){.order-summary-grid{grid-template-columns:1fr}}

.field-help{display:block;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.5}

/* Phase 4 - approved mobile-first orders workflow */
.hidden{display:none!important}.orders-app-page{margin:0;background:linear-gradient(180deg,#e9f7f3 0,#f8fbfa 100%);color:var(--text);overflow-x:hidden}.orders-app-shell{width:100%;max-width:520px;min-height:100vh;margin:0 auto;background:#f4faf8;box-shadow:0 0 0 1px rgba(10,90,75,.05);overflow-x:hidden}.orders-page-header{position:sticky;top:0;z-index:40;height:66px;background:#fff;border-bottom:1px solid #e1ece9;border-radius:0 0 22px 22px;box-shadow:0 6px 20px rgba(12,83,70,.07)}.orders-page-header h1{position:absolute;right:24px;top:50%;transform:translateY(-50%);margin:0;font-size:20px;font-weight:950;color:#111}.orders-close{position:absolute;left:18px;top:50%;transform:translateY(-50%);width:38px;height:38px;border-radius:13px;background:#eef3f2;color:#111;text-decoration:none;display:grid;place-items:center;font-size:25px;line-height:1}.orders-app-main{padding:12px 12px 34px}.orders-card{background:#fff;border:1px solid #e2eeeb;border-radius:20px;padding:14px;margin-bottom:11px;box-shadow:0 8px 24px rgba(15,85,72,.055)}.orders-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.orders-section-title h2{margin:0;font-size:16px}.orders-section-title>span{font-size:10px;color:var(--muted)}.orders-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 9px}.orders-form-grid .full,.item-form-grid .full{grid-column:1/-1}.orders-data-form .field{min-width:0}.orders-data-form label{font-size:11px;margin:9px 0 5px}.orders-data-form input,.orders-data-form select,.orders-data-form textarea{width:100%;border:1px solid #dbe8e5;background:#f9fcfb;border-radius:14px;padding:11px;font:inherit;color:var(--text);outline:none}.orders-data-form input:focus,.orders-data-form select:focus,.orders-data-form textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(15,159,131,.09)}.orders-data-form textarea{resize:vertical;min-height:72px}.readonly-order-code{display:flex;align-items:center;justify-content:space-between}.readonly-order-code span{font-size:11px;color:var(--muted)}.readonly-order-code strong{font-size:16px}.orders-info-note{border:1px solid #bde8dc;background:#ecfbf6;color:#126652;border-radius:15px;padding:11px;font-size:11px;line-height:1.8;margin:10px 0}.manufacturing-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.manufacturing-chip{margin:0!important}.manufacturing-chip input{position:absolute;opacity:0;width:1px!important;height:1px}.manufacturing-chip span{display:flex;align-items:center;justify-content:center;min-height:42px;border:1px solid #dbe8e5;border-radius:14px;background:#f8fbfa;color:#46625d;font-size:11px;font-weight:850}.manufacturing-chip input:checked+span{border-color:var(--primary);background:#def6ef;color:var(--primary2);box-shadow:inset 0 0 0 1px var(--primary)}.orders-add-item{border:0;background:#e6f7f2;color:var(--primary2);border-radius:12px;padding:9px 11px;font:inherit;font-size:11px;font-weight:900;cursor:pointer}.items-editor{display:grid;gap:10px}.item-editor-card{border:1px solid #dceae6;background:#fbfdfc;border-radius:17px;padding:12px}.item-card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.item-card-header strong{font-size:12px}.remove-item{border:0;background:#fee2e2;color:#991b1b;border-radius:10px;padding:7px 10px;font:inherit;font-size:10px;font-weight:900}.remove-item:disabled{opacity:.45}.item-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 8px}.locked-delivered-item{background:#f3f7f6}.locked-delivered-item input[readonly],.locked-delivered-item textarea[readonly]{background:#edf2f1;color:#61716d}.readonly-field-value{border:1px solid #dbe8e5;background:#edf2f1;border-radius:14px;padding:11px;font-size:12px}.delivered-lock-note{background:#fff7ed;color:#9a3412;border-radius:12px;padding:9px;font-size:10px;line-height:1.6;margin-top:8px}.existing-attachments{display:grid;gap:7px;margin-top:12px}.existing-attachments>a{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e1ece9;background:#f8fbfa;border-radius:13px;padding:10px;text-decoration:none;color:var(--text)}.existing-attachments>a span{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.existing-attachments>a small{font-size:9px;color:var(--muted);flex:0 0 auto}.orders-form-actions{position:sticky;bottom:8px;z-index:30;display:grid;grid-template-columns:.72fr 1.28fr;gap:8px;padding:8px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border:1px solid #dfeae7;border-radius:18px;box-shadow:0 14px 35px rgba(8,72,60,.16);margin-top:12px}.orders-primary-button,.orders-secondary-button{min-height:46px;border:0;border-radius:14px;font:inherit;font-weight:950;display:flex;align-items:center;justify-content:center;text-decoration:none}.orders-primary-button{background:var(--primary);color:#fff}.orders-secondary-button{background:#eef4f2;color:var(--primary2)}
.order-v2-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.order-v2-title{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.order-v2-title h2{margin:0;font-size:18px}.order-v2-header p{margin:6px 0 0;color:var(--muted);font-size:11px}.order-v2-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.orders-primary-small,.orders-light-small,.orders-delivery-small{border:0;border-radius:11px;padding:9px 11px;font:inherit;font-size:10px;font-weight:900;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.orders-primary-small{background:var(--primary);color:#fff}.orders-light-small{background:#edf5f2;color:var(--primary2)}.orders-delivery-small{background:#dbeafe;color:#1d4ed8}.orders-summary-three{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:11px}.orders-summary-three>div{background:#fff;border:1px solid #e2eeeb;border-radius:17px;text-align:center;padding:13px 5px}.orders-summary-three strong{display:block;font-size:18px}.orders-summary-three span{font-size:9px;color:var(--muted)}.order-data-cells{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.order-data-cells>div{border:1px solid #e2ecea;background:#fbfdfc;border-radius:14px;padding:10px;min-width:0}.order-data-cells .full{grid-column:1/-1}.order-data-cells small{display:block;font-size:9px;color:var(--muted);margin-bottom:4px}.order-data-cells b{font-size:11px;line-height:1.7;word-break:break-word}.manufacturing-data-cell{background:#f0faf6!important}.order-items-v2{display:grid;gap:9px}.order-item-v2{border:1px solid #e0ece9;background:#fbfdfc;border-radius:17px;padding:11px}.order-item-v2-head{display:grid;grid-template-columns:34px 1fr;gap:9px;align-items:center}.order-item-v2-head>span{width:34px;height:34px;border-radius:11px;background:#e6f7f2;color:var(--primary2);display:grid;place-items:center;font-weight:950}.order-item-v2 h3{margin:0;font-size:13px}.order-item-v2 p{margin:4px 0 0;font-size:9px;color:var(--muted);line-height:1.6}.item-quantity-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}.item-quantity-strip>div{background:#f2f7f5;border-radius:10px;padding:7px;text-align:center}.item-quantity-strip small{display:block;font-size:8px;color:var(--muted)}.item-quantity-strip b{font-size:11px}.item-progress{height:5px;background:#e7efed;border-radius:999px;overflow:hidden;margin-top:8px}.item-progress i{display:block;height:100%;background:var(--primary);border-radius:999px}.item-v2-note{margin-top:8px;background:#fff7ed;color:#8b4513;border-radius:10px;padding:8px;font-size:9px;line-height:1.7}.attachments-v2{display:grid;gap:8px}.attachments-v2 article{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:stretch}.attachments-v2 article>a{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e1ece9;background:#f8fbfa;border-radius:13px;padding:10px;text-decoration:none;color:var(--text);min-width:0}.attachments-v2 a div{min-width:0}.attachments-v2 a b{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachments-v2 a small{font-size:8px;color:var(--muted)}.attachments-v2 a>span{font-size:9px;color:var(--primary2);font-weight:900}.attachments-v2 form button{height:100%;border:0;border-radius:11px;background:#fee2e2;color:#991b1b;font:inherit;font-size:9px;font-weight:900;padding:0 10px}.orders-inline-link{display:block;text-align:center;margin-top:10px;color:var(--primary2);font-size:10px;font-weight:900;text-decoration:none}.deliveries-v2{display:grid;gap:9px}.deliveries-v2 article{border:1px solid #e1ece9;background:#fbfdfc;border-radius:15px;padding:11px}.delivery-v2-head{display:flex;align-items:center;justify-content:space-between;gap:9px}.delivery-v2-head b{display:block;font-size:11px}.delivery-v2-head small{font-size:8px;color:var(--muted)}.delivery-v2-head>strong{font-size:15px}.delivery-lines-v2{display:grid;gap:4px;margin-top:8px}.delivery-lines-v2 span{font-size:9px;color:#49635e}.deliveries-v2 p{margin:8px 0 0;font-size:8px;color:var(--muted)}.orders-primary-wide{display:flex;align-items:center;justify-content:center;width:100%;min-height:42px;border-radius:13px;background:var(--primary);color:#fff;text-decoration:none;font-size:11px;font-weight:950;margin-top:10px}.order-note-form-v2{display:grid;grid-template-columns:110px 1fr auto;gap:7px;margin-bottom:12px}.order-note-form-v2 select,.order-note-form-v2 textarea{border:1px solid #dbe8e5;background:#f9fcfb;border-radius:12px;padding:9px;font:inherit;font-size:10px}.order-note-form-v2 textarea{min-height:62px;resize:vertical}.delivery-order-head{display:flex;flex-direction:column;gap:5px}.delivery-order-head strong{font-size:16px}.delivery-order-head span{font-size:10px;color:var(--muted)}.delivery-items-list{display:grid;gap:9px}.delivery-item-card{display:grid;grid-template-columns:1fr 120px;gap:10px;align-items:center;border:1px solid #e1ece9;background:#fbfdfc;border-radius:15px;padding:11px}.delivery-item-card.completed{opacity:.55}.delivery-item-card strong{display:block;font-size:11px}.delivery-item-card small{font-size:8px;color:var(--muted);line-height:1.6}.delivery-qty-field label{margin:0 0 4px;font-size:9px}.delivery-qty-field input{padding:8px}.delivery-qty-field span{display:block;font-size:7px;color:var(--muted);margin-top:3px}
.quick-order-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:10px}.quick-order-cards a{background:#fff;border:1px solid #e2ecea;border-radius:15px;padding:10px 5px;text-align:center;text-decoration:none;color:var(--text)}.quick-order-cards a.active{border-color:var(--primary);box-shadow:inset 0 0 0 1px var(--primary)}.quick-order-cards a.warn strong{color:#b45309}.quick-order-cards strong{display:block;font-size:17px}.quick-order-cards span{font-size:8px;color:var(--muted)}.order-list-toolbar form{display:grid;grid-template-columns:1fr 1fr;gap:7px}.order-list-toolbar form input{grid-column:1/-1}.order-list-toolbar form button{border:0;border-radius:12px;background:#eef5f3;color:var(--primary2);font:inherit;font-size:10px;font-weight:900}.orders-list-v2{display:grid;gap:9px}.order-list-card-v2{display:block;border:1px solid #e1ece9;background:#fbfdfc;border-radius:17px;padding:11px;color:var(--text);text-decoration:none}.order-list-card-v2.is-overdue{border-color:#fdba74;background:#fffaf5}.order-list-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.order-list-card-head b{display:block;font-size:13px}.order-list-card-head small{font-size:9px;color:var(--muted)}.order-list-card-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.order-list-card-meta span{font-size:8px;color:#536e68;background:#f0f5f3;border-radius:999px;padding:4px 6px}.order-list-qty{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.order-list-qty>div{text-align:center;background:#f1f6f4;border-radius:9px;padding:6px}.order-list-qty small{display:block;font-size:7px;color:var(--muted)}.order-list-qty b{font-size:10px}.order-list-card-foot{display:flex;align-items:center;gap:6px;margin-top:8px}.order-list-card-foot em{margin-right:auto;font-size:8px;color:var(--muted);font-style:normal}
@media(max-width:420px){.orders-app-main{padding:10px 9px 28px}.orders-card{padding:12px}.order-v2-header{flex-direction:column}.order-v2-actions{width:100%;justify-content:flex-start}.order-note-form-v2{grid-template-columns:1fr}.order-note-form-v2 .orders-primary-small{min-height:40px}.delivery-item-card{grid-template-columns:1fr}.orders-form-actions{bottom:5px}}@media(max-width:340px){.orders-form-grid,.item-form-grid,.order-data-cells{grid-template-columns:1fr}.orders-form-grid .full,.item-form-grid .full,.order-data-cells .full{grid-column:auto}.quick-order-cards{grid-template-columns:repeat(2,1fr)}.orders-summary-three{grid-template-columns:1fr}.manufacturing-template-grid{grid-template-columns:1fr}}

/* ==========================================================
   Orders reference-layout correction: embedded create form
   ========================================================== */
.embedded-order-form{scroll-margin-top:76px;padding:0;overflow:hidden}.embedded-order-form>.embedded-order-title{padding:15px 15px 10px;margin:0;border-bottom:1px solid #e6efed}.embedded-order-title>div h2{margin:0 0 3px}.embedded-order-title>div p{margin:0;font-size:9px;color:var(--muted)}.embedded-order-title>span{background:#e6f7f2;color:var(--primary2);border-radius:999px;padding:6px 9px;font-weight:900}.embedded-order-form .orders-data-form{padding:13px}.embedded-order-section{border-top:1px solid #e6efed;margin-top:14px;padding-top:14px}.embedded-order-errors{margin:12px 13px 0}.embedded-material-source{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.embedded-material-source label{margin:0;cursor:pointer}.embedded-material-source input{position:absolute;opacity:0;width:1px!important;height:1px}.embedded-material-source span{display:flex;align-items:center;justify-content:center;min-height:43px;border:1px solid #dbe8e5;border-radius:13px;background:#f8fbfa;color:#536d67;font-size:11px;font-weight:900}.embedded-material-source label.active span{border-color:var(--primary);background:#def6ef;color:var(--primary2);box-shadow:inset 0 0 0 1px var(--primary)}.embedded-upload-grid{display:grid;grid-template-columns:1fr;gap:10px}.embedded-upload-card{border:1px solid #dfeae7;background:#fbfdfc;border-radius:16px;padding:12px}.embedded-upload-button{display:flex;align-items:center;justify-content:center;min-height:42px;border-radius:13px;background:#e5f7f1;color:var(--primary2);font-size:11px;font-weight:950;cursor:pointer;margin:0}.embedded-upload-button input{position:absolute;opacity:0;width:1px!important;height:1px}.embedded-file-preview{margin-top:9px;border:1px dashed #cadbd7;border-radius:13px;padding:12px;color:var(--muted);font-size:9px;line-height:1.7;min-height:42px;word-break:break-word}.embedded-photo-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:9px}.embedded-photo-preview span,.embedded-photo-preview img{width:100%;aspect-ratio:1/1;border:1px dashed #cadbd7;border-radius:13px;background:#f4f8f7;display:grid;place-items:center;object-fit:cover;color:#8aa09b;font-size:22px}.embedded-order-actions{position:sticky;bottom:6px;z-index:30;padding-top:12px}.embedded-order-actions .orders-primary-button{width:100%;min-height:49px;box-shadow:0 12px 28px rgba(15,159,131,.24)}.order-list-toolbar{margin-top:11px}.order-list-toolbar .orders-section-title{margin-bottom:9px}
@media(min-width:430px){.embedded-upload-grid{grid-template-columns:1fr 1fr}}
@media(max-width:340px){.embedded-material-source{grid-template-columns:1fr}.embedded-photo-preview{grid-template-columns:repeat(3,1fr)}}


/* ==========================================================
   Compact order form: reduced vertical length + inline pairs
   ========================================================== */
.orders-app-page .orders-card{margin-bottom:8px}
.orders-app-page .orders-section-title{margin-bottom:7px}
.orders-app-page .orders-section-title h2{font-size:14px}
.orders-app-page .orders-data-form .field{margin:0;min-width:0}
.orders-app-page .orders-data-form label{font-size:10px;margin:5px 0 3px;line-height:1.25}
.orders-app-page .orders-data-form input,
.orders-app-page .orders-data-form select{height:39px;border-radius:11px;padding:7px 9px;font-size:11px}
.orders-app-page .orders-data-form textarea{min-height:56px;border-radius:11px;padding:8px 9px;font-size:11px;line-height:1.55}
.orders-app-page .orders-form-grid{gap:0 7px}
.orders-app-page .item-editor-card{padding:9px;border-radius:14px}
.orders-app-page .item-card-header{margin-bottom:2px}
.orders-app-page .items-editor{gap:7px}
.orders-app-page .item-form-grid{gap:0 7px}
.orders-app-page .embedded-order-form .orders-data-form{padding:10px}
.orders-app-page .embedded-order-section{margin-top:9px;padding-top:9px}
.orders-app-page .embedded-order-form>.embedded-order-title{padding:11px 12px 8px}
.orders-app-page .embedded-upload-card{padding:9px}
.orders-app-page .embedded-file-preview{margin-top:6px;padding:8px;min-height:34px}
.orders-app-page .embedded-upload-button{min-height:38px}
.orders-app-page .orders-add-item{padding:7px 9px}
.orders-app-page .compact-item-row{display:grid;grid-column:1/-1;gap:7px;margin-top:5px;min-width:0}
.orders-app-page .compact-size-row{grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)}
.orders-app-page .compact-qty-row{grid-template-columns:repeat(2,minmax(0,1fr))}
.orders-app-page .compact-inline-field{display:flex;align-items:center;gap:5px;min-width:0}
.orders-app-page .compact-inline-field>label{flex:0 0 auto;margin:0;white-space:nowrap;font-size:9px;color:var(--muted)}
.orders-app-page .compact-inline-field>input,
.orders-app-page .compact-inline-field>select,
.orders-app-page .compact-inline-field>.readonly-field-value{flex:1 1 auto;min-width:0;height:37px;margin:0;padding:7px 8px;border-radius:10px;font-size:10px}
.orders-app-page .compact-inline-field>.readonly-field-value{display:flex;align-items:center;border:1px solid #dbe8e5;background:#edf2f1}
.orders-app-page .compact-thickness-field>label{font-size:8.5px}
.orders-app-page .orders-info-note{padding:8px;margin:7px 0;font-size:9px;line-height:1.55}
.orders-app-page .embedded-order-actions{padding-top:8px}
.orders-app-page .embedded-order-actions .orders-primary-button{min-height:44px}
@media(max-width:360px){
 .orders-app-page .compact-item-row{gap:5px}
 .orders-app-page .compact-inline-field{gap:3px}
 .orders-app-page .compact-inline-field>label{font-size:8px}
 .orders-app-page .compact-inline-field>input,
 .orders-app-page .compact-inline-field>select,
 .orders-app-page .compact-inline-field>.readonly-field-value{padding:6px;font-size:9px}
}

/* ==========================================================
   Full compact order form: label beside every field
   ========================================================== */
.orders-app-page .compact-order-form .compact-order-lines,
.orders-app-page .compact-order-form .compact-item-lines{
  display:grid;
  gap:7px;
  min-width:0;
}
.orders-app-page .compact-order-form .compact-pair-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  min-width:0;
}
.orders-app-page .compact-order-form .inline-labeled-field{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}
.orders-app-page .compact-order-form .inline-labeled-field>label{
  flex:0 0 auto;
  margin:0;
  color:#48625c;
  font-size:9px;
  font-weight:900;
  line-height:1.2;
  white-space:nowrap;
}
.orders-app-page .compact-order-form .inline-labeled-field>input,
.orders-app-page .compact-order-form .inline-labeled-field>select,
.orders-app-page .compact-order-form .inline-labeled-field>textarea,
.orders-app-page .compact-order-form .inline-labeled-field>.readonly-field-value,
.orders-app-page .compact-order-form .inline-labeled-field>.status-input-wrap,
.orders-app-page .compact-order-form .inline-labeled-field>.embedded-material-source{
  flex:1 1 auto;
  min-width:0;
  width:auto;
  margin:0;
}
.orders-app-page .compact-order-form .inline-labeled-field>input,
.orders-app-page .compact-order-form .inline-labeled-field>select,
.orders-app-page .compact-order-form .inline-labeled-field>.readonly-field-value{
  height:37px;
  padding:6px 8px;
  border-radius:10px;
  font-size:10px;
}
.orders-app-page .compact-order-form .inline-labeled-field>textarea{
  min-height:54px;
  padding:7px 8px;
  border-radius:10px;
  font-size:10px;
  line-height:1.45;
}
.orders-app-page .compact-order-form .full-line{
  grid-column:1/-1;
}
.orders-app-page .compact-order-form .textarea-line{
  align-items:flex-start;
}
.orders-app-page .compact-order-form .textarea-line>label{
  padding-top:8px;
}
.orders-app-page .compact-order-form .material-source-line>.embedded-material-source{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.orders-app-page .compact-order-form .material-source-line .embedded-material-source span{
  min-height:37px;
  padding:5px 7px;
  border-radius:10px;
  font-size:10px;
}
.orders-app-page .compact-order-form .status-input-wrap{
  display:grid;
  gap:3px;
}
.orders-app-page .compact-order-form .status-input-wrap select{
  width:100%;
  height:37px;
  padding:6px 8px;
  border-radius:10px;
  font-size:10px;
}
.orders-app-page .compact-order-form .status-input-wrap .field-help{
  margin:0;
  font-size:7px;
}
.orders-app-page .compact-order-form .item-editor-card{
  padding:8px;
}
.orders-app-page .compact-order-form .item-card-header{
  margin-bottom:6px;
}
.orders-app-page .compact-order-form .manufacturing-note-section{
  padding:10px;
}
.orders-app-page .compact-order-form input[readonly]{
  background:#f0f5f3;
  color:#58716b;
}
@media(max-width:370px){
  .orders-app-page .compact-order-form .compact-pair-row{gap:5px}
  .orders-app-page .compact-order-form .inline-labeled-field{gap:3px}
  .orders-app-page .compact-order-form .inline-labeled-field>label{font-size:7.5px}
  .orders-app-page .compact-order-form .inline-labeled-field>input,
  .orders-app-page .compact-order-form .inline-labeled-field>select,
  .orders-app-page .compact-order-form .inline-labeled-field>.readonly-field-value{padding:5px;font-size:9px}
}

/* ==========================================================
   Notes fields: labels above full-width text areas
   ========================================================== */
.orders-app-page .compact-order-form .textarea-line{
  flex-direction:column;
  align-items:stretch;
  gap:3px;
}
.orders-app-page .compact-order-form .textarea-line>label{
  width:100%;
  padding-top:0;
  margin:0;
  white-space:normal;
  text-align:right;
}
.orders-app-page .compact-order-form .textarea-line>textarea{
  width:100%;
  flex:0 0 auto;
}

/* ==========================================================
   Orders quick filters: compact single-row layout
   ========================================================== */
.orders-app-page .quick-order-cards{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:4px;
  margin:0 0 7px;
  width:100%;
}
.orders-app-page .quick-order-cards a{
  min-width:0;
  min-height:47px;
  padding:5px 2px 4px;
  border-radius:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1.05;
  overflow:hidden;
}
.orders-app-page .quick-order-cards strong{
  display:block;
  margin:0 0 2px;
  font-size:14px;
  line-height:1;
}
.orders-app-page .quick-order-cards span{
  display:block;
  width:100%;
  font-size:6.5px;
  line-height:1.15;
  text-align:center;
  white-space:normal;
  overflow-wrap:anywhere;
}
@media(max-width:340px){
  .orders-app-page .quick-order-cards{
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:3px;
  }
  .orders-app-page .quick-order-cards a{
    min-height:44px;
    padding:4px 1px 3px;
    border-radius:9px;
  }
  .orders-app-page .quick-order-cards strong{font-size:13px}
  .orders-app-page .quick-order-cards span{font-size:5.8px}
}

/* ============================================================
   Customer-supplied materials calculation and receipts
   ============================================================ */
.status-awaiting_customer_materials {
  background: #fff4d6;
  color: #8a5a00;
}
.customer-materials-form-card {
  margin-top: 10px;
}
.customer-materials-form-card.hidden {
  display: none;
}
.customer-materials-form-card .orders-section-title > div,
.customer-materials-detail-card .orders-section-title > div {
  min-width: 0;
}
.customer-materials-form-card .orders-section-title p,
.customer-materials-detail-card .orders-section-title p {
  margin: 3px 0 0;
  color: #6d827e;
  font-size: 10px;
  line-height: 1.45;
}
.customer-materials-preview {
  min-height: 56px;
}
.customer-materials-placeholder {
  border: 1px dashed #bfd8d1;
  border-radius: 14px;
  padding: 12px;
  background: #f7fbfa;
  color: #667b76;
  font-size: 12px;
  text-align: center;
}
.customer-materials-placeholder.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border: 2px solid #b7d8cf;
  border-top-color: #0f9f83;
  border-radius: 50%;
  vertical-align: -2px;
  animation: customerMaterialSpin .8s linear infinite;
}
@keyframes customerMaterialSpin { to { transform: rotate(360deg); } }
.customer-materials-grid {
  display: grid;
  gap: 8px;
}
.customer-material-result,
.customer-material-requirement {
  border: 1px solid #dceae6;
  border-radius: 16px;
  background: #fbfefd;
  padding: 10px;
}
.customer-material-result-head,
.customer-material-requirement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.customer-material-result-head b,
.customer-material-requirement-head b {
  font-size: 13px;
  color: #12322d;
}
.customer-material-result-head span,
.customer-material-requirement-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dff5ef;
  color: #0b7b68;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}
.customer-material-requirement-head small {
  display: block;
  margin-top: 3px;
  color: #6d827e;
  font-size: 10.5px;
  line-height: 1.45;
}
.customer-material-result-data,
.customer-material-quantity-row,
.customer-material-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.customer-material-result-data > div,
.customer-material-quantity-row > div,
.customer-material-summary > div {
  min-width: 0;
  border-radius: 12px;
  background: #f0f7f5;
  padding: 7px 5px;
  text-align: center;
}
.customer-material-result-data small,
.customer-material-quantity-row small,
.customer-material-summary span {
  display: block;
  color: #70837f;
  font-size: 9.5px;
}
.customer-material-result-data strong,
.customer-material-quantity-row strong,
.customer-material-summary strong {
  display: block;
  margin-top: 2px;
  color: #12322d;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.customer-material-errors {
  margin-top: 8px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.55;
}
.customer-material-errors > div + div {
  margin-top: 4px;
}
.customer-material-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
}
.customer-material-status.status-awaiting_definition,
.customer-material-status.status-not_received {
  background: #fff4d6;
  color: #8a5a00;
}
.customer-material-status.status-partial {
  background: #dbeafe;
  color: #1d4ed8;
}
.customer-material-status.status-complete {
  background: #dcfce7;
  color: #166534;
}
.customer-material-requirements {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.customer-material-calculation-note {
  margin: 7px 0 0;
  color: #6d827e;
  font-size: 10px;
  line-height: 1.5;
}
.customer-material-receipt-form {
  margin-top: 12px;
  border-top: 1px solid #e4eeeb;
  padding-top: 10px;
}
.orders-section-title.compact {
  margin-bottom: 7px;
}
.orders-section-title.compact h3 {
  margin: 0;
  font-size: 13px;
}
.customer-material-receipts-list {
  margin-top: 12px;
  border-top: 1px solid #e4eeeb;
  padding-top: 10px;
}
.customer-material-receipts-list > article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #eef4f2;
}
.customer-material-receipts-list > article:last-child {
  border-bottom: 0;
}
.customer-material-receipts-list article b,
.customer-material-receipts-list article small {
  display: block;
}
.customer-material-receipts-list article b {
  font-size: 12px;
}
.customer-material-receipts-list article small {
  margin-top: 3px;
  color: #6d827e;
  font-size: 10px;
  line-height: 1.45;
}
.customer-material-receipts-list article p {
  margin: 4px 0 0;
  font-size: 10px;
  color: #475d58;
}
.customer-material-receipts-list article > strong {
  flex: 0 0 auto;
  color: #0b7b68;
  font-size: 12px;
}

/* Phase 6: unified thickness suggestions and millimetre dimensions */
.app-thickness-wrap{position:relative;display:flex;align-items:center;min-width:0;flex:1;width:100%}
.app-thickness-wrap>.app-thickness-input{width:100%;padding-left:34px}
.app-thickness-toggle{position:absolute;left:5px;top:50%;transform:translateY(-50%);z-index:3;width:27px;height:27px;border:0;border-radius:9px;background:#eaf5f2;color:#0b7b68;font-size:18px;line-height:1;display:grid;place-items:center;padding:0;margin:0}
.app-thickness-list{display:none;position:absolute;top:calc(100% + 5px);right:0;left:0;z-index:120;background:#fff;border:1px solid #d6e7e2;border-radius:13px;box-shadow:0 12px 28px rgba(7,61,51,.18);max-height:190px;overflow:auto;padding:5px}
.app-thickness-list.show{display:block}
.app-thickness-option{width:100%;border:0;border-bottom:1px solid #edf3f1;background:#fff;color:#12322d;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;margin:0;text-align:right;font:inherit}
.app-thickness-option:last-child{border-bottom:0}
.app-thickness-option:active,.app-thickness-option:hover{background:#edf8f5}
.app-thickness-option strong{font-size:13px}
.app-thickness-option span{font-size:10px;color:#6d827e}
.app-thickness-empty{padding:10px;font-size:10px;line-height:1.6;color:#6d827e;text-align:center}
.app-dimension-input,.app-thickness-input{direction:ltr;text-align:center;font-variant-numeric:tabular-nums}
.orders-app-page .compact-order-form .inline-labeled-field>.app-thickness-wrap{flex:1 1 auto;min-width:0;width:auto;margin:0}
.orders-app-page .compact-order-form .app-thickness-wrap>.app-thickness-input{height:37px;padding:6px 34px 6px 8px;border-radius:10px;font-size:10px}
@media (max-width:380px){.orders-app-page .compact-order-form .app-thickness-wrap>.app-thickness-input{height:34px;padding-top:5px;padding-bottom:5px;font-size:9px}}

/* Phase 7: compact customer-material receipt form */
.customer-material-receipt-form-v2{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #e4eeeb;
}
.customer-material-receipt-stack{
  display:grid;
  gap:8px;
}
.customer-material-receipt-field,
.customer-material-receipt-notes{
  display:grid;
  gap:5px;
  min-width:0;
}
.customer-material-receipt-field label,
.customer-material-receipt-notes label{
  color:#344d48;
  font-size:10px;
  font-weight:900;
}
.customer-material-receipt-field select,
.customer-material-receipt-inline input,
.customer-material-receipt-inline select,
.customer-material-receipt-notes textarea{
  width:100%;
  min-width:0;
  border:1px solid #d6e5e1;
  border-radius:10px;
  background:#fff;
  color:#17342f;
  font:inherit;
  outline:none;
}
.customer-material-receipt-field select{
  min-height:42px;
  padding:8px 10px;
  font-size:10px;
  line-height:1.35;
}
.customer-material-receipt-pair{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.customer-material-receipt-inline{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:6px;
  min-width:0;
}
.customer-material-receipt-inline label{
  color:#344d48;
  font-size:9px;
  font-weight:900;
  white-space:nowrap;
}
.customer-material-receipt-inline input,
.customer-material-receipt-inline select{
  height:36px;
  padding:6px 8px;
  font-size:9.5px;
}
.customer-material-received-by{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:4px 8px;
  border:1px solid #d9ebe6;
  border-radius:11px;
  background:#f2f9f7;
  padding:8px 10px;
}
.customer-material-received-by span{
  color:#59716c;
  font-size:9.5px;
  font-weight:800;
}
.customer-material-received-by strong{
  color:#0b7b68;
  font-size:11px;
  text-align:left;
  overflow-wrap:anywhere;
}
.customer-material-received-by small{
  grid-column:1/-1;
  color:#7a8e89;
  font-size:8.5px;
  line-height:1.35;
}
.customer-material-receipt-notes textarea{
  min-height:72px;
  resize:vertical;
  padding:9px 10px;
  font-size:10px;
  line-height:1.5;
}
.customer-material-receipt-form-v2 .orders-primary-wide{
  margin-top:10px;
}
@media(max-width:360px){
  .customer-material-receipt-pair{gap:5px}
  .customer-material-receipt-inline{grid-template-columns:1fr;gap:3px}
  .customer-material-receipt-inline label{font-size:8.5px}
  .customer-material-receipt-inline input,
  .customer-material-receipt-inline select{height:34px;font-size:9px}
}

/* ==========================================================
   Phase 8: global compact density across the application
   ========================================================== */
:root{
  --compact-gap:7px;
  --compact-radius:13px;
  --compact-control-height:38px;
}
.page{padding:12px}
.topbar{padding:10px 13px}
.panel,
.orders-card{
  border-radius:16px;
  padding:11px;
  margin-bottom:8px;
}
.panel h2,
.orders-section-title h2{margin-bottom:7px}
.field{margin:7px 0}
.field label{margin-bottom:3px;font-size:10px;line-height:1.25}
.field input,
.field select{
  height:var(--compact-control-height);
  border-radius:10px;
  padding:6px 9px;
  font-size:11px;
}
.field textarea{
  min-height:62px;
  border-radius:10px;
  padding:8px 9px;
  font-size:11px;
  line-height:1.5;
}
.btn{height:42px;border-radius:12px;font-size:13px}
.btn.compact{height:36px;padding:0 13px;border-radius:10px;font-size:11px}
.data-form{padding:12px}
.form-grid{gap:0 8px}
.form-actions{gap:7px;margin-top:10px}
.summary-grid,
.summary-grid.two-cols,
.summary-grid.three-cols,
.order-summary-grid{gap:6px;margin-bottom:8px}
.summary-card{
  border-radius:13px;
  padding:9px 6px;
}
.summary-card strong{font-size:18px;margin-bottom:3px}
.summary-card span{font-size:9px}
.section-heading{margin-bottom:7px}
.section-heading h2{font-size:15px}
.toolbar-panel{gap:7px}
.search-form{gap:6px}
.search-form input,
.search-form select{height:38px;border-radius:10px;padding:0 9px;font-size:11px}
.customer-list,
.order-list,
.notes-list{gap:7px}
.customer-row,
.order-row{
  gap:9px;
  border-radius:13px;
  padding:9px;
}
.customer-meta,
.customer-submeta,
.order-meta{margin-top:4px;gap:5px}
.customer-meta span,
.customer-submeta span,
.order-meta span{font-size:9px}
.details-grid{gap:6px}
.details-grid>div{border-radius:11px;padding:8px}
.details-grid span{font-size:9px;margin-bottom:3px}
.details-grid strong{font-size:11px;line-height:1.5}
.readonly-code{border-radius:11px;padding:8px 10px;margin-bottom:7px}
.note-form{gap:6px;margin-bottom:9px}
.note-form textarea{min-height:62px;border-radius:10px;padding:8px 9px;font-size:11px}
.note-card{border-radius:11px;padding:8px}
.note-card p{margin:0 0 5px;font-size:11px;line-height:1.55}
.module-grid{gap:7px}
.module-card{border-radius:13px;padding:10px}
.empty-state{padding:18px 8px;font-size:11px}
.pagination{margin-top:10px}
.pagination a{min-width:30px;height:30px;border-radius:8px;font-size:10px}
.danger-button{border-radius:10px;padding:8px 12px;font-size:11px}
@media(max-width:620px){
  .page{padding:9px}
  .topbar{padding:9px 11px}
  .panel,.orders-card{padding:9px;margin-bottom:7px}
  .data-form{padding:9px}
}

/* Free-write customer material receipt with linked suggestions */
.customer-material-free-input-wrap{position:relative;min-width:0}
.customer-material-free-input-wrap input[type="text"],
.customer-material-free-input-wrap input[list]{
  width:100%;
  min-width:0;
  height:38px;
  border:1px solid #d6e5e1;
  border-radius:10px;
  background:#fff;
  color:#17342f;
  padding:6px 9px;
  font:inherit;
  font-size:10px;
  outline:none;
}
.customer-material-free-input-wrap input:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(15,159,131,.10);
}
.customer-material-free-help{
  display:block;
  color:#6d827e;
  font-size:8.5px;
  line-height:1.45;
  margin-top:2px;
}
.customer-material-receipt-form-v2{
  margin-top:8px;
  padding-top:8px;
}
.customer-material-receipt-stack{gap:6px}
.customer-material-receipt-field,
.customer-material-receipt-notes{gap:3px}
.customer-material-receipt-pair{gap:6px}
.customer-material-receipt-inline{gap:4px}
.customer-material-receipt-inline input,
.customer-material-receipt-inline select{height:34px;padding:5px 7px}
.customer-material-received-by{padding:6px 8px;border-radius:10px}
.customer-material-receipt-notes textarea{min-height:58px;padding:7px 8px}
.customer-material-receipt-form-v2 .orders-primary-wide{margin-top:7px;min-height:40px}

/* ==========================================================
   Phase 9: compact order details + unified attachments layout
   ========================================================== */
.order-detail-page .orders-app-main{
  padding-top:9px;
}
.order-detail-page .orders-card{
  padding:9px;
  margin-bottom:7px;
  border-radius:15px;
}
.order-detail-page .orders-section-title{
  gap:7px;
  margin-bottom:7px;
}
.order-detail-page .orders-section-title h2{
  font-size:14px;
}
.order-detail-page .orders-section-title h3{
  margin:0;
  font-size:12px;
}
.order-detail-page .orders-section-title p{
  margin:2px 0 0;
  font-size:8.5px;
  line-height:1.45;
}
.order-detail-page .order-v2-header{
  align-items:center;
  gap:8px;
}
.order-detail-page .order-v2-title{
  gap:4px;
}
.order-detail-page .order-v2-title h2{
  font-size:16px;
}
.order-detail-page .order-v2-header p{
  margin-top:3px;
  font-size:9px;
  line-height:1.4;
}
.order-detail-page .order-v2-actions{
  gap:4px;
}
.order-detail-page .orders-primary-small,
.order-detail-page .orders-light-small,
.order-detail-page .orders-delivery-small{
  min-height:31px;
  padding:6px 9px;
  border-radius:9px;
  font-size:9px;
}
.order-detail-page .status-badge,
.order-detail-page .pricing-badge{
  padding:5px 8px;
  font-size:8.5px;
}
.order-detail-page .orders-summary-three{
  gap:5px;
  margin-bottom:7px;
}
.order-detail-page .orders-summary-three>div{
  border-radius:12px;
  padding:7px 4px;
}
.order-detail-page .orders-summary-three strong{
  font-size:15px;
  line-height:1.15;
}
.order-detail-page .orders-summary-three span{
  font-size:8px;
}
.order-detail-page .order-data-cells{
  gap:5px;
}
.order-detail-page .order-data-cells>div{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:5px;
  min-height:34px;
  border-radius:10px;
  padding:6px 7px;
}
.order-detail-page .order-data-cells small{
  display:inline;
  margin:0;
  font-size:8px;
  white-space:nowrap;
}
.order-detail-page .order-data-cells b{
  min-width:0;
  font-size:9.5px;
  line-height:1.45;
  text-align:left;
  overflow-wrap:anywhere;
}
.order-detail-page .order-data-cells .full{
  display:block;
  padding:7px 8px;
}
.order-detail-page .order-data-cells .full small{
  display:block;
  margin-bottom:4px;
}
.order-detail-page .order-data-cells .full b{
  display:block;
  text-align:right;
}
.order-detail-page .orders-info-note{
  margin:7px 0 0;
  border-radius:10px;
  padding:7px 8px;
  font-size:8.5px;
  line-height:1.55;
}
.order-detail-page .customer-material-summary{
  gap:5px;
  margin-bottom:6px;
}
.order-detail-page .customer-material-summary>div{
  border-radius:10px;
  padding:7px 4px;
}
.order-detail-page .customer-material-summary strong{
  font-size:14px;
}
.order-detail-page .customer-material-summary span{
  font-size:7.8px;
}
.order-detail-page .customer-material-requirements{
  gap:6px;
}
.order-detail-page .customer-material-requirement{
  border-radius:12px;
  padding:8px;
}
.order-detail-page .customer-material-requirement-head{
  gap:6px;
}
.order-detail-page .customer-material-requirement-head b{
  font-size:10.5px;
}
.order-detail-page .customer-material-requirement-head small{
  margin-top:2px;
  font-size:8px;
  line-height:1.45;
}
.order-detail-page .customer-material-requirement-head>span{
  padding:4px 7px;
  border-radius:8px;
  font-size:8px;
}
.order-detail-page .customer-material-quantity-row{
  gap:5px;
  margin-top:6px;
}
.order-detail-page .customer-material-quantity-row>div{
  border-radius:9px;
  padding:6px 3px;
}
.order-detail-page .customer-material-quantity-row small{
  font-size:7px;
}
.order-detail-page .customer-material-quantity-row strong{
  font-size:9px;
}
.order-detail-page .customer-material-calculation-note{
  margin:5px 0 0;
  font-size:7.5px;
  line-height:1.45;
}
.order-detail-page .customer-material-receipt-form-v2{
  margin-top:7px;
  padding-top:7px;
}
.order-detail-page .customer-material-receipt-stack{
  gap:5px;
}
.order-detail-page .customer-material-free-input-wrap input[type="text"],
.order-detail-page .customer-material-free-input-wrap input[list]{
  height:34px;
  font-size:9px;
}
.order-detail-page .customer-material-free-help{
  font-size:7.5px;
}
.order-detail-page .customer-material-receipt-inline input,
.order-detail-page .customer-material-receipt-inline select{
  height:32px;
  font-size:8.5px;
}
.order-detail-page .customer-material-receipt-inline label,
.order-detail-page .customer-material-receipt-field label,
.order-detail-page .customer-material-receipt-notes label{
  font-size:8.5px;
}
.order-detail-page .customer-material-received-by{
  padding:5px 7px;
}
.order-detail-page .customer-material-receipt-notes textarea{
  min-height:52px;
  font-size:9px;
}
.order-detail-page .customer-material-receipts-list{
  margin-top:7px;
}
.order-detail-page .customer-material-receipts-list article{
  padding:7px;
  border-radius:10px;
}
.order-detail-page .order-items-v2,
.order-detail-page .deliveries-v2,
.order-detail-page .notes-list{
  gap:6px;
}
.order-detail-page .order-item-v2,
.order-detail-page .deliveries-v2 article,
.order-detail-page .note-card{
  border-radius:12px;
  padding:8px;
}
.order-detail-page .order-item-v2-head{
  grid-template-columns:29px minmax(0,1fr);
  gap:6px;
}
.order-detail-page .order-item-v2-head>span{
  width:29px;
  height:29px;
  border-radius:9px;
  font-size:11px;
}
.order-detail-page .order-item-v2 h3{
  font-size:11px;
}
.order-detail-page .order-item-v2 p{
  margin-top:2px;
  font-size:8px;
}
.order-detail-page .item-quantity-strip{
  gap:4px;
  margin-top:6px;
}
.order-detail-page .item-quantity-strip>div{
  padding:5px 3px;
  border-radius:8px;
}
.order-detail-page .item-v2-note{
  margin-top:5px;
  padding:6px;
}
.order-detail-page .attachments-v2{
  gap:5px;
}
.order-detail-page .attachments-v2 article>a{
  border-radius:10px;
  padding:7px;
}
.order-detail-page .orders-inline-link{
  margin-top:7px;
}
.order-detail-page .order-note-form-v2{
  grid-template-columns:90px minmax(0,1fr) auto;
  gap:5px;
  margin-bottom:7px;
}
.order-detail-page .order-note-form-v2 select,
.order-detail-page .order-note-form-v2 textarea{
  border-radius:9px;
  padding:6px 7px;
  font-size:9px;
}
.order-detail-page .order-note-form-v2 textarea{
  min-height:44px;
}
.order-detail-page .timeline-row{
  padding-block:5px;
}
.order-detail-page .timeline-row strong{
  font-size:9px;
}
.order-detail-page .timeline-row small{
  font-size:7.5px;
}

/* Photos and files stay identical on mobile and desktop */
.orders-app-page .embedded-upload-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  align-items:stretch;
}
.orders-app-page .embedded-upload-card{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100%;
  padding:8px;
  border-radius:13px;
}
.orders-app-page .embedded-upload-card .orders-section-title{
  min-height:24px;
  gap:4px;
  margin-bottom:6px;
}
.orders-app-page .embedded-upload-card .orders-section-title h2{
  font-size:12px;
}
.orders-app-page .embedded-upload-card .orders-section-title>span{
  font-size:7.5px;
}
.orders-app-page .embedded-upload-button{
  min-height:36px;
  border-radius:10px;
  font-size:9px;
}
.orders-app-page .embedded-file-preview,
.orders-app-page .embedded-photo-preview{
  flex:1 1 auto;
  min-height:62px;
  margin-top:6px;
}
.orders-app-page .embedded-file-preview{
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  padding:7px;
  font-size:7.5px;
  text-align:center;
}
.orders-app-page .embedded-photo-preview{
  gap:4px;
}
.orders-app-page .embedded-photo-preview span,
.orders-app-page .embedded-photo-preview img{
  border-radius:10px;
  font-size:17px;
}
@media(max-width:340px){
  .orders-app-page .embedded-upload-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:5px;
  }
  .orders-app-page .embedded-upload-card{
    padding:6px;
  }
  .orders-app-page .embedded-upload-card .orders-section-title h2{
    font-size:10.5px;
  }
  .orders-app-page .embedded-upload-button{
    min-height:34px;
    font-size:8px;
  }
}

/* ==========================================================
   Phase 10: order header stays on one row on every screen
   ========================================================== */
.order-detail-page .order-v2-header-one-line{
  display:block;
  padding:8px 9px;
}
.order-detail-page .order-v2-header-one-line .order-v2-topline{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:5px;
  direction:ltr;
  width:100%;
  min-width:0;
}
.order-detail-page .order-v2-header-one-line .order-v2-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:nowrap;
  gap:4px;
  direction:rtl;
  width:auto;
  min-width:0;
}
.order-detail-page .order-v2-header-one-line .order-v2-title{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:nowrap;
  gap:4px;
  direction:rtl;
  min-width:0;
  overflow:visible;
}
.order-detail-page .order-v2-header-one-line .order-v2-title h2{
  flex:0 0 auto;
  margin:0;
  font-size:14px;
  line-height:1.15;
  white-space:nowrap;
}
.order-detail-page .order-v2-header-one-line .status-badge,
.order-detail-page .order-v2-header-one-line .pricing-badge{
  flex:0 0 auto;
  padding:4px 6px;
  border-radius:999px;
  font-size:7.5px;
  line-height:1.15;
  white-space:nowrap;
}
.order-detail-page .order-v2-header-one-line .orders-primary-small,
.order-detail-page .order-v2-header-one-line .orders-delivery-small{
  flex:0 0 auto;
  min-height:29px;
  padding:5px 8px;
  border-radius:8px;
  font-size:8.5px;
  line-height:1;
  white-space:nowrap;
}
.order-detail-page .order-v2-header-one-line .order-v2-customer-name{
  margin:3px 0 0;
  color:var(--muted);
  font-size:8px;
  line-height:1.3;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:420px){
  .order-detail-page .order-v2-header-one-line{
    display:block;
    padding:7px 8px;
  }
  .order-detail-page .order-v2-header-one-line .order-v2-topline{
    grid-template-columns:auto minmax(0,1fr);
    gap:4px;
  }
  .order-detail-page .order-v2-header-one-line .order-v2-actions{
    width:auto;
    justify-content:flex-start;
    gap:3px;
  }
  .order-detail-page .order-v2-header-one-line .order-v2-title{
    gap:3px;
  }
  .order-detail-page .order-v2-header-one-line .order-v2-title h2{
    font-size:12px;
  }
  .order-detail-page .order-v2-header-one-line .status-badge,
  .order-detail-page .order-v2-header-one-line .pricing-badge{
    padding:3px 5px;
    font-size:6.7px;
  }
  .order-detail-page .order-v2-header-one-line .orders-primary-small,
  .order-detail-page .order-v2-header-one-line .orders-delivery-small{
    min-height:27px;
    padding:5px 7px;
    font-size:7.8px;
  }
}
@media(max-width:350px){
  .order-detail-page .order-v2-header-one-line .order-v2-title h2{
    font-size:10.5px;
  }
  .order-detail-page .order-v2-header-one-line .status-badge,
  .order-detail-page .order-v2-header-one-line .pricing-badge{
    padding:3px 4px;
    font-size:6.2px;
  }
  .order-detail-page .order-v2-header-one-line .orders-primary-small,
  .order-detail-page .order-v2-header-one-line .orders-delivery-small{
    min-height:26px;
    padding:4px 6px;
    font-size:7px;
  }
}

/* ==========================================================
   Phase 11: real order pricing
   ========================================================== */
.pricing-page .orders-app-main{padding-top:9px}
.pricing-quick-cards{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:5px;
  margin-bottom:7px;
  direction:rtl;
}
.pricing-quick-cards a{
  min-width:0;
  min-height:54px;
  border:1px solid #d8e7e3;
  border-radius:12px;
  background:#fff;
  color:#17342f;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  text-decoration:none;
  padding:5px 2px;
}
.pricing-quick-cards a.active{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset;background:#f0fbf8}
.pricing-quick-cards strong{font-size:14px;line-height:1}
.pricing-quick-cards span{font-size:7.5px;line-height:1.15;text-align:center;white-space:nowrap}
.pricing-orders-list{display:grid;gap:6px}
.pricing-order-card{
  display:block;
  border:1px solid #d8e7e3;
  border-radius:13px;
  background:#fff;
  padding:9px;
  color:#17342f;
  text-decoration:none;
}
.pricing-order-head,.pricing-summary-line{display:flex;align-items:flex-start;justify-content:space-between;gap:7px}
.pricing-order-head>div,.pricing-summary-line>div{min-width:0}
.pricing-order-head b,.pricing-summary-line b{display:block;font-size:12px;line-height:1.2}
.pricing-order-head small,.pricing-summary-line small{display:block;margin-top:3px;color:var(--muted);font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-order-meta{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.pricing-order-meta span,.pricing-order-meta a{
  border-radius:999px;
  background:#f1f7f5;
  color:#526f69;
  padding:4px 7px;
  font-size:7.5px;
  text-decoration:none;
  white-space:nowrap;
}
.pricing-order-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:7px;padding-top:6px;border-top:1px solid #edf3f1}
.pricing-order-foot em{font-style:normal;color:#6d827e;font-size:8px}
.pricing-order-foot strong{font-size:10px;color:#087a65}
.pricing-order-summary{padding:9px}
.pricing-customer-material-note{margin-top:7px;padding:7px 8px;border:1px solid #bce8dc;border-radius:10px;background:#edfbf7;color:#146b5b;font-size:8px;line-height:1.5}
.pricing-mode-card{padding:9px}
.pricing-mode-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.pricing-mode-toggle label{position:relative;display:block;cursor:pointer}
.pricing-mode-toggle input{position:absolute;opacity:0;pointer-events:none}
.pricing-mode-toggle span{display:flex;align-items:center;justify-content:center;min-height:36px;border:1px solid #d3e4df;border-radius:10px;background:#fff;font-size:9px;font-weight:700;color:#496a64}
.pricing-mode-toggle label.active span{border-color:var(--primary);background:#e8f8f3;color:#087a65;box-shadow:0 0 0 1px var(--primary) inset}
.pricing-mode-hint{margin:5px 0 0;color:#718580;font-size:7.5px;line-height:1.45}
.pricing-items-list{display:grid;gap:7px}
.pricing-item-card{padding:9px;margin:0}
.pricing-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:7px;margin-bottom:7px}
.pricing-item-head>div{min-width:0}
.pricing-item-head b{display:block;font-size:10.5px;line-height:1.45}
.pricing-item-head small{display:block;margin-top:2px;color:#6d827e;font-size:7.5px;line-height:1.4;overflow-wrap:anywhere}
.pricing-item-head>span{flex:0 0 auto;border-radius:999px;background:#e9f8f3;color:#087a65;padding:4px 7px;font-size:7.5px;font-weight:700;white-space:nowrap}
.pricing-input-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.pricing-input-grid label{min-width:0;display:grid;gap:3px}
.pricing-input-grid label>span{font-size:8px;font-weight:700;color:#3f5f59}
.pricing-input-grid input,.pricing-input-grid select{
  width:100%;
  min-width:0;
  height:35px;
  border:1px solid #d5e5e1;
  border-radius:9px;
  background:#fff;
  color:#17342f;
  padding:5px 7px;
  font:inherit;
  font-size:9px;
  outline:none;
}
.pricing-input-grid input:focus,.pricing-input-grid select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(15,159,131,.10)}
.pricing-input-grid input:disabled{background:#f1f5f4;color:#80918d}
.pricing-input-grid label>small{font-size:7px;color:#859590;line-height:1}
.pricing-result-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin-top:7px}
.pricing-result-grid>div{min-width:0;border-radius:9px;background:#f2f7f5;padding:6px 3px;text-align:center}
.pricing-result-grid>div.primary{background:#e6f7f2}
.pricing-result-grid small{display:block;color:#6d827e;font-size:6.8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-result-grid b{display:block;margin-top:2px;font-size:9px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-result-grid .primary b{color:#087a65;font-size:9.5px}
.pricing-grand-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:8px;margin-top:7px}
.pricing-grand-summary>div{min-width:0;border-radius:10px;background:#f1f7f5;padding:7px 3px;text-align:center}
.pricing-grand-summary>div.primary{background:#dff5ee}
.pricing-grand-summary small{display:block;color:#6d827e;font-size:7px;white-space:nowrap}
.pricing-grand-summary b{display:block;margin-top:2px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-grand-summary .primary b{color:#087a65;font-size:11px}
.pricing-action-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:7px 0 12px}
.pricing-action{min-width:0;min-height:39px;border:0;border-radius:10px;background:#e8efed;color:#82918e;font:inherit;font-size:9px;font-weight:800;cursor:pointer}
.pricing-action.save{background:var(--primary);color:#fff}
.pricing-action.approve{background:#148f77;color:#fff}
.pricing-action.reject{background:#fce4e4;color:#b23838}
.pricing-action.edit{background:#eef4ff;color:#315f9b}
.pricing-action:disabled{cursor:not-allowed;opacity:.78}
.order-detail-page .pricing-badge[href]{text-decoration:none}
@media(max-width:360px){
  .pricing-quick-cards{gap:3px}
  .pricing-quick-cards a{min-height:49px;padding-inline:1px}
  .pricing-quick-cards strong{font-size:12px}
  .pricing-quick-cards span{font-size:6.5px}
  .pricing-input-grid{gap:4px}
  .pricing-result-grid{gap:3px}
  .pricing-result-grid small{font-size:6.1px}
  .pricing-result-grid b{font-size:8px}
  .pricing-action-row{gap:4px}
  .pricing-action{font-size:8px}
}

/* Phase 12 — customer pricing aligned with the approved reference tool */
.pricing-list-reference-page .orders-page-header h1{font-size:19px}
.pricing-reference-stats{margin-bottom:8px}
.pricing-reference-search{display:grid;grid-template-columns:38px minmax(0,1fr) 48px;gap:6px;align-items:center;margin:0 0 8px}
.pricing-reference-search .pricing-filter-icon{height:39px;border:1px solid #dce9e5;border-radius:10px;background:#fff;display:grid;place-items:center;color:#087a65;font-size:18px}
.pricing-reference-search label{height:39px;border:1px solid #d4e3df;border-radius:11px;background:#fff;display:flex;align-items:center;gap:6px;padding:0 10px;min-width:0}
.pricing-reference-search label span{color:#657c77;font-size:15px}
.pricing-reference-search input{min-width:0;width:100%;height:35px;border:0;outline:0;background:transparent;font:inherit;font-size:10px;color:#183d36}
.pricing-reference-search button{height:39px;border:0;border-radius:10px;background:var(--primary);color:#fff;font:inherit;font-size:9px;font-weight:900;cursor:pointer}
.pricing-reference-list{display:grid;gap:8px}
.pricing-reference-order-card{padding:10px;margin:0}
.pricing-reference-card-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(175px,44%);gap:8px;align-items:stretch}
.pricing-reference-order-main{min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px}
.pricing-reference-order-main>b{max-width:100%;font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-order-main>small{max-width:100%;color:#687f7a;font-size:7.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-order-main .pricing-badge{font-size:7.5px;padding:4px 7px}
.pricing-reference-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.pricing-reference-facts>div{min-width:0;border:1px solid #e2ece9;border-radius:10px;background:#fbfdfc;padding:6px 3px;text-align:center}
.pricing-reference-facts small,.pricing-reference-details small{display:block;color:#748783;font-size:6.7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-facts b,.pricing-reference-details b{display:block;margin-top:2px;color:#173d36;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-description{margin:7px 0 0;padding:0 2px 7px;border-bottom:1px solid #edf3f1;color:#5f7772;font-size:8px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-card-bottom{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:7px;align-items:end;margin-top:7px}
.pricing-reference-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.pricing-reference-details>div{min-width:0;border-left:1px solid #e7efed;padding:3px 5px;text-align:center}
.pricing-reference-details>div:last-child{border-left:0}
.pricing-reference-actions{display:grid;gap:4px}
.pricing-reference-actions a{min-height:28px;border:1px solid #d3e5df;border-radius:8px;background:#fff;color:#176f5f;text-decoration:none;display:flex;align-items:center;justify-content:center;font-size:8px;font-weight:900}
.pricing-reference-actions .pricing-reference-primary{background:#ecf8f4;border-color:#8bcfbe;color:#087a65}

.pricing-reference-form-page .orders-page-header h1{font-size:18px}
.pricing-reference-order-data{padding:9px;margin-bottom:7px}
.pricing-reference-order-data .orders-section-title{margin-bottom:6px}
.pricing-reference-order-data .orders-section-title h2{font-size:12px}
.pricing-reference-order-data .orders-section-title a{font-size:8px;color:#087a65;text-decoration:none;font-weight:800}
.pricing-reference-order-id{display:flex;align-items:center;justify-content:space-between;gap:7px;padding-bottom:6px;border-bottom:1px solid #edf3f1}
.pricing-reference-order-id b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pricing-reference-order-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-top:6px}
.pricing-reference-order-grid>div{min-width:0;border:1px solid #e1ebe8;border-radius:9px;background:#fbfdfc;min-height:34px;padding:5px 7px;display:flex;align-items:center;justify-content:space-between;gap:6px}
.pricing-reference-order-grid small{color:#738681;font-size:7px;white-space:nowrap}
.pricing-reference-order-grid b{min-width:0;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.pricing-reference-items-heading{padding:2px 4px 6px}
.pricing-reference-items-heading h2{margin:0;font-size:13px}
.pricing-reference-items-heading p{margin:3px 0 0;color:#738681;font-size:7.5px;line-height:1.45}
.pricing-reference-item-card{padding:9px}
.pricing-reference-item-card .pricing-item-head{margin-bottom:6px}
.pricing-reference-item-card .pricing-item-head b{font-size:10px}
.pricing-reference-item-card .pricing-item-status{background:#fff4da;color:#9b6400;border-radius:999px;padding:4px 7px;font-size:7px;font-weight:900;white-space:nowrap}
.pricing-item-mode-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-bottom:6px}
.pricing-item-mode-toggle label{position:relative;display:block;cursor:pointer}
.pricing-item-mode-toggle input{position:absolute;opacity:0;pointer-events:none}
.pricing-item-mode-toggle span{display:flex;align-items:center;justify-content:center;min-height:29px;border:1px solid #d3e4df;border-radius:8px;background:#fff;color:#496a64;font-size:8px;font-weight:800}
.pricing-item-mode-toggle label.active span{border-color:#159d83;background:#edf9f5;color:#087a65;box-shadow:0 0 0 1px #159d83 inset}
.pricing-item-compare-hint{margin:-1px 0 6px;color:#7b8e89;font-size:6.8px;text-align:center}
.pricing-reference-item-card .pricing-input-grid{margin-top:1px}
.pricing-item-notes{display:grid;gap:4px;margin-top:7px}
.pricing-item-notes>span{font-size:8px;font-weight:800;color:#3f5f59}
.pricing-item-notes textarea,.pricing-item-notes>div{width:100%;min-height:50px;border:1px solid #d5e5e1;border-radius:9px;background:#fbfdfc;padding:8px 9px;font:inherit;font-size:8px;line-height:1.55;color:#385d55;resize:vertical;box-sizing:border-box}
.pricing-item-notes>div{min-height:34px}

@media (max-width:390px){
  .pricing-reference-search{grid-template-columns:34px minmax(0,1fr) 42px;gap:4px}
  .pricing-reference-search label{padding-inline:7px}
  .pricing-reference-search input{font-size:8.5px}
  .pricing-reference-card-top{grid-template-columns:minmax(0,1fr) minmax(145px,45%);gap:5px}
  .pricing-reference-facts{gap:3px}
  .pricing-reference-facts>div{padding-inline:1px}
  .pricing-reference-card-bottom{grid-template-columns:minmax(0,1fr) 78px;gap:5px}
  .pricing-reference-actions a{font-size:7px}
  .pricing-reference-order-grid>div{padding-inline:5px}
  .pricing-reference-order-grid small{font-size:6.4px}
  .pricing-reference-order-grid b{font-size:7.7px}
}

/* ==========================================================
   Phase 13: deterministic app navigation + compact back button
   ========================================================== */
.orders-page-header.has-back h1{
  right:64px;
}
.orders-back{
  position:absolute;
  right:18px;
  top:50%;
  transform:translateY(-50%);
  width:38px;
  height:38px;
  border-radius:13px;
  background:#eef3f2;
  color:#111;
  text-decoration:none;
  display:grid;
  place-items:center;
  font-size:19px;
  line-height:1;
  font-weight:900;
}
.orders-back:active,.orders-close:active{transform:translateY(-50%) scale(.96)}
.app-topbar-nav{
  min-height:58px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  gap:8px;
  padding:10px 14px;
}
.app-topbar-nav>b{
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.app-topbar-nav .legacy-back,
.app-topbar-nav .legacy-close{
  width:36px;
  height:36px;
  border-radius:11px;
  background:rgba(255,255,255,.16);
  color:#fff;
  display:grid;
  place-items:center;
  text-decoration:none;
  font-size:19px;
  font-weight:900;
}
.app-topbar-nav .legacy-close{font-size:23px}
.app-topbar-nav .top-actions{
  grid-column:3;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
}
.app-topbar-nav .top-actions .legacy-close{flex:0 0 auto}
.app-topbar-nav .top-actions .inline-form{display:none}
.pricing-reference-item-card .pricing-item-status.priced{
  background:#e4f7ef;
  color:#087a65;
}
.pricing-reference-item-card .pricing-item-status.pending{
  background:#fff4da;
  color:#9b6400;
}
@media(max-width:360px){
  .orders-page-header.has-back h1{right:58px;font-size:17px}
  .orders-back,.orders-close{width:34px;height:34px;border-radius:11px}
  .orders-back{right:14px}
  .orders-close{left:14px}
}
.app-topbar-nav>b{grid-column:2;grid-row:1}
.app-topbar-nav>.legacy-back{grid-column:1;grid-row:1}
.app-topbar-nav>.legacy-close{grid-column:3;grid-row:1}
.auth-page-close{position:fixed;top:14px;left:14px;z-index:50;width:38px;height:38px;border-radius:13px;background:#fff;color:#111;box-shadow:0 8px 24px rgba(15,85,72,.12);display:grid;place-items:center;text-decoration:none;font-size:24px;line-height:1}


/* ==========================================================
   Phase 15: partial pricing state, locked saved items, aligned grids
   ========================================================== */
.pricing-badge.pricing-partial,
.pricing-item-status.partial{
  background:#fff0cf;
  color:#9a6200;
}
.pricing-input-grid label{
  grid-template-rows:auto 34px 10px;
  align-items:stretch;
}
.pricing-input-grid input,
.pricing-input-grid select{
  width:100%;
  height:34px;
  min-height:34px;
  box-sizing:border-box;
}
.pricing-input-grid label>small{
  min-height:10px;
  display:block;
}
.pricing-input-grid.locked input:disabled,
.pricing-input-grid.locked select:disabled{
  opacity:1;
  background:#f1f5f4;
  color:#405e58;
  -webkit-text-fill-color:#405e58;
}
.pricing-grand-summary{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:4px;
}
.pricing-grand-summary>div{
  padding-inline:2px;
}
.pricing-grand-summary small{
  font-size:6.5px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pricing-grand-summary b{
  font-size:9px;
}
.pricing-action:disabled{
  background:#edf2f1;
  color:#9aa8a5;
  opacity:1;
  cursor:not-allowed;
}
@media(max-width:360px){
  .pricing-grand-summary{gap:3px;padding-inline:5px}
  .pricing-grand-summary>div{padding:6px 1px}
  .pricing-grand-summary small{font-size:5.8px}
  .pricing-grand-summary b{font-size:8px}
}

/* ==========================================================
   Phase 16: pricing approval fix, unified pricing/material states
   ========================================================== */
.customer-material-list-status{
  max-width:44%;
  white-space:normal;
  text-align:center;
  line-height:1.25;
}
.customer-material-list-status.material-waiting{
  background:#fff3d5;
  color:#9a6200;
}
.customer-material-list-status.material-partial{
  background:#eaf3ff;
  color:#245f9d;
}
.customer-material-list-status.material-complete{
  background:#dcf6eb;
  color:#087a65;
}
.order-customer-material-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
  margin-top:7px;
  padding:6px;
  border-radius:10px;
  background:#f4f8f7;
}
.order-customer-material-summary span{
  min-width:0;
  text-align:center;
  color:#6d827e;
  font-size:7px;
  white-space:nowrap;
}
.order-customer-material-summary b{
  color:#183b35;
  font-size:9px;
}
.order-price-summary{
  min-width:0;
  max-width:48%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  border-radius:999px;
  padding:4px 7px;
  background:#e5f6f0;
  color:#087a65;
  font-size:8px;
  font-weight:800;
}
.order-v2-price{
  direction:ltr;
  white-space:nowrap;
  border-radius:999px;
  padding:4px 7px;
  background:#e5f6f0;
  color:#087a65;
  font-size:8px;
  font-weight:900;
}
.pricing-reference-order-main>b[dir="ltr"]{
  unicode-bidi:isolate;
}
.pricing-reference-details>div:last-child b{
  direction:rtl;
  unicode-bidi:plaintext;
}
@media(max-width:360px){
  .order-price-summary{max-width:43%;font-size:7px;padding-inline:5px}
  .customer-material-list-status{max-width:48%;font-size:7px}
  .order-v2-price{font-size:7px;padding-inline:5px}
}

/* Phase 17 — independent factory purchases */
.purchases-page .orders-app-main{gap:8px}
.purchase-quick-cards{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.purchase-quick-cards a{min-width:0;padding:7px 2px;border:1px solid #dbe9e5;border-radius:12px;background:#fff;text-align:center;text-decoration:none;color:#23423b}
.purchase-quick-cards a.active{border-color:#2da88d;box-shadow:inset 0 0 0 1px #2da88d}
.purchase-quick-cards strong,.purchase-quick-cards span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.purchase-quick-cards strong{font-size:15px}.purchase-quick-cards span{font-size:9px;color:#70847e}
.purchase-create-card,.purchase-details-card,.purchase-offers-card,.purchase-approval-card,.purchase-receive-card,.purchase-receipts-card,.purchase-files-card,.purchase-history-card,.purchase-material-summary{padding:10px}
.purchase-independent-note{margin:0 0 8px;padding:7px 9px;border-radius:10px;background:#ecfaf6;color:#46736a;font-size:11px}
.purchase-compact-form{display:grid;gap:7px}
.purchase-inline-row{display:grid;gap:7px}.purchase-inline-row.two{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-inline-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.purchase-compact-form label{min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:5px;margin:0}
.purchase-compact-form label>span{font-size:10px;font-weight:700;white-space:nowrap;color:#344e48}
.purchase-compact-form input,.purchase-compact-form select{min-width:0;height:36px;padding:6px 8px;border-radius:9px}
.purchase-compact-form textarea{min-height:62px;padding:8px;border-radius:10px}
.purchase-compact-form .purchase-full-field,.purchase-compact-form .notes{grid-template-columns:1fr;align-items:stretch}
.purchase-compact-form .purchase-full-field>span,.purchase-compact-form .notes>span{display:block}
.purchase-search-row{display:grid;grid-template-columns:minmax(0,1fr) 62px;gap:6px;padding:8px;background:#fff;border:1px solid #dceae6;border-radius:14px}
.purchase-search-row input,.purchase-search-row button{height:36px;border-radius:9px}
.purchase-list-section{display:grid;gap:7px}.purchase-list-card{display:block;padding:10px;text-decoration:none;color:inherit}
.purchase-card-head,.purchase-offer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.purchase-card-head div,.purchase-offer-head div{min-width:0}.purchase-card-head b,.purchase-card-head small,.purchase-offer-head b,.purchase-offer-head small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.purchase-status{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}.purchase-status.wait{background:#fff2c9;color:#8b5d00}.purchase-status.approval{background:#e7f1ff;color:#235ea8}.purchase-status.approved{background:#e5f6ef;color:#16705c}.purchase-status.partial{background:#f4e9ff;color:#7150a0}.purchase-status.done{background:#dff7e9;color:#207546}.purchase-status.reject{background:#ffe6e6;color:#a22d2d}
.purchase-card-tags{display:flex;gap:4px;flex-wrap:wrap;margin:6px 0}.purchase-card-tags span,.soft-badge{padding:3px 7px;border-radius:999px;background:#eff6f4;color:#55726b;font-size:9px}
.purchase-card-metrics,.purchase-offer-metrics,.purchase-detail-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.purchase-card-metrics>div,.purchase-offer-metrics>div,.purchase-detail-grid>div{min-width:0;padding:7px 4px;border-radius:9px;background:#f2f7f5;text-align:center}.purchase-card-metrics small,.purchase-offer-metrics small,.purchase-detail-grid small{display:block;font-size:8px;color:#7b8c87}.purchase-card-metrics b,.purchase-offer-metrics b,.purchase-detail-grid b{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.purchase-card-foot{display:flex;justify-content:space-between;gap:8px;margin-top:6px;font-size:9px;color:#667b75}.purchase-card-foot span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.purchase-offer-card{padding:9px;margin-top:7px;border:1px solid #dce9e5;border-radius:12px}.purchase-offer-card.selected{border-color:#2da88d;background:#f2fcf8}.purchase-offer-head span{padding:3px 7px;border-radius:999px;background:#dff5ed;color:#1f7560;font-size:9px}.purchase-offer-notes{margin:6px 0;font-size:10px;color:#657a74}.purchase-offer-actions{display:flex;align-items:center;gap:6px;margin-top:6px}.purchase-offer-actions a,.purchase-offer-actions button{height:30px;padding:5px 9px;border-radius:8px;font-size:9px}
.purchase-card-metrics.four{grid-template-columns:repeat(5,minmax(0,1fr))}.purchase-action-row{display:grid;gap:6px}.purchase-action-row.two{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-action-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}.purchase-action-row form{margin:0}.purchase-action-row button{width:100%;height:36px}
.purchase-current-user{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-radius:9px;background:#edf8f4;font-size:10px}.purchase-current-user b{color:#16705c}
.purchase-receipt-row,.purchase-history-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 2px;border-bottom:1px solid #edf2f0}.purchase-receipt-row>div,.purchase-history-row>div{min-width:0}.purchase-receipt-row b,.purchase-receipt-row small,.purchase-history-row b,.purchase-history-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.purchase-receipt-row b,.purchase-history-row b{font-size:10px}.purchase-receipt-row small,.purchase-history-row small,.purchase-history-row time{font-size:8px;color:#7c8c87}.purchase-receipt-row.damaged{background:#fff3f3}.purchase-files-list{display:grid;gap:5px}.purchase-files-list a{padding:8px;border-radius:9px;background:#f3f8f6;text-decoration:none;color:inherit}.purchase-files-list b,.purchase-files-list small{display:block;font-size:10px}.purchase-files-list small{font-size:8px;color:#7b8d87}
.purchase-notes-block{margin-top:7px;padding:8px;border-radius:9px;background:#f4f8f7}.purchase-notes-block small{font-size:9px}.purchase-notes-block p{margin:4px 0 0;font-size:10px}.purchase-cancel-form{margin:0}.purchase-cancel-form button{width:100%}
.module-card em{display:block;margin-top:5px;font-style:normal;font-size:10px;color:#2b8d77}
@media (max-width:430px){.purchase-quick-cards{gap:3px}.purchase-quick-cards a{padding:6px 1px}.purchase-quick-cards span{font-size:8px}.purchase-inline-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}.purchase-card-metrics,.purchase-offer-metrics,.purchase-detail-grid{gap:3px}.purchase-card-metrics>div,.purchase-offer-metrics>div,.purchase-detail-grid>div{padding:6px 2px}.purchase-card-metrics b,.purchase-offer-metrics b,.purchase-detail-grid b{font-size:9px}}

.purchase-card-metrics.five{grid-template-columns:repeat(5,minmax(0,1fr))}
.purchase-view-top{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:6px}
.purchase-view-top>div{min-width:0}.purchase-view-top b,.purchase-view-top small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.purchase-edit-button{height:30px;padding:6px 10px;border-radius:8px;background:#2da88d;color:#fff;text-decoration:none;font-size:10px;font-weight:700}

/* ==========================================================
   Phase 18: unified compact purchase UI
   Matches the approved orders/pricing field system
   ========================================================== */
.purchases-page .orders-app-shell{max-width:520px}
.purchases-page .orders-app-main{gap:7px;padding-inline:8px}
.purchases-page .orders-card{border-radius:14px}
.purchases-page .purchase-create-card{padding:9px}
.purchases-page .purchase-create-card .section-title-row{margin-bottom:4px}
.purchases-page .purchase-create-card .section-title-row h2{font-size:19px;line-height:1.15;margin:0}
.purchases-page .purchase-independent-note{margin:0 0 6px;padding:6px 8px;font-size:9px;line-height:1.45}

.purchases-page .purchase-form-unified{display:grid;gap:5px}
.purchases-page .purchase-form-unified .purchase-inline-row{gap:5px}
.purchases-page .purchase-form-unified label{
  min-width:0;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:5px;
  margin:0;
}
.purchases-page .purchase-form-unified label>span{
  font-size:8px;
  font-weight:800;
  color:#39514c;
  white-space:nowrap;
}
.purchases-page .purchase-form-unified input:not([type="file"]),
.purchases-page .purchase-form-unified select{
  width:100%;
  min-width:0;
  height:34px;
  min-height:34px;
  padding:5px 8px;
  border:1px solid #cfe0dc;
  border-radius:9px;
  background:#fff;
  color:#173c35;
  font-size:10px;
  box-sizing:border-box;
}
.purchases-page .purchase-form-unified textarea{
  width:100%;
  min-height:56px;
  padding:7px 8px;
  border:1px solid #cfe0dc;
  border-radius:10px;
  background:#fff;
  font-size:10px;
  box-sizing:border-box;
  resize:vertical;
}
.purchases-page .purchase-form-unified .purchase-full-field,
.purchases-page .purchase-form-unified .notes{
  grid-template-columns:1fr;
  gap:3px;
}
.purchases-page .purchase-form-unified .purchase-full-field>span,
.purchases-page .purchase-form-unified .notes>span{display:block}

.purchases-page .purchase-upload-card{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:5px !important;
  padding:8px;
  border:1px solid #d4e4e0;
  border-radius:12px;
  background:#fff;
}
.purchases-page .purchase-upload-title{font-size:9px !important;font-weight:800}
.purchases-page .purchase-upload-button{
  position:relative;
  display:grid !important;
  place-items:center;
  height:34px;
  overflow:hidden;
  border-radius:9px;
  background:#e2f6ef;
  color:#08725f !important;
  font-size:10px !important;
  font-weight:900 !important;
  cursor:pointer;
}
.purchases-page .purchase-file-input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}
.purchases-page .purchase-file-name{
  display:block !important;
  min-height:26px;
  padding:6px 7px;
  border:1px dashed #c9ddd8;
  border-radius:8px;
  color:#71847f !important;
  text-align:center;
  font-size:8px !important;
  white-space:normal !important;
}
.purchases-page .purchase-submit-button{
  width:100%;
  height:38px;
  border:0;
  border-radius:10px;
  background:#32a58a;
  color:#fff;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}
.purchases-page .purchase-submit-button:active{transform:scale(.99)}

.purchases-page .purchase-search-row{
  grid-template-columns:minmax(0,1fr) 54px;
  gap:5px;
  padding:6px;
  border-radius:12px;
}
.purchases-page .purchase-search-row input,
.purchases-page .purchase-search-row button{
  height:34px;
  min-height:34px;
  border-radius:9px;
  font-size:9px;
}
.purchases-page .purchase-search-row button{
  border:1px solid #2da88d;
  background:#fff;
  color:#08725f;
  font-weight:800;
}
.purchases-page .purchase-list-section h2{margin:4px 0 0;font-size:18px}

.purchases-page .purchase-quick-cards a{padding-block:6px}
.purchases-page .purchase-quick-cards strong{font-size:13px}
.purchases-page .purchase-quick-cards span{font-size:7px}

@media (min-width:700px){
  .purchases-page .orders-app-shell{max-width:520px;margin-inline:auto}
}
@media (max-width:360px){
  .purchases-page .purchase-form-unified label>span{font-size:7.3px}
  .purchases-page .purchase-form-unified input:not([type="file"]),
  .purchases-page .purchase-form-unified select{font-size:9px;padding-inline:6px}
  .purchases-page .purchase-create-card .section-title-row h2{font-size:17px}
}

/* Phase 20 — factory purchase workflow aligned with the approved tool */
.purchases-page .purchase-card-metrics.three,
.purchases-page .purchase-offer-metrics.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.purchases-page .purchase-offer-metrics.five{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.purchases-page .purchase-offer-metrics.five>div{padding:6px 2px}
.purchases-page .purchase-offer-metrics.five small{font-size:7px}
.purchases-page .purchase-offer-metrics.five b{font-size:8.5px}
.purchases-page .purchase-detail-grid .wide{grid-column:span 2}
.purchases-page .purchase-inline-single{grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important}
.purchases-page .purchase-inline-single>span{display:block!important}
.purchases-page .purchase-offer-price-row input:disabled,
.purchases-page #offer-manual-total:disabled{background:#eef4f2;color:#8a9a95;opacity:.78}
.purchases-page .purchase-approved-note{margin-top:7px;padding:7px 9px;border-radius:9px;background:#eaf8f3;color:#356b5f;font-size:9px;text-align:center}
.purchases-page .purchase-receive-form{margin-top:8px;padding-top:8px;border-top:1px solid #e4eeeb}
.purchases-page .purchase-cancel-form{display:grid;gap:7px;padding:9px}
.purchases-page .purchase-cancel-form label{display:grid;gap:4px}
.purchases-page .purchase-cancel-form label>span{font-size:9px;font-weight:800;color:#8c3434}
.purchases-page .purchase-cancel-form textarea{min-height:54px;padding:8px;border:1px solid #ebcaca;border-radius:9px;resize:vertical}
.purchases-page .purchase-cancel-form .danger-wide{height:36px;border:0;border-radius:9px;background:#e25858;color:#fff;font-weight:800}
.purchases-page .purchase-cancel-reason{margin-top:7px;padding:8px;border:1px solid #f0cdcd;border-radius:9px;background:#fff4f4}
.purchases-page .purchase-cancel-reason b{font-size:9px;color:#9e3434}
.purchases-page .purchase-cancel-reason p{margin:4px 0;font-size:10px}
.purchases-page .purchase-cancel-reason small{font-size:8px;color:#8b7777}
.purchases-page .purchase-offer-actions{flex-wrap:wrap}
.purchases-page .purchase-offer-actions form{margin:0}
.purchases-page .purchase-offer-actions button:disabled{opacity:.6}
.purchases-page .purchase-files-card,
.purchases-page .purchase-history-card,
.purchases-page .purchase-receipts-card,
.purchases-page .purchase-offers-card,
.purchases-page .purchase-approval-card,
.purchases-page .purchase-details-card{margin-top:7px}
.purchases-page .purchase-offers-card .empty-state,
.purchases-page .purchase-receipts-card .empty-state{padding:12px 4px;font-size:9px}
.purchases-page .purchase-history-row time{white-space:nowrap}
.purchases-page .purchase-material-summary .purchase-card-metrics.three>div{padding-block:6px}

@media (max-width:430px){
  .purchases-page .purchase-offer-metrics.five{gap:3px}
  .purchases-page .purchase-offer-metrics.five>div{padding:5px 1px}
  .purchases-page .purchase-offer-metrics.five small{font-size:6.5px}
  .purchases-page .purchase-offer-metrics.five b{font-size:7.8px}
  .purchases-page .purchase-detail-grid .wide{grid-column:span 2}
}

/* ==========================================================
   Phase 21: one visual system for all operational pages
   The purchase workflow now uses the exact approved orders/pricing
   control colors, heights, row spacing and card density.
   ========================================================== */
:root{
  --app-ui-gap:7px;
  --app-ui-control-height:37px;
  --app-ui-control-radius:10px;
  --app-ui-card-radius:14px;
  --app-ui-card-padding:9px;
  --app-ui-field-bg:#f9fcfb;
  --app-ui-field-border:#dbe8e5;
  --app-ui-field-text:#17342f;
  --app-ui-label:#48625c;
  --app-ui-soft-bg:#f2f7f5;
}

/* Unified vertical rhythm for every mobile operational page. */
.orders-app-page .orders-app-main{
  display:grid;
  gap:var(--app-ui-gap);
  padding:9px 9px 34px;
}
.orders-app-page .orders-app-main>.orders-card,
.orders-app-page .orders-app-main>form.orders-card,
.orders-app-page .orders-app-main>section,
.orders-app-page .orders-app-main>.alert{
  margin-top:0;
  margin-bottom:0;
}
.orders-app-page .orders-card,
.orders-app-page .panel{
  padding:var(--app-ui-card-padding);
  border-radius:var(--app-ui-card-radius);
}
.orders-app-page .section-title-row,
.orders-app-page .orders-section-title,
.orders-app-page .section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  margin:0 0 7px;
  min-height:22px;
}
.orders-app-page .section-title-row h2,
.orders-app-page .orders-section-title h2,
.orders-app-page .section-heading h2{
  margin:0;
  font-size:15px;
  line-height:1.25;
}
.orders-app-page .section-title-row>span,
.orders-app-page .orders-section-title>span,
.orders-app-page .section-heading>span{
  font-size:9px;
  color:var(--muted);
}

/* One field appearance throughout orders, pricing and purchases. */
.orders-app-page input:not([type="hidden"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.orders-app-page select{
  min-width:0;
  height:var(--app-ui-control-height);
  min-height:var(--app-ui-control-height);
  border:1px solid var(--app-ui-field-border);
  border-radius:var(--app-ui-control-radius);
  background:var(--app-ui-field-bg);
  color:var(--app-ui-field-text);
  padding:6px 8px;
  font:inherit;
  font-size:10px;
  outline:none;
  box-shadow:none;
}
.orders-app-page textarea{
  min-width:0;
  min-height:56px;
  border:1px solid var(--app-ui-field-border);
  border-radius:var(--app-ui-control-radius);
  background:var(--app-ui-field-bg);
  color:var(--app-ui-field-text);
  padding:7px 8px;
  font:inherit;
  font-size:10px;
  line-height:1.5;
  outline:none;
  resize:vertical;
  box-shadow:none;
}
.orders-app-page input:not([type="hidden"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus,
.orders-app-page select:focus,
.orders-app-page textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(15,159,131,.09);
}
.orders-app-page input:disabled,
.orders-app-page select:disabled,
.orders-app-page textarea:disabled,
.orders-app-page input[readonly],
.orders-app-page textarea[readonly]{
  opacity:1;
  background:#edf2f1;
  color:#58716b;
  -webkit-text-fill-color:#58716b;
}

/* Unified labels and row gaps. */
.orders-app-page .field,
.orders-app-page .purchase-compact-form label,
.orders-app-page .pricing-input-grid label{
  margin:0;
}
.orders-app-page .field label,
.orders-app-page .purchase-compact-form label>span,
.orders-app-page .pricing-input-grid label>span{
  color:var(--app-ui-label);
  font-size:9px;
  font-weight:800;
  line-height:1.25;
}
.orders-app-page .purchase-compact-form,
.orders-app-page .purchase-form-unified,
.orders-app-page .compact-order-lines,
.orders-app-page .compact-item-lines,
.orders-app-page .pricing-items-list,
.orders-app-page .items-editor{
  gap:var(--app-ui-gap);
}
.orders-app-page .purchase-inline-row,
.orders-app-page .compact-pair-row,
.orders-app-page .pricing-input-grid,
.orders-app-page .form-grid,
.orders-app-page .orders-form-grid,
.orders-app-page .item-form-grid{
  gap:var(--app-ui-gap);
}

/* Purchase forms no longer use a separate visual language. */
.purchases-page .purchase-form-unified{gap:var(--app-ui-gap)}
.purchases-page .purchase-form-unified .purchase-inline-row{gap:var(--app-ui-gap)}
.purchases-page .purchase-form-unified label{
  gap:5px;
}
.purchases-page .purchase-form-unified label>span{
  font-size:9px;
  color:var(--app-ui-label);
}
.purchases-page .purchase-form-unified input:not([type="file"]),
.purchases-page .purchase-form-unified select{
  height:var(--app-ui-control-height);
  min-height:var(--app-ui-control-height);
  padding:6px 8px;
  border:1px solid var(--app-ui-field-border);
  border-radius:var(--app-ui-control-radius);
  background:var(--app-ui-field-bg);
  color:var(--app-ui-field-text);
  font-size:10px;
}
.purchases-page .purchase-form-unified textarea{
  min-height:56px;
  padding:7px 8px;
  border:1px solid var(--app-ui-field-border);
  border-radius:var(--app-ui-control-radius);
  background:var(--app-ui-field-bg);
  color:var(--app-ui-field-text);
  font-size:10px;
}
.purchases-page .purchase-create-card .section-title-row h2{
  font-size:15px;
  line-height:1.25;
}
.purchases-page .purchase-independent-note{
  margin:0 0 7px;
  padding:7px 8px;
  border-radius:10px;
  font-size:9px;
  line-height:1.5;
}
.purchases-page .purchase-upload-card{
  gap:7px!important;
  padding:8px;
  border-color:var(--app-ui-field-border);
  border-radius:11px;
  background:#fbfdfc;
}
.purchases-page .purchase-upload-button{
  height:var(--app-ui-control-height);
  border-radius:var(--app-ui-control-radius);
  background:#e5f7f1;
  color:var(--primary2)!important;
}
.purchases-page .purchase-file-name{
  min-height:28px;
  padding:6px 7px;
  border-color:#cadbd7;
  border-radius:9px;
  background:#f8fbfa;
}

/* Eliminate browser-default buttons in the purchase workflow. */
.purchases-page .purchase-submit-button,
.purchases-page .primary-button,
.purchases-page .secondary-button,
.purchases-page .purchase-offer-actions button,
.purchases-page .purchase-offer-actions a,
.purchases-page .small-primary-link,
.purchases-page .purchase-edit-button{
  min-height:37px;
  border:0;
  border-radius:10px;
  padding:6px 10px;
  font:inherit;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.purchases-page .purchase-submit-button,
.purchases-page .primary-button,
.purchases-page .small-primary-link,
.purchases-page .purchase-edit-button{
  background:var(--primary);
  color:#fff;
}
.purchases-page .secondary-button,
.purchases-page .purchase-offer-actions button,
.purchases-page .purchase-offer-actions a{
  background:#eef4f2;
  color:var(--primary2);
}
.purchases-page .purchase-submit-button{
  width:100%;
  height:42px;
}
.purchases-page .purchase-action-row button{
  width:100%;
  height:42px;
}
.purchases-page .purchase-offer-actions button,
.purchases-page .purchase-offer-actions a{
  min-height:32px;
  height:32px;
  padding:5px 9px;
  font-size:9px;
}
.purchases-page .small-primary-link{
  min-height:30px;
  height:30px;
  padding:5px 9px;
  font-size:9px;
}
.purchases-page .purchase-offer-actions button:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* Unified metric cells, list rows and section separation. */
.purchases-page .purchase-card-metrics>div,
.purchases-page .purchase-offer-metrics>div,
.purchases-page .purchase-detail-grid>div,
.pricing-result-grid>div,
.item-quantity-strip>div{
  background:var(--app-ui-soft-bg);
  border-radius:9px;
}
.purchases-page .purchase-details-card,
.purchases-page .purchase-offers-card,
.purchases-page .purchase-approval-card,
.purchases-page .purchase-receipts-card,
.purchases-page .purchase-files-card,
.purchases-page .purchase-history-card{
  margin-top:0;
}
.purchases-page .purchase-receive-form{
  margin-top:7px;
  padding-top:7px;
}
.purchases-page .purchase-receipt-row,
.purchases-page .purchase-history-row{
  min-height:44px;
  padding:7px 2px;
}
.purchases-page .purchase-history-row b,
.purchases-page .purchase-receipt-row b{font-size:10px;line-height:1.45}
.purchases-page .purchase-history-row small,
.purchases-page .purchase-history-row time,
.purchases-page .purchase-receipt-row small{font-size:8px;line-height:1.4}
.purchases-page .purchase-search-row{
  gap:var(--app-ui-gap);
  padding:7px;
  border-radius:12px;
}
.purchases-page .purchase-search-row input,
.purchases-page .purchase-search-row button{
  height:var(--app-ui-control-height);
  min-height:var(--app-ui-control-height);
}
.purchases-page .purchase-list-section{
  display:grid;
  gap:var(--app-ui-gap);
}
.purchases-page .purchase-list-section h2{
  margin:0;
  font-size:15px;
  line-height:1.25;
}

@media(max-width:370px){
  :root{--app-ui-gap:5px;--app-ui-control-height:35px}
  .orders-app-page .orders-app-main{padding-inline:8px}
  .orders-app-page .section-title-row h2,
  .orders-app-page .orders-section-title h2,
  .orders-app-page .section-heading h2,
  .purchases-page .purchase-create-card .section-title-row h2{font-size:14px}
  .orders-app-page .field label,
  .orders-app-page .purchase-compact-form label>span,
  .orders-app-page .pricing-input-grid label>span{font-size:8px}
}

/* Phase 22: purchase request header, supplier offer actions and bidirectional supplier pricing. */
.purchases-page .purchase-view-header-v2{
  padding:10px;
}
.purchases-page .purchase-view-header-v2 .purchase-view-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.purchases-page .purchase-view-number{
  min-width:0;
  direction:ltr;
  font-size:15px;
  line-height:1.25;
  font-weight:900;
  color:#102f28;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.purchases-page .purchase-view-top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  flex:0 0 auto;
}
.purchases-page .purchase-view-header-v2 .purchase-edit-button{
  min-height:30px;
  height:30px;
  padding:5px 9px;
}
.purchases-page .purchase-view-header-v2 .purchase-status{
  max-width:150px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.purchases-page .purchase-offer-head{
  align-items:center;
}
.purchases-page .purchase-offer-supplier{
  flex:1 1 auto;
  min-width:0;
}
.purchases-page .purchase-offer-head-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  flex:0 0 auto;
}
.purchases-page .purchase-offer-head-actions form{
  margin:0;
}
.purchases-page .purchase-offer-head-actions a,
.purchases-page .purchase-offer-head-actions button{
  min-height:30px;
  height:30px;
  border:0;
  border-radius:8px;
  padding:5px 8px;
  background:#eef4f2;
  color:var(--primary2);
  font:inherit;
  font-size:9px;
  font-weight:900;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  white-space:nowrap;
}
.purchases-page .purchase-offer-head-actions button:disabled{
  opacity:.55;
  cursor:not-allowed;
}
.purchases-page .purchase-offer-selected-label{
  padding:3px 6px;
  border-radius:999px;
  background:#dff5ed;
  color:#1f7560;
  font-size:8px;
  font-weight:800;
  white-space:nowrap;
}
.purchases-page .purchase-offer-attachment-count{
  margin-top:5px;
  color:#70847e;
  font-size:8px;
}

.purchases-page .purchase-material-summary-v2 .purchase-material-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.purchases-page .purchase-material-summary-v2 .purchase-material-title h2{
  margin:0;
  direction:ltr;
  font-size:16px;
  line-height:1.2;
  font-weight:900;
  color:#102f28;
}
.purchases-page .purchase-material-summary-v2 .purchase-material-title span{
  color:#657a74;
  font-size:9px;
  font-weight:800;
}
.purchases-page .purchase-total-field input{
  font-weight:800;
}
.purchases-page .purchase-calculation-note{
  margin-top:-1px;
  padding:7px 8px;
  border-radius:9px;
  background:#f3f8f6;
  color:#61766f;
  font-size:8px;
  line-height:1.5;
}

@media(max-width:430px){
  .purchases-page .purchase-view-number{font-size:14px}
  .purchases-page .purchase-view-header-v2 .purchase-status{max-width:118px;font-size:8px}
  .purchases-page .purchase-offer-head{align-items:flex-start}
  .purchases-page .purchase-offer-head-actions{gap:4px}
  .purchases-page .purchase-offer-head-actions a,
  .purchases-page .purchase-offer-head-actions button{height:29px;min-height:29px;padding:4px 7px;font-size:8px}
  .purchases-page .purchase-offer-selected-label{display:none}
}

/* Phase 23 — multiple purchase items, unified compact layout. */
.purchases-page .purchase-material-summary-v2 .purchase-material-label{
  color:#102f28;
  font-size:14px;
  line-height:1.2;
  font-weight:900;
}
.purchases-page .purchase-items-editor,
.purchases-page .purchase-offer-items-editor,
.purchases-page .purchase-request-items-view{
  display:grid;
  gap:8px;
}
.purchases-page .purchase-request-item,
.purchases-page .purchase-offer-item-editor,
.purchases-page .purchase-request-item-view{
  border:1px solid #d8e6e2;
  border-radius:12px;
  background:#fbfdfc;
  padding:8px;
}
.purchases-page .purchase-item-head,
.purchases-page .purchase-offer-item-title,
.purchases-page .purchase-item-view-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.purchases-page .purchase-item-head b,
.purchases-page .purchase-offer-item-title b,
.purchases-page .purchase-item-view-head b{
  color:#123a31;
  font-size:11px;
  line-height:1.35;
  font-weight:900;
}
.purchases-page .purchase-offer-item-title small,
.purchases-page .purchase-item-view-head span{
  color:#697f78;
  font-size:8px;
  font-weight:800;
}
.purchases-page .purchase-remove-item{
  min-height:26px;
  height:26px;
  border:0;
  border-radius:8px;
  padding:3px 9px;
  background:#fff0f0;
  color:#b53c3c;
  font-size:8px;
  font-weight:900;
}
.purchases-page .purchase-add-item-button{
  width:100%;
  height:34px;
  border:1px dashed #42aa91;
  border-radius:10px;
  background:#edf9f5;
  color:#16725d;
  font:inherit;
  font-size:10px;
  font-weight:900;
}
.purchases-page .purchase-inline-field{
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  align-items:center;
  gap:7px;
}
.purchases-page .purchase-inline-field>span{
  white-space:nowrap;
}
.purchases-page .supplier-inline{
  grid-template-columns:78px minmax(0,1fr);
}
.purchases-page .purchase-offer-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--app-ui-gap);
}
.purchases-page .purchase-offer-summary-grid .purchase-inline-field{
  grid-template-columns:max-content minmax(0,1fr);
}
.purchases-page .purchase-inline-row.one{grid-template-columns:minmax(0,1fr)}
.purchases-page .purchase-offer-item-editor .item-total-inline{
  margin-top:5px;
}
.purchases-page .purchase-request-item-view{
  padding:8px 9px;
}
.purchases-page .purchase-item-receipt-mini{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  margin-top:6px;
}
.purchases-page .purchase-item-receipt-mini span{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:28px;
  border-radius:8px;
  background:#f0f5f3;
  color:#687b75;
  font-size:8px;
}
.purchases-page .purchase-item-receipt-mini b{
  color:#133a32;
  font-size:9px;
}
.purchases-page .purchase-item-note{
  display:block;
  margin-top:5px;
  color:#6d817b;
  font-size:8px;
}
.purchases-page .purchase-offer-item-list{
  display:grid;
  gap:4px;
  margin-top:7px;
}
.purchases-page .purchase-offer-item-row{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(68px,.7fr);
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:6px 7px;
  border-radius:9px;
  background:#f2f7f5;
}
.purchases-page .purchase-offer-item-row div{min-width:0}
.purchases-page .purchase-offer-item-row b,
.purchases-page .purchase-offer-item-row strong{
  color:#173d34;
  font-size:9px;
  font-weight:900;
}
.purchases-page .purchase-offer-item-row small,
.purchases-page .purchase-offer-item-row span{
  display:block;
  color:#687d76;
  font-size:8px;
}
.purchases-page .purchase-offer-item-row strong{text-align:left}
.purchases-page .purchase-offer-totals{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  margin-top:6px;
}
.purchases-page .purchase-offer-totals span{
  display:grid;
  place-items:center;
  min-height:38px;
  padding:5px 3px;
  border-radius:9px;
  background:#edf5f2;
  color:#637870;
  font-size:8px;
  text-align:center;
}
.purchases-page .purchase-offer-totals b{
  color:#123b32;
  font-size:9px;
}
.purchases-page .purchase-receipt-items-status{
  display:grid;
  gap:5px;
  margin-bottom:8px;
}
.purchases-page .purchase-receipt-items-status>div{
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,.7fr);
  align-items:center;
  gap:5px;
  padding:7px 8px;
  border-radius:9px;
  background:#f1f6f4;
}
.purchases-page .purchase-receipt-items-status b{font-size:9px;color:#173c33}
.purchases-page .purchase-receipt-items-status span,
.purchases-page .purchase-receipt-items-status small{font-size:8px;color:#657b74}

@media(max-width:430px){
  .purchases-page .purchase-material-summary-v2 .purchase-material-label{font-size:13px}
  .purchases-page .purchase-offer-item-row{grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr) minmax(58px,.65fr);gap:3px;padding:6px 5px}
  .purchases-page .purchase-offer-totals{gap:3px}
  .purchases-page .purchase-offer-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  .purchases-page .purchase-offer-summary-grid .purchase-inline-field{grid-template-columns:1fr;gap:4px}
  .purchases-page .supplier-inline{grid-template-columns:72px minmax(0,1fr)}
}

/* ==========================================================
   Phase 24: restore the approved unified purchase-page rhythm
   and improve purchase-list supplier offer summaries.
   ========================================================== */
.purchases-page .purchase-items-editor,
.purchases-page .purchase-offer-items-editor,
.purchases-page .purchase-request-items-view{
  gap:var(--app-ui-gap);
}
.purchases-page .purchase-request-item,
.purchases-page .purchase-offer-item-editor,
.purchases-page .purchase-request-item-view{
  padding:var(--app-ui-card-padding);
  border:1px solid var(--app-ui-field-border);
  border-radius:var(--app-ui-card-radius);
  background:#fff;
}
.purchases-page .purchase-item-head,
.purchases-page .purchase-offer-item-title,
.purchases-page .purchase-item-view-head{
  gap:var(--app-ui-gap);
  margin-bottom:var(--app-ui-gap);
}
.purchases-page .purchase-add-item-button{
  height:var(--app-ui-control-height);
  min-height:var(--app-ui-control-height);
  border:1px dashed var(--primary);
  border-radius:var(--app-ui-control-radius);
  background:#fff;
  color:var(--primary2);
}
.purchases-page .purchase-meta-row{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--app-ui-gap);
}
.purchases-page .purchase-form-unified .purchase-meta-row>label{
  display:grid;
  grid-template-columns:1fr;
  align-items:stretch;
  gap:4px;
}
.purchases-page .purchase-form-unified .purchase-meta-row>label>span{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Keep thickness suggestions without the isolated green square button. */
.purchases-page .app-thickness-wrap>.app-thickness-input{
  padding-left:29px;
}
.purchases-page .app-thickness-toggle{
  left:7px;
  width:18px;
  height:18px;
  border:0;
  border-radius:0;
  background:transparent;
  color:#6d817b;
  font-size:13px;
  line-height:1;
}
.purchases-page .app-thickness-toggle:focus{
  outline:0;
  box-shadow:none;
}
.purchases-page .purchase-list-offers{
  display:grid;
  gap:4px;
  margin-top:6px;
}
.purchases-page .purchase-list-offer{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:6px;
  min-width:0;
  padding:6px 7px;
  border:1px solid var(--app-ui-field-border);
  border-radius:9px;
  background:var(--app-ui-soft-bg);
}
.purchases-page .purchase-list-offer>div{
  min-width:0;
}
.purchases-page .purchase-list-offer b,
.purchases-page .purchase-list-offer small{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.purchases-page .purchase-list-offer b{
  color:#173d34;
  font-size:9px;
  font-weight:900;
}
.purchases-page .purchase-list-offer small{
  margin-top:2px;
  color:#6f817c;
  font-size:7px;
}
.purchases-page .purchase-list-offer strong{
  direction:ltr;
  color:#153b33;
  font-size:9px;
  font-weight:900;
  white-space:nowrap;
}
.purchases-page .purchase-list-offer em{
  padding:3px 6px;
  border-radius:999px;
  background:#dff5ed;
  color:#1f7560;
  font-size:7px;
  font-style:normal;
  font-weight:900;
  white-space:nowrap;
}
.purchases-page .purchase-list-offer.selected{
  border-color:#9fd9cb;
  background:#eefaf6;
}
@media(max-width:390px){
  .purchases-page .purchase-meta-row{gap:5px}
  .purchases-page .purchase-form-unified .purchase-meta-row>label>span{font-size:8px}
  .purchases-page .purchase-list-offer{grid-template-columns:minmax(0,1fr) auto;gap:4px;padding:6px}
  .purchases-page .purchase-list-offer em{grid-column:1/-1;justify-self:start}
}


/* ==========================================================
   Phase 25: fixed application-wide form rhythm and dropdowns
   - One spacing rule for operational forms
   - One dropdown arrow for every select
   - Purchase item rows can never collapse into each other
   ========================================================== */
.orders-app-page{
  --app-ui-gap:7px;
  --app-ui-row-gap:8px;
  --app-ui-control-height:37px;
  --app-ui-card-padding:9px;
}

/* The same black chevron is used for every real dropdown. */
.orders-app-page select{
  -webkit-appearance:none;
  appearance:none;
  background-color:var(--app-ui-field-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23173832' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:left 9px center;
  background-size:12px 8px;
  padding-left:30px !important;
}
.orders-app-page select:disabled{
  background-color:#edf2f1;
}

/* Thickness suggestions use the exact same chevron language as selects. */
.orders-app-page .app-thickness-wrap>.app-thickness-input{
  padding-left:30px !important;
}
.orders-app-page .app-thickness-toggle{
  left:6px;
  top:50%;
  width:22px;
  height:22px;
  transform:translateY(-50%);
  border:0;
  border-radius:0;
  padding:0;
  margin:0;
  background-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23173832' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:center;
  background-size:12px 8px;
  color:transparent;
  font-size:0;
  box-shadow:none;
}
.orders-app-page .app-thickness-toggle:focus,
.orders-app-page .app-thickness-toggle:active{
  outline:0;
  background-color:transparent;
  box-shadow:none;
}

/* Every operational form has a stable vertical rhythm. */
.orders-app-page .purchase-form-unified,
.orders-app-page .purchase-compact-form,
.orders-app-page .compact-order-form,
.orders-app-page .pricing-input-grid,
.orders-app-page .items-editor{
  row-gap:var(--app-ui-row-gap);
}
.orders-app-page .purchase-inline-row,
.orders-app-page .compact-pair-row,
.orders-app-page .form-grid,
.orders-app-page .orders-form-grid,
.orders-app-page .item-form-grid{
  column-gap:var(--app-ui-gap);
  row-gap:var(--app-ui-row-gap);
}

/* Purchase item card: header + three data rows + notes are separated. */
.purchases-page .purchase-request-item{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  row-gap:var(--app-ui-row-gap);
  padding:10px;
}
.purchases-page .purchase-request-item>.purchase-item-head{
  margin:0;
}
.purchases-page .purchase-request-item>.purchase-inline-row,
.purchases-page .purchase-request-item>.purchase-full-field{
  margin:0;
}
.purchases-page .purchase-request-item .purchase-inline-row>label{
  min-height:var(--app-ui-control-height);
}
.purchases-page .purchase-request-item .purchase-full-field{
  margin-top:1px;
}

/* Meta selectors stay on one aligned row and follow the same spacing. */
.purchases-page .purchase-meta-row{
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:var(--app-ui-gap);
  row-gap:var(--app-ui-row-gap);
}
.purchases-page .purchase-form-unified .purchase-meta-row>label{
  gap:4px;
}

/* Supplier summaries remain compact but visually separated from metrics. */
.purchases-page .purchase-list-offers{
  margin-top:7px;
  row-gap:5px;
}
.purchases-page .purchase-list-offer{
  min-height:36px;
}

@media(max-width:430px){
  .orders-app-page{
    --app-ui-gap:6px;
    --app-ui-row-gap:7px;
    --app-ui-control-height:35px;
  }
  .purchases-page .purchase-request-item{padding:9px}
  .orders-app-page select{
    background-position:left 8px center;
    padding-left:28px !important;
  }
}

/* ==========================================================
   Phase 28: restore the approved purchase details / offer cards
   while keeping multi-item data only.
   ========================================================== */
.purchases-page .purchase-view-agreed{
  padding:9px;
}
.purchases-page .purchase-view-agreed .purchase-view-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.purchases-page .purchase-view-agreed .purchase-view-number{
  color:#102f28;
  font-size:15px;
  line-height:1.15;
  font-weight:900;
  white-space:nowrap;
}
.purchases-page .purchase-view-top-actions{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

/* Keep the original details card structure; only item rows repeat. */
.purchases-page .purchase-details-agreed{
  padding:10px;
}
.purchases-page .purchase-agreed-items{
  display:grid;
  gap:0;
  margin-top:2px;
}
.purchases-page .purchase-agreed-item{
  padding:8px 0;
  border-bottom:1px solid #e6efec;
}
.purchases-page .purchase-agreed-item:first-child{
  padding-top:3px;
}
.purchases-page .purchase-agreed-item:last-child{
  padding-bottom:7px;
  border-bottom:0;
}
.purchases-page .purchase-agreed-item-title,
.purchases-page .purchase-agreed-offer-item-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
  margin-bottom:6px;
}
.purchases-page .purchase-agreed-item-title b,
.purchases-page .purchase-agreed-offer-item-title b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#123a31;
  font-size:10px;
  line-height:1.35;
  font-weight:900;
}
.purchases-page .purchase-agreed-item-title span,
.purchases-page .purchase-agreed-offer-item-title span{
  color:#647a73;
  font-size:8px;
  line-height:1.35;
  font-weight:800;
  white-space:nowrap;
}
.purchases-page .purchase-agreed-item-grid{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:5px;
}
.purchases-page .purchase-agreed-item-note{
  margin-top:6px;
  padding:7px 8px;
  border-radius:9px;
  background:var(--app-ui-soft-bg);
}
.purchases-page .purchase-agreed-item-note small{
  display:block;
  color:#738680;
  font-size:8px;
  font-weight:800;
}
.purchases-page .purchase-agreed-item-note p{
  margin:3px 0 0;
  color:#314d46;
  font-size:9px;
  line-height:1.5;
}
.purchases-page .purchase-order-meta-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid #e6efec;
}
.purchases-page .purchase-order-meta-grid .wide{
  grid-column:span 2;
}

/* Restore the agreed supplier card; repeat only the item pricing block. */
.purchases-page .purchase-offers-agreed .purchase-offer-card{
  padding:9px;
  margin-top:7px;
}
.purchases-page .purchase-offers-agreed .purchase-offer-head{
  align-items:flex-start;
  gap:8px;
  margin-bottom:7px;
}
.purchases-page .purchase-offers-agreed .purchase-offer-supplier{
  flex:1 1 auto;
  min-width:0;
}
.purchases-page .purchase-offers-agreed .purchase-offer-head-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
  margin:0;
}
.purchases-page .purchase-offers-agreed .purchase-offer-head-actions form{
  margin:0;
}
.purchases-page .purchase-offers-agreed .purchase-offer-head-actions a,
.purchases-page .purchase-offers-agreed .purchase-offer-head-actions button{
  min-height:29px;
  height:29px;
  padding:4px 8px;
  border-radius:8px;
  font-size:8px;
  line-height:1;
  white-space:nowrap;
}
.purchases-page .purchase-agreed-offer-items{
  display:grid;
  gap:7px;
}
.purchases-page .purchase-agreed-offer-item{
  padding-top:7px;
  border-top:1px solid #e6efec;
}
.purchases-page .purchase-agreed-offer-item:first-child{
  padding-top:0;
  border-top:0;
}
.purchases-page .purchase-agreed-offer-item .purchase-offer-metrics.five{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:4px;
}
.purchases-page .purchase-agreed-offer-item .purchase-offer-metrics>div{
  padding:6px 2px;
}
.purchases-page .purchase-offer-tax-summary{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid #e6efec;
}
.purchases-page .purchase-offer-attachment-count{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  margin-top:6px;
  padding:4px 7px;
  border-radius:999px;
  background:#edf7f4;
  color:#427067;
  font-size:8px;
  font-weight:800;
}

/* Purchase list cards: fixed number position and stable line rhythm. */
.purchases-page .purchase-list-section-agreed{
  gap:7px;
}
.purchases-page .purchase-list-card-agreed{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  row-gap:7px;
  padding:9px;
}
.purchases-page .purchase-list-card-agreed .purchase-list-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  min-width:0;
  margin:0;
}
.purchases-page .purchase-list-card-title{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  row-gap:3px;
  text-align:right;
}
.purchases-page .purchase-list-card-title .purchase-list-number{
  display:block;
  color:#102f28;
  font-size:15px;
  line-height:1.15;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.purchases-page .purchase-list-card-title small{
  display:block;
  min-width:0;
  color:#314d46;
  font-size:9px;
  line-height:1.45;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.purchases-page .purchase-list-card-agreed .purchase-card-metrics,
.purchases-page .purchase-list-card-agreed .purchase-list-offers,
.purchases-page .purchase-list-card-agreed .purchase-card-foot{
  margin-top:0;
}
.purchases-page .purchase-list-card-agreed .purchase-card-foot{
  min-height:15px;
  align-items:center;
  line-height:1.35;
}
.purchases-page .purchase-list-card-agreed .purchase-list-offer{
  min-height:36px;
}

@media(max-width:430px){
  .purchases-page .purchase-agreed-item-grid{
    gap:4px;
  }
  .purchases-page .purchase-agreed-item-grid>div{
    padding:6px 2px;
  }
  .purchases-page .purchase-agreed-offer-item .purchase-offer-metrics.five{
    gap:3px;
  }
  .purchases-page .purchase-agreed-offer-item .purchase-offer-metrics small{
    font-size:7px;
  }
  .purchases-page .purchase-agreed-offer-item .purchase-offer-metrics b{
    font-size:8px;
  }
  .purchases-page .purchase-list-card-title .purchase-list-number{
    font-size:14px;
  }
}

/* Allow the material summary to occupy up to two clean lines without touching the request number. */
.purchases-page .purchase-list-card-title small{
  white-space:normal;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  max-height:2.9em;
}

/* Phase 30 — lightweight purchase receipt/payment integration. */
.purchase-receive-simple,
.purchase-payment-form {
  margin-top: 10px;
  gap: 8px;
}
.purchase-receive-simple .purchase-inline-row,
.purchase-payment-form .purchase-inline-row {
  row-gap: 8px;
}
.purchase-payments-card .purchase-payment-summary {
  margin-top: 8px;
}
.purchase-payment-upload {
  min-height: 46px;
}
.purchase-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--app-border, #d9e2e8);
}
.purchase-payment-row:first-of-type {
  margin-top: 8px;
}
.purchase-payment-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.purchase-payment-row > div:last-child {
  text-align: left;
  flex: 0 0 auto;
}
.purchase-payment-row b {
  font-size: 13px;
}
.purchase-payment-row small {
  font-size: 11px;
  color: var(--app-muted, #667780);
}
.purchase-list-payment-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 6px 8px;
  border-radius: 9px;
  background: #f4f8f6;
  border: 1px solid #dce8e1;
  font-size: 11px;
  color: #52645a;
}
.purchase-list-payment-line b {
  color: #173f2d;
  font-size: 12px;
}
.finance-quick-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.finance-quick-cards > div {
  min-width: 0;
  min-height: 58px;
  padding: 8px 5px;
  border: 1px solid var(--app-border, #d9e2e8);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  text-align: center;
}
.finance-quick-cards > div strong {
  font-size: 13px;
  line-height: 1.2;
  color: #173f2d;
}
.finance-quick-cards > div span {
  font-size: 10px;
  line-height: 1.2;
  color: var(--app-muted, #667780);
}
.finance-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
  color: inherit;
  text-decoration: none;
}
.finance-list-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.finance-list-row > div:nth-child(2) {
  text-align: left;
}
.finance-list-row b {
  font-size: 13px;
}
.finance-list-row small {
  color: var(--app-muted, #667780);
  font-size: 11px;
}
.finance-list-row p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
  color: var(--app-muted, #667780);
}
.finance-list-row em {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 10px;
  font-style: normal;
  color: #2d6d4d;
}
.finance-source-link {
  grid-column: 1 / -1;
  justify-self: start;
  font-size: 11px;
  font-weight: 700;
  color: #226845;
  text-decoration: none;
}
@media (max-width: 520px) {
  .finance-quick-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .finance-quick-cards > div {
    min-height: 54px;
    padding-inline: 3px;
  }
  .finance-quick-cards > div strong {
    font-size: 11px;
  }
  .finance-quick-cards > div span {
    font-size: 9px;
  }
  .purchase-payment-row {
    align-items: flex-start;
  }
  .purchase-payment-row > div:last-child {
    max-width: 38%;
  }
}

/* Phase 31 — unified expenses page. */
.expenses-page .expense-page-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;
}
.expenses-page .expense-page-head h2{margin:0;color:#12322d;font-size:17px;font-weight:900}
.expenses-page .expense-page-head p{margin:3px 0 0;color:#6d827e;font-size:10px;line-height:1.45}
.expenses-page .expense-add-button{
  min-height:38px;padding:0 12px;border-radius:11px;background:#2fa589;color:#fff;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;white-space:nowrap;
}
.expenses-page .expense-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-bottom:8px}
.expenses-page .expense-summary-grid a{
  min-width:0;min-height:58px;padding:7px 3px;border:1px solid #dbe8e3;border-radius:12px;background:#fff;
  text-decoration:none;text-align:center;display:grid;place-content:center;gap:3px;color:inherit;
}
.expenses-page .expense-summary-grid strong{font-size:12px;line-height:1.2;color:#123c30;white-space:nowrap}
.expenses-page .expense-summary-grid span{font-size:9px;color:#6b7e78;line-height:1.2}
.expenses-page .expense-search-row{display:grid;grid-template-columns:minmax(0,1fr) 58px;gap:6px;margin-bottom:7px}
.expenses-page .expense-search-row input,.expenses-page .expense-search-row button{height:38px;border-radius:10px}
.expenses-page .expense-search-row input{border:1px solid #d8e5e0;background:#fff;padding:0 10px;font-size:11px}
.expenses-page .expense-search-row button{border:1px solid #2fa589;background:#fff;color:#15735f;font-size:10px;font-weight:900}
.expenses-page .expense-filter-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin-bottom:8px}
.expenses-page .expense-filter-tabs a{
  min-height:32px;border:1px solid #dce8e3;border-radius:10px;background:#fff;color:#506860;text-decoration:none;
  display:flex;align-items:center;justify-content:center;text-align:center;font-size:9px;font-weight:900;padding:3px;
}
.expenses-page .expense-filter-tabs a.active{background:#147b68;border-color:#147b68;color:#fff}
.expenses-page .expense-list-section{gap:7px}
.expenses-page .expense-list-card{display:grid;gap:7px;padding:9px}
.expenses-page .expense-list-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}
.expenses-page .expense-list-main h3{margin:0 0 3px;color:#102f28;font-size:13px;line-height:1.35;font-weight:900}
.expenses-page .expense-list-main p{margin:0;color:#6b7d77;font-size:9px;line-height:1.4}
.expenses-page .expense-list-amount{text-align:left;white-space:nowrap}
.expenses-page .expense-list-amount b{display:block;color:#11765f;font-size:13px}
.expenses-page .expense-list-amount span{display:block;margin-top:3px;color:#75857f;font-size:8px}
.expenses-page .expense-list-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.expenses-page .expense-list-meta span{
  min-width:0;padding:6px 3px;border-radius:8px;background:#f1f7f4;color:#314d46;text-align:center;
  font-size:8px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.expenses-page .expense-due-line{padding:6px 8px;border-radius:8px;background:#fff7ed;color:#a85b13;font-size:9px;font-weight:900}
.expenses-page .expense-prepaid-line{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:6px 8px;border-radius:8px;background:#eef8f4;color:#176f5e;font-size:8.5px;font-weight:900}
.expenses-page .expense-prepaid-line span{padding-inline-end:5px;border-inline-end:1px solid #cfe7de}.expenses-page .expense-prepaid-line span:last-child{border-inline-end:0;padding-inline-end:0}
.expenses-page .expense-notes{margin:0;padding-top:6px;border-top:1px solid #edf3f0;color:#61756e;font-size:9px;line-height:1.55}
.expenses-page .expense-card-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:6px;border-top:1px solid #edf3f0}
.expenses-page .expense-source-links,.expenses-page .expense-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.expenses-page .expense-source-links a,.expenses-page .expense-actions a,.expenses-page .expense-actions button{
  min-height:28px;padding:0 8px;border:1px solid #d7e5df;border-radius:8px;background:#fff;color:#16745f;
  text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font-size:8px;font-weight:900;
}
.expenses-page .expense-actions form{margin:0}
.expenses-page .expense-actions button{color:#b63b3b;border-color:#efd1d1;cursor:pointer}
.expenses-page .expense-auto-badge{padding:5px 7px;border-radius:999px;background:#e7f5ef;color:#1d735e;font-size:8px;font-weight:900}
.expense-form-overlay{position:fixed;inset:0;z-index:1200;background:rgba(15,40,34,.28);display:flex;align-items:flex-end;justify-content:center;padding:8px}
.expense-form-panel{width:min(520px,100%);max-height:94vh;overflow:auto;background:#f7fbf9;border:1px solid #d6e6df;border-radius:18px 18px 12px 12px;padding:10px;box-shadow:0 16px 40px rgba(14,55,45,.18)}
.expense-form-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.expense-form-header h2{margin:0;font-size:18px;color:#102f28}
.expense-form-header a{width:34px;height:34px;border-radius:10px;background:#eef4f2;color:#173b32;text-decoration:none;display:grid;place-items:center;font-size:22px}
.expense-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.expense-field{display:grid;gap:4px;min-width:0}
.expense-field.full,.expense-upload.full,.expense-form-responsible.full,.expense-form-actions.full{grid-column:1/-1}
.expense-field span,.expense-upload>span:first-child{font-size:9px;font-weight:900;color:#314d46}
.expense-field input,.expense-field select,.expense-field textarea{
  width:100%;min-width:0;border:1px solid #d7e4df;border-radius:10px;background:#fff;color:#17362e;font-size:11px;padding:0 9px;outline:none;
}
.expense-field input,.expense-field select{height:38px}
.expense-field textarea{min-height:64px;padding-top:8px;line-height:1.5;resize:vertical}
.expense-field.hidden,.expense-prepaid-row.hidden{display:none}
.expense-prepaid-row{grid-column:1/-1;display:grid;grid-template-columns:82px minmax(0,1fr) minmax(0,1fr);gap:7px;align-items:end}
.expense-prepaid-row input[readonly]{background:#f1f6f4;color:#526a62}
.expense-upload{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:7px;padding:8px;border:1px solid #d7e5df;border-radius:11px;background:#fff}
.expense-upload-button{position:relative;min-height:34px;padding:0 10px;border-radius:9px;background:#e7f5ef;color:#16745f;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:900;overflow:hidden}
.expense-upload-button input{position:absolute;inset:0;opacity:0;cursor:pointer}
.expense-upload-name{min-width:0;color:#74847e;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.expense-form-responsible{padding:6px 8px;border-radius:9px;background:#f0f6f3;color:#536a62;font-size:9px}
.expense-form-actions{display:grid;grid-template-columns:1.25fr 1fr;gap:7px;margin-top:2px}
.expense-form-actions button,.expense-form-actions a{height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;text-decoration:none}
.expense-form-actions button{border:0;background:#2fa589;color:#fff}
.expense-form-actions a{border:1px solid #d4e2dd;background:#fff;color:#16745f}
@media(max-width:430px){
  .expenses-page .expense-page-head h2{font-size:16px}
  .expenses-page .expense-summary-grid{gap:4px}
  .expenses-page .expense-summary-grid a{min-height:54px}
  .expenses-page .expense-summary-grid strong{font-size:10.5px}
  .expenses-page .expense-filter-tabs{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
  .expense-form-grid{gap:6px}
  .expense-prepaid-row{grid-template-columns:72px minmax(0,1fr) minmax(0,1fr);gap:5px}
}

/* Phase 34 — order financial closing, collections and receivables aging. */
.orders-finance-small{
  min-height:30px;padding:0 9px;border-radius:9px;background:#1f8a70;color:#fff;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;font-size:9px;font-weight:900;white-space:nowrap;
}
.orders-finance-small.completed{background:#e7f5ef;color:#176b57;border:1px solid #cfe7dc}
.order-finance-strip{
  display:grid;grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(0,1fr)) auto;align-items:center;gap:6px;
  padding:8px 9px;background:#f8fcfa;border-color:#d7e9e1;
}
.order-finance-strip>div{min-width:0;display:grid;gap:2px}
.order-finance-strip small{font-size:8px;color:#71837d}
.order-finance-strip b{font-size:10px;color:#173f33;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-finance-strip .warning b{color:#b66b1d}
.order-finance-strip>a{min-height:30px;padding:0 9px;border-radius:9px;background:#e7f5ef;color:#16745f;text-decoration:none;display:flex;align-items:center;justify-content:center;font-size:8px;font-weight:900}
.order-finance-ready{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px}
.order-finance-ready>div{display:grid;gap:2px}
.order-finance-ready b{font-size:11px;color:#173f33}
.order-finance-ready small{font-size:8px;color:#6b7e78}
.order-finance-ready a{min-height:32px;padding:0 10px;border-radius:9px;background:#2fa589;color:#fff;text-decoration:none;display:flex;align-items:center;font-size:9px;font-weight:900;white-space:nowrap}

.finance-order-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px}
.finance-order-head h2{margin:0;color:#12372d;font-size:16px}
.finance-order-head p{margin:3px 0 0;color:#6a7f78;font-size:9px}
.finance-order-head>strong{font-size:14px;color:#14745f;white-space:nowrap}
.finance-readonly-total{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;margin:7px 0;border-radius:10px;background:#eef7f3}
.finance-readonly-total span{font-size:9px;color:#587068;font-weight:800}
.finance-readonly-total b{font-size:13px;color:#14745f}
.finance-form-grid{gap:7px}
.finance-auto-note,.finance-closure-note{margin-top:7px;padding:7px 8px;border-radius:9px;background:#f2f7f5;color:#60736d;font-size:8.5px;line-height:1.5}
.finance-blocked-card h2{margin:0 0 5px;color:#173c31;font-size:15px}
.finance-blocked-card p{margin:0 0 8px;color:#687b75;font-size:10px}
.finance-close-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin-bottom:8px}
.finance-close-summary>div{min-width:0;min-height:58px;padding:6px 3px;border:1px solid #d8e7e1;border-radius:11px;background:#fff;display:grid;place-content:center;text-align:center;gap:3px}
.finance-close-summary strong{font-size:11px;color:#173f33;line-height:1.25;overflow-wrap:anywhere}
.finance-close-summary span{font-size:8px;color:#6d8079}
.finance-close-summary .warning{background:#fff8ee;border-color:#f0dcc1}
.finance-close-summary .warning strong{color:#ad641e}
.finance-collection-list{display:grid;gap:7px}
.finance-collection-list article{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:8px;border:1px solid #e1ebe7;border-radius:10px;background:#fff}
.finance-collection-list article>div{display:grid;gap:2px;min-width:0}
.finance-collection-list b{font-size:11px;color:#14745f}
.finance-collection-list small,.finance-collection-list span{font-size:8px;color:#6d8079}
.finance-collection-list p{grid-column:1/-1;margin:0;padding-top:4px;border-top:1px solid #eef3f1;font-size:8px;color:#60736d}

.customer-finance-summary{margin-top:-2px}
.customer-finance-summary .summary-card strong{font-size:12px}

.aging-reference-page{display:grid;gap:0;min-width:0;overflow-x:hidden;padding-inline:5px}
.customer-aging-switch{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 10px}
.customer-aging-switch a{min-height:44px;border:1.5px solid #2ca58a;border-radius:18px;background:#fff;color:#16745f;text-decoration:none;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:900}
.customer-aging-switch a.active{background:linear-gradient(135deg,#2fa58a,#238c76);color:#fff;border-color:transparent}
.aging-top-tools{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:7px;align-items:center;margin:4px 0 10px;direction:rtl}
.aging-period-chip,.aging-unlinked-chip,.aging-filter-form select{height:38px;border:1px solid #d8e5e1;border-radius:11px;background:#fff;color:#173d32;font-size:10px;font-weight:900;display:flex;align-items:center;justify-content:center;white-space:nowrap}
.aging-period-chip{padding:0 10px}
.aging-unlinked-chip{padding:0 10px;text-decoration:none}
.aging-unlinked-chip.active{border-color:#2fa58a;background:#edf8f4;color:#16745f}
.aging-filter-form{min-width:0}
.aging-filter-form select{width:100%;padding:0 9px;outline:none;box-shadow:none}
.aging-reference-title{margin:5px 0 8px;color:#142d3b;font-size:19px;line-height:1.1;font-weight:900}
.aging-reference-title.distribution{margin-top:14px}
.aging-reference-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;direction:rtl}
.aging-reference-summary a{min-width:0;min-height:140px;padding:10px 5px;border:1px solid #d9e7e2;border-radius:15px;background:#fff;color:#173d32;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:5px;box-shadow:0 4px 12px rgba(20,70,57,.04)}
.aging-reference-summary a.selected{border-color:#2fa58a;box-shadow:inset 0 0 0 1px #2fa58a}
.aging-reference-summary i{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:16px;background:#e8f6f0;color:#16745f}
.aging-reference-summary .overdue i{background:#fff0dc;color:#d37b16}
.aging-reference-summary .customers-count i{background:#edf0ff;color:#5c50a2}
.aging-reference-summary .largest i{background:#ffe8e8;color:#e64a45}
.aging-reference-summary span{font-size:10px;line-height:1.25;color:#344f47}
.aging-reference-summary strong{max-width:100%;font-size:17px;line-height:1.05;color:#0f2530;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aging-reference-summary small{max-width:100%;font-size:9px;line-height:1.25;color:#526d64;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aging-reference-buckets{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;direction:rtl}
.aging-reference-buckets a{min-width:0;min-height:96px;border:1px solid #d8e5e1;border-radius:13px;background:#fff;color:#17705a;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:7px 2px;gap:7px}
.aging-reference-buckets a.selected{box-shadow:inset 0 0 0 1px currentColor}
.aging-reference-buckets span{font-size:8.5px;font-weight:900;line-height:1.25;min-height:22px;display:flex;align-items:center}
.aging-reference-buckets strong{font-size:13px;line-height:1;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.aging-reference-buckets small{font-size:8px}
.aging-reference-buckets .bucket-blue{color:#2467e8}
.aging-reference-buckets .bucket-yellow{color:#c88a0b}
.aging-reference-buckets .bucket-orange{color:#e06d12}
.aging-reference-buckets .bucket-red{color:#df3d31}
.aging-reference-buckets .bucket-red-dark{color:#ef2525}
.aging-reference-search{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:7px;margin:12px 0 8px;direction:rtl}
.aging-reference-search input{height:44px;border:1px solid #d8e5e1;border-radius:12px;background:#fff;padding:0 12px;font-size:11px;outline:none;box-shadow:none}
.aging-reference-search button{height:44px;border:1px solid #d8e5e1;border-radius:12px;background:#fff;color:#638078;font-size:18px}
.aging-customer-table{border:1px solid #dbe8e3;border-radius:13px;background:#fff;overflow:hidden;min-width:0}
.aging-table-head,.aging-customer-row{display:grid;grid-template-columns:minmax(105px,1.65fr) minmax(45px,.72fr) minmax(42px,.65fr) minmax(48px,.72fr) minmax(48px,.72fr) minmax(54px,.8fr) 32px;gap:4px;align-items:center;min-width:0}
.aging-table-head{min-height:40px;padding:5px 6px;border-bottom:1px solid #dfe9e5;background:#fbfdfc;color:#344e46;font-size:8px;font-weight:900;text-align:center}
.aging-table-head span:first-child{text-align:right}
.aging-customer-row{min-height:58px;padding:6px;border-bottom:1px solid #edf2f0;color:#173d32}
.aging-customer-row:last-child{border-bottom:0}
.aging-customer-main{min-width:0;display:grid;grid-template-columns:25px minmax(0,1fr);gap:6px;align-items:center;color:inherit;text-decoration:none}
.aging-customer-main>i{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#16876e;color:#fff;font-style:normal;font-size:11px}
.aging-customer-main>span{min-width:0;display:grid;gap:2px}
.aging-customer-main b{font-size:9px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aging-customer-main small{font-size:6.8px;color:#637b73;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aging-customer-row>strong{font-size:8px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aging-customer-row .overdue-value{color:#e02424}
.aging-date-cell{font-size:7px;color:#4e665f;text-align:center;line-height:1.25;overflow-wrap:anywhere}
.aging-state{display:inline-flex;min-height:22px;border-radius:999px;align-items:center;justify-content:center;padding:3px 4px;font-size:7px;font-weight:900;text-align:center;line-height:1.15}
.aging-state.late{background:#ffe8e8;color:#dc2525}
.aging-state.soon{background:#fff2d8;color:#d46e00}
.aging-state.current{background:#e9f5ff;color:#276da4}
.aging-state.paid{background:#e9f7ef;color:#197054}
.aging-row-action{width:28px;height:34px;border:1px solid #cfe2dc;border-radius:9px;background:#fff;color:#16745f;text-decoration:none;display:grid;place-items:center;font-size:17px;font-weight:900}
.aging-empty-state{padding:24px 10px;text-align:center;color:#6b8079;font-size:11px;font-weight:800}
.aging-pagination{margin-top:10px}

@media(max-width:520px){
  .order-v2-actions{gap:4px;flex-wrap:wrap}
  .orders-finance-small{min-height:28px;padding:0 7px;font-size:8px}
  .order-finance-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  .order-finance-strip>a{grid-column:1/-1;min-height:28px}
  .order-finance-strip small{font-size:7px}
  .order-finance-strip b{font-size:8.5px}
  .finance-order-head>strong{font-size:12px}
  .finance-close-summary{gap:4px}
  .finance-close-summary>div{min-height:54px;padding-inline:2px}
  .finance-close-summary strong{font-size:9px}
  .finance-close-summary span{font-size:7px}
  .aging-reference-page{padding-inline:0}
  .aging-reference-summary{gap:4px}
  .aging-reference-summary a{min-height:125px;padding-inline:3px}
  .aging-reference-summary strong{font-size:14px}
  .aging-reference-buckets{gap:3px}
  .aging-reference-buckets a{min-height:88px}
  .aging-table-head,.aging-customer-row{grid-template-columns:minmax(96px,1.55fr) minmax(42px,.68fr) minmax(39px,.62fr) minmax(44px,.68fr) minmax(44px,.68fr) minmax(48px,.76fr) 30px;gap:3px}
}

/* Phase 35: advances, discounts and traceable financial adjustments */
.status-badge.finance-waiting{background:#fff4df;color:#9b5e16;border-color:#efd5aa}
.status-badge.finance-unpaid{background:#fff0f0;color:#ad4141;border-color:#efcccc}
.status-badge.finance-partial{background:#fff7e8;color:#a56619;border-color:#efd9b7}
.status-badge.finance-paid{background:#e8f6f0;color:#176f59;border-color:#cce8dc}
.finance-advance-badge{display:inline-flex;align-items:center;min-height:22px;padding:0 7px;border-radius:999px;background:#eef7ff;color:#316b91;border:1px solid #d5e8f5;font-size:8px;font-weight:900;white-space:nowrap}
.finance-amount-breakdown{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:7px 0}
.finance-amount-breakdown>div{min-width:0;min-height:52px;padding:6px 3px;border:1px solid #dbe8e3;border-radius:10px;background:#f9fcfb;display:grid;place-content:center;text-align:center;gap:3px}
.finance-amount-breakdown span{font-size:7.5px;color:#6d8079}
.finance-amount-breakdown b{font-size:10px;color:#176e59;overflow-wrap:anywhere}
.finance-close-summary-six{grid-template-columns:repeat(6,minmax(0,1fr))}
.finance-credit-alert{padding:9px 10px;background:#edf7ff;border-color:#d6e9f5;color:#356a8d;font-size:9px}
.finance-credit-alert b{font-size:11px}
.finance-adjustment-note{margin:7px 0 0;padding:7px 8px;border-radius:9px;background:#fff8e9;color:#865a20;font-size:8px;line-height:1.5}
.finance-adjustment-card{padding:0;overflow:hidden}
.finance-adjustment-card>summary{cursor:pointer;list-style:none;padding:10px;font-size:10px;font-weight:900;color:#176e59;display:flex;align-items:center;justify-content:space-between}
.finance-adjustment-card>summary::-webkit-details-marker{display:none}
.finance-adjustment-card>summary:after{content:'⌄';font-size:14px}
.finance-adjustment-card[open]>summary{border-bottom:1px solid #e5eeea}
.finance-adjustment-form{padding:9px}
.finance-inline-editor{grid-column:1/-1;border-top:1px solid #eef3f1;padding-top:5px}
.finance-inline-editor>summary{cursor:pointer;list-style:none;color:#267a66;font-size:8px;font-weight:900}
.finance-inline-editor>summary::-webkit-details-marker{display:none}
.finance-mini-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:6px}
.finance-mini-form input,.finance-mini-form select,.finance-mini-form textarea,.finance-delete-form input{width:100%;min-width:0;min-height:34px;border:1px solid #d6e4df;border-radius:9px;background:#fff;padding:7px 8px;font:inherit;font-size:8px;color:#173d32}
.finance-mini-form textarea{grid-column:1/-1;resize:vertical}
.finance-mini-form input[name="adjustment_reason"]{grid-column:1/-1}
.finance-mini-form button{grid-column:1/-1;min-height:34px}
.finance-delete-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:6px}
.finance-delete-form button{border:0;border-radius:9px;background:#fff0f0;color:#ac3d3d;padding:0 10px;font-size:8px;font-weight:900}
.finance-advance-list article{border-color:#dbe9f3;background:#fbfdff}
.order-finance-ready .finance-ready-copy{display:grid;gap:2px}
.order-finance-ready .finance-ready-copy small{display:block}
.order-finance-strip .advance-info b{color:#356a8d}
.pricing-finance-badge{display:inline-flex;align-items:center;min-height:22px;padding:0 7px;border-radius:999px;font-size:8px;font-weight:900;border:1px solid transparent;white-space:nowrap}
.pricing-finance-badge.finance-waiting{background:#fff4df;color:#9b5e16;border-color:#efd5aa}
.pricing-finance-badge.finance-unpaid{background:#fff0f0;color:#ad4141;border-color:#efcccc}
.pricing-finance-badge.finance-partial{background:#fff7e8;color:#a56619;border-color:#efd9b7}
.pricing-finance-badge.finance-paid{background:#e8f6f0;color:#176f59;border-color:#cce8dc}
@media (max-width:680px){
  .finance-close-summary-six{grid-template-columns:repeat(3,minmax(0,1fr))}
  .finance-amount-breakdown{grid-template-columns:repeat(2,minmax(0,1fr))}
  .finance-mini-form{grid-template-columns:1fr}
  .finance-mini-form textarea,.finance-mini-form input[name="adjustment_reason"],.finance-mini-form button{grid-column:auto}
}
.order-finance-strip.has-advance{grid-template-columns:minmax(0,1.25fr) repeat(3,minmax(0,.8fr)) auto}
.customer-credit-card{background:#edf7ff;border-color:#d6e9f5}
.customer-credit-card strong{color:#356a8d!important}
@media (max-width:680px){
  .order-finance-strip.has-advance{grid-template-columns:repeat(2,minmax(0,1fr))}
  .order-finance-strip.has-advance>a{grid-column:1/-1}
}

/* ==========================================================
   Phase 36: editable customer-material calculation and actual receipt variance
   ========================================================== */
.customer-material-editable{padding:9px}
.customer-material-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:8px}
.customer-material-edit-grid label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:5px;min-width:0;margin:0}
.customer-material-edit-grid label>span{font-size:8px;font-weight:800;color:#48605a;white-space:nowrap}
.customer-material-edit-grid input,.customer-material-edit-grid select{width:100%;min-width:0;height:34px;padding:5px 7px;border:1px solid #d6e5e1;border-radius:9px;background:#fff;color:#17342f;font:inherit;font-size:9px;outline:none}
.customer-material-edit-grid input:focus,.customer-material-edit-grid select:focus{border-color:#53b49e;box-shadow:0 0 0 2px rgba(45,168,141,.10)}
.customer-material-edit-state{flex:0 0 auto;padding:3px 7px;border-radius:999px;background:#e5f6ef;color:#16705c;font-size:8px;font-weight:900}
.customer-material-edit-state.auto{background:#edf4f2;color:#60736e}
.customer-material-edit-state.warning{background:#fff2d5;color:#9a6200}
.customer-material-edit-help{display:block;margin-top:6px;color:#6d827e;font-size:8.5px;line-height:1.45}
.customer-material-warning-only small{display:block;margin-top:5px;color:#8a5a00}
.customer-material-summary .has-excess,.customer-material-requirement.has-excess .customer-material-quantity-row>div:last-child{background:#e9f8f2}
.customer-material-requirement.has-excess .customer-material-requirement-head>span{background:#dff5ed;color:#16705c}
@media(max-width:360px){
  .customer-material-edit-grid{gap:4px}
  .customer-material-edit-grid label>span{font-size:7px}
  .customer-material-edit-grid input,.customer-material-edit-grid select{height:32px;font-size:8px;padding-inline:5px}
}
.customer-materials-preview.is-calculating{opacity:.72;pointer-events:none}


/* Phase 37 — unified order-card statuses and required item facts */
.order-list-card-head .order-card-status-stack{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  max-width:52%;
}
.order-list-card-head .order-card-status-stack .order-price-summary{
  max-width:100%;
  padding:3px 6px;
  font-size:7.5px;
}
.order-list-card-head .order-card-status-stack em{
  color:var(--muted);
  font-size:8px;
  font-style:normal;
  font-weight:800;
}
.pricing-card-status-price{
  display:flex;
  align-items:center;
  gap:5px;
  max-width:100%;
  flex-wrap:wrap;
}
.pricing-card-inline-price{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  border-radius:999px;
  padding:0 7px;
  background:#e5f6f0;
  color:#087a65;
  font-size:7.5px;
  font-weight:900;
}
.pricing-reference-details.two-facts{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.order-detail-page .item-quantity-strip.five-fields{
  grid-template-columns:minmax(54px,.9fr) minmax(82px,1.35fr) repeat(3,minmax(46px,.72fr));
  gap:4px;
}
.order-detail-page .item-quantity-strip.five-fields>div{
  min-width:0;
  padding:5px 3px;
}
.order-detail-page .item-quantity-strip.five-fields small{
  font-size:7px;
}
.order-detail-page .item-quantity-strip.five-fields b{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9px;
}
@media(max-width:420px){
  .order-list-card-head .order-card-status-stack{max-width:55%}
  .order-detail-page .item-quantity-strip.five-fields{
    grid-template-columns:minmax(44px,.85fr) minmax(68px,1.25fr) repeat(3,minmax(38px,.68fr));
    gap:3px;
  }
  .order-detail-page .item-quantity-strip.five-fields>div{padding:5px 2px}
  .order-detail-page .item-quantity-strip.five-fields small{font-size:6.5px}
  .order-detail-page .item-quantity-strip.five-fields b{font-size:8px}
}

/* Phase 38 — exact order-list card information hierarchy */
.order-card-primary-row,
.order-card-customer-row,
.order-card-facts-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}
.order-card-primary-row b{
  min-width:0;
  font-size:13px;
  white-space:nowrap;
}
.order-card-primary-row .status-badge{
  flex:0 1 auto;
  max-width:50%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:center;
}
.order-card-customer-row{
  margin-top:4px;
}
.order-card-customer-row small{
  min-width:0;
  flex:1 1 auto;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:9px;
}
.order-card-customer-row .order-price-summary{
  flex:0 0 auto;
  max-width:46%;
  padding:3px 6px;
  font-size:7.5px;
}
.order-card-facts-row{
  margin-top:7px;
}
.order-card-facts{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
  flex-wrap:wrap;
}
.order-card-facts span{
  font-size:8px;
  color:#536e68;
  background:#f0f5f3;
  border-radius:999px;
  padding:4px 6px;
  white-space:nowrap;
}
.order-card-priority{
  flex:0 0 auto;
  color:var(--muted);
  font-size:8px;
  font-style:normal;
  font-weight:800;
  white-space:nowrap;
}
.order-item-lines{
  display:grid;
  gap:4px;
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid #e6efec;
}
.order-item-line{
  display:grid;
  grid-template-columns:minmax(92px,1.7fr) repeat(3,minmax(48px,.72fr));
  align-items:center;
  gap:4px;
  min-width:0;
  padding:5px 6px;
  border-radius:9px;
  background:#f5f9f7;
}
.order-item-line>strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#17342f;
  font-size:8.5px;
}
.order-item-line>span{
  min-width:0;
  text-align:center;
}
.order-item-line small{
  display:block;
  color:var(--muted);
  font-size:6.5px;
  line-height:1.1;
}
.order-item-line b{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#183b35;
  font-size:7.5px;
  line-height:1.35;
}
@media(max-width:420px){
  .order-card-primary-row .status-badge{max-width:48%;font-size:7.5px;padding-inline:6px}
  .order-card-customer-row .order-price-summary{max-width:44%;font-size:7px}
  .order-card-facts{gap:4px}
  .order-card-facts span{font-size:7px;padding:3px 5px}
  .order-item-line{grid-template-columns:minmax(74px,1.55fr) repeat(3,minmax(42px,.68fr));gap:3px;padding-inline:4px}
  .order-item-line>strong{font-size:7.5px}
  .order-item-line small{font-size:6px}
  .order-item-line b{font-size:6.8px}
}

/* Phase 39: central customer collections and supplier accounts. Isolated classes only. */
.central-period-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
}
.central-period-tabs a {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 6px;
    border: 1px solid var(--border, #dfe5e2);
    border-radius: 12px;
    background: #fff;
    color: #24352f;
    font-weight: 800;
    font-size: 13px;
    text-align: center;
}
.central-period-tabs a.active {
    border-color: #14875b;
    background: #e9f7f0;
    color: #0c6b47;
}
.central-custom-period,
.central-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}
.central-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
}
.central-custom-period label,
.central-edit-form label,
.central-delete-form label {
    display: grid;
    gap: 5px;
    font-weight: 800;
    font-size: 12px;
    color: #56645f;
}
.central-custom-period input,
.central-custom-period button,
.central-search-row input,
.central-search-row button,
.central-edit-form input,
.central-edit-form select,
.central-edit-form button,
.central-delete-form input,
.central-delete-form button {
    min-height: 42px;
    border-radius: 10px;
}
.central-custom-period button,
.central-search-row button,
.central-save-button {
    border: 0;
    background: #14875b;
    color: #fff;
    font-weight: 900;
    padding-inline: 18px;
}
.central-summary-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}
.central-summary-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.central-summary-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.central-summary-card {
    min-width: 0;
    background: #fff;
    border: 1px solid #dfe5e2;
    border-radius: 14px;
    padding: 12px 9px;
    display: grid;
    gap: 3px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(27, 54, 45, .045);
}
.central-summary-card small {
    color: #64736d;
    font-size: 11px;
    font-weight: 800;
}
.central-summary-card strong {
    color: #143e31;
    font-size: 17px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.central-summary-card span {
    color: #81908b;
    font-size: 10px;
}
.central-summary-card.warning {
    border-color: #efc9c0;
    background: #fff8f6;
}
.central-summary-card.warning strong { color: #b44b36; }
.central-section { margin-top: 14px; }
.central-outstanding-list,
.central-history-list,
.supplier-list-grid,
.supplier-order-list,
.supplier-receipts-list,
.supplier-offers-list {
    display: grid;
    gap: 9px;
}
.central-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.central-row-head > div {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px;
}
.central-row-head b,
.central-row-head h2 {
    margin: 0;
    color: #183d32;
}
.central-row-head small {
    display: block;
    width: 100%;
    color: #71807a;
    line-height: 1.5;
}
.central-row-head a {
    color: #127751;
    font-weight: 800;
}
.central-row-head > strong {
    flex: 0 0 auto;
    color: #116f4c;
    font-size: 16px;
    white-space: nowrap;
}
.central-money-line,
.supplier-card-money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
}
.central-money-line span,
.supplier-card-money > div {
    min-width: 0;
    border: 1px solid #e5ebe8;
    border-radius: 10px;
    padding: 8px 6px;
    background: #fafcfb;
    text-align: center;
    color: #687670;
    font-size: 11px;
}
.central-money-line b,
.supplier-card-money b {
    display: block;
    margin-top: 3px;
    color: #1e4539;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.supplier-card-money .warning {
    background: #fff7f5;
    border-color: #efc9c0;
}
.supplier-card-money .warning b { color: #b44b36; }
.central-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}
.central-card-actions a {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #cfe1d9;
    border-radius: 9px;
    background: #f5fbf8;
    color: #126f4c;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.central-record-meta,
.supplier-profile-meta,
.supplier-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 8px;
    color: #687771;
    font-size: 11px;
    font-weight: 700;
}
.central-record-note {
    margin: 8px 0 0;
    color: #4d5c57;
    font-size: 12px;
    line-height: 1.65;
}
.central-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}
.central-type-badge.collection {
    background: #e8f6ef;
    color: #0c704a;
}
.central-type-badge.advance {
    background: #fff4df;
    color: #9b6812;
}
.central-record-details {
    margin-top: 9px;
    border-top: 1px solid #e5ebe8;
    padding-top: 8px;
}
.central-record-details summary {
    cursor: pointer;
    color: #126f4c;
    font-size: 12px;
    font-weight: 900;
}
.central-edit-form,
.central-delete-form {
    display: grid;
    gap: 8px;
    margin-top: 9px;
    padding: 10px;
    border-radius: 11px;
    background: #f8fbfa;
    border: 1px solid #e2e9e6;
}
.central-form-grid {
    display: grid;
    gap: 8px;
}
.central-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.central-delete-form {
    background: #fff8f6;
    border-color: #f0d7d0;
}
.central-delete-form button {
    border: 0;
    background: #b84c38;
    color: #fff;
    font-weight: 900;
}
.supplier-account-card,
.supplier-order-card,
.supplier-offer-history-card {
    color: inherit;
}
.supplier-account-card:hover,
.supplier-order-card:hover,
.supplier-offer-history-card:hover {
    border-color: #b7d5c8;
}
.supplier-card-foot {
    justify-content: space-between;
    border-top: 1px solid #edf1ef;
    padding-top: 7px;
}
.supplier-profile-card { margin-bottom: 10px; }
.supplier-profile-card .central-row-head > div { display: grid; gap: 3px; }
.supplier-offer-history-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}
.supplier-offer-history-card > div { min-width: 0; display: grid; gap: 3px; }
.supplier-offer-history-card small { color: #71807a; }
.supplier-offer-history-card > strong { color: #116f4c; white-space: nowrap; }
.supplier-offer-history-card > span {
    background: #e8f6ef;
    color: #0d714c;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 900;
}

@media (max-width: 760px) {
    .central-period-tabs {
        grid-template-columns: repeat(5, minmax(76px, 1fr));
        overflow-x: auto;
        padding-bottom: 3px;
    }
    .central-summary-grid.five,
    .central-summary-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .central-summary-grid .central-summary-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    .central-custom-period { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .central-custom-period button { grid-column: 1 / -1; }
    .central-row-head { align-items: flex-start; }
    .central-row-head > strong { font-size: 14px; }
    .supplier-offer-history-card { grid-template-columns: minmax(0, 1fr) auto; }
    .supplier-offer-history-card > span { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 430px) {
    .central-summary-card { padding: 10px 6px; }
    .central-summary-card strong { font-size: 15px; }
    .central-form-grid.two { grid-template-columns: 1fr; }
    .central-money-line,
    .supplier-card-money { gap: 5px; }
    .central-money-line span,
    .supplier-card-money > div { padding-inline: 4px; }
    .central-row-head { gap: 7px; }
}

/* Phase 40: collections and supplier pages aligned with the approved expenses page. */
.central-expense-style .central-page-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;
}
.central-expense-style .central-page-head h2{margin:0;color:#12322d;font-size:17px;font-weight:900}
.central-expense-style .central-page-head p{margin:3px 0 0;color:#6d827e;font-size:10px;line-height:1.45}
.central-expense-style .central-compact-summary{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:0 0 8px;
}
.central-expense-style .central-compact-summary.four{grid-template-columns:repeat(5,minmax(0,1fr))}
.central-expense-style .central-compact-summary .central-summary-card{
  min-width:0;min-height:58px;padding:7px 3px;border:1px solid #dbe8e3;border-radius:12px;background:#fff;
  box-shadow:none;text-align:center;display:grid;place-content:center;gap:3px;
}
.central-expense-style .central-compact-summary .central-summary-card small{font-size:8.5px;color:#6b7e78;line-height:1.2;font-weight:800}
.central-expense-style .central-compact-summary .central-summary-card strong{font-size:11px;line-height:1.2;color:#123c30;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.central-expense-style .central-compact-summary .central-summary-card span{font-size:7.5px;color:#7a8b85;line-height:1.2}
.central-expense-style .central-compact-summary .central-summary-card.warning{background:#fff;border-color:#dbe8e3}
.central-expense-style .central-compact-summary .central-summary-card.warning strong{color:#b35a26}
.central-expense-style .expense-period-tabs{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:0 0 7px;overflow:visible;padding:0;
}
.central-expense-style .expense-period-tabs a{
  min-width:0;min-height:34px;padding:4px 2px;border:1px solid #dce8e3;border-radius:10px;background:#fff;
  color:#506860;text-decoration:none;display:grid;place-content:center;text-align:center;font-size:8.5px;font-weight:900;line-height:1.25;
}
.central-expense-style .expense-period-tabs a.active{background:#147b68;border-color:#147b68;color:#fff}
.central-expense-style .expense-custom-range{
  display:grid;grid-template-columns:1fr 1fr 58px;gap:5px;margin:0 0 7px;padding:7px;border:1px solid #dce8e3;
  border-radius:11px;background:#fff;align-items:end;
}
.central-expense-style .expense-custom-range label{display:grid;gap:3px;min-width:0;color:#526a62;font-size:8px;font-weight:900}
.central-expense-style .expense-custom-range input,.central-expense-style .expense-custom-range button{height:36px;min-height:36px;border-radius:9px;font-size:9px}
.central-expense-style .expense-custom-range input{width:100%;min-width:0;border:1px solid #d8e5e0;background:#fbfdfc;padding:0 6px;color:#17362e}
.central-expense-style .expense-custom-range button{align-self:end;border:0;background:#2fa589;color:#fff;font-weight:900;padding:0 7px}
.central-expense-style .expense-search-row{
  display:grid;grid-template-columns:minmax(0,1fr) 58px;gap:6px;margin:0 0 8px;padding:0;background:transparent;border:0;box-shadow:none;
}
.central-expense-style .expense-search-row input,.central-expense-style .expense-search-row button{height:38px;min-height:38px;border-radius:10px}
.central-expense-style .expense-search-row input{border:1px solid #d8e5e0;background:#fff;padding:0 10px;font-size:11px;color:#17362e}
.central-expense-style .expense-search-row button{border:1px solid #2fa589;background:#fff;color:#15735f;font-size:10px;font-weight:900;padding:0}
.central-expense-style .central-expense-section{margin-top:8px}
.central-expense-style .central-expense-section>.section-title-row{margin-bottom:7px}
.central-expense-style .central-expense-section>.section-title-row h2{font-size:15px}
.central-expense-style .central-expense-section>.section-title-row span{font-size:8px;color:#73867f}
.central-expense-style .central-outstanding-list,
.central-expense-style .central-history-list,
.central-expense-style .supplier-list-grid,
.central-expense-style .supplier-order-list,
.central-expense-style .supplier-receipts-list,
.central-expense-style .supplier-offers-list{gap:0}
.central-expense-style .central-expense-card{
  display:grid;gap:7px;padding:9px;margin:0 0 9px;border-radius:12px;box-shadow:none;
}
.central-expense-style .central-expense-card:last-child{margin-bottom:0}
.central-expense-style .central-row-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}
.central-expense-style .central-row-head>div{min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 7px}
.central-expense-style .central-row-head b,.central-expense-style .central-row-head h2{margin:0;color:#102f28;font-size:13px;line-height:1.35;font-weight:900}
.central-expense-style .central-row-head small{display:block;width:100%;margin:0;color:#6b7d77;font-size:8px;line-height:1.4}
.central-expense-style .central-row-head a{color:#16745f;font-size:8px;font-weight:900;text-decoration:none}
.central-expense-style .central-row-head>strong{color:#11765f;font-size:13px;line-height:1.3;white-space:nowrap;text-align:left}
.central-expense-style .central-type-badge{min-height:22px;padding:2px 7px;font-size:8px}
.central-expense-style .central-money-line,
.central-expense-style .supplier-card-money{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:0;
}
.central-expense-style .central-money-line span,
.central-expense-style .supplier-card-money>div{
  min-width:0;padding:6px 3px;border:0;border-radius:8px;background:#f1f7f4;color:#314d46;text-align:center;
  font-size:7px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.central-expense-style .central-money-line b,
.central-expense-style .supplier-card-money b{
  display:block;margin-top:2px;color:#173f33;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.central-expense-style .supplier-card-money .warning{background:#fff4ec}
.central-expense-style .supplier-card-money .warning b{color:#b35a26}
.central-expense-style .central-record-meta,
.central-expense-style .supplier-profile-meta,
.central-expense-style .supplier-card-foot{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:0;color:#314d46;font-size:8px;font-weight:800;
}
.central-expense-style .central-record-meta span,
.central-expense-style .supplier-profile-meta span,
.central-expense-style .supplier-card-foot span,
.central-expense-style .supplier-card-foot:not(:has(span)){
  min-width:0;padding:6px 3px;border-radius:8px;background:#f1f7f4;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.central-expense-style .central-record-note{margin:0;padding-top:6px;border-top:1px solid #edf3f0;color:#61756e;font-size:9px;line-height:1.55}
.central-expense-style .central-card-actions{
  display:flex;align-items:center;justify-content:flex-start;gap:4px;flex-wrap:wrap;margin-top:0;padding-top:6px;border-top:1px solid #edf3f0;
}
.central-expense-style .central-card-actions a{
  min-height:26px;padding:0 8px;border:1px solid #d7e5df;border-radius:8px;background:#fff;color:#16745f;
  text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font-size:8px;font-weight:900;
}
.central-expense-style .central-record-details{margin-top:0;padding-top:6px;border-top:1px solid #edf3f0}
.central-expense-style .central-record-details summary{font-size:8px;color:#16745f}
.central-expense-style .central-edit-form,.central-expense-style .central-delete-form{gap:6px;margin-top:7px;padding:8px;border-radius:10px}
.central-expense-style .central-edit-form label,.central-expense-style .central-delete-form label{gap:3px;font-size:8px}
.central-expense-style .central-edit-form input,.central-expense-style .central-edit-form select,
.central-expense-style .central-edit-form button,.central-expense-style .central-delete-form input,
.central-expense-style .central-delete-form button{min-height:36px;height:36px;border-radius:9px;font-size:9px}
.central-expense-style .supplier-account-card{color:inherit;text-decoration:none}
.central-expense-style .supplier-card-foot{border-top:1px solid #edf3f0;padding-top:6px}
.central-expense-style .supplier-profile-card{margin-bottom:8px}
.central-expense-style .supplier-profile-card .central-row-head>div{display:grid;gap:2px}
.central-expense-style .supplier-offer-history-card{
  grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;
}
.central-expense-style .supplier-offer-history-card>div{min-width:0;display:grid;gap:2px}
.central-expense-style .supplier-offer-history-card>strong{color:#11765f;font-size:12px;white-space:nowrap}
.central-expense-style .supplier-offer-history-card>span{padding:4px 7px;border-radius:999px;background:#e7f5ef;color:#1d735e;font-size:8px;font-weight:900}
@media(max-width:430px){
  .central-expense-style .central-page-head h2{font-size:16px}
  .central-expense-style .central-compact-summary{gap:4px}
  .central-expense-style .central-compact-summary .central-summary-card{min-height:54px;padding:6px 2px}
  .central-expense-style .central-compact-summary .central-summary-card small{font-size:7px}
  .central-expense-style .central-compact-summary .central-summary-card strong{font-size:9px}
  .central-expense-style .expense-period-tabs{gap:4px}
  .central-expense-style .expense-period-tabs a{font-size:7.5px;padding-inline:1px}
  .central-expense-style .expense-custom-range{grid-template-columns:1fr 1fr 52px;gap:4px}
  .central-expense-style .central-row-head{gap:7px}
  .central-expense-style .central-row-head>strong{font-size:11px}
  .central-expense-style .central-record-meta,.central-expense-style .supplier-profile-meta,.central-expense-style .supplier-card-foot{gap:3px}
  .central-expense-style .central-record-meta span,.central-expense-style .supplier-profile-meta span,.central-expense-style .supplier-card-foot span{font-size:7px;padding-inline:3px}
  .central-expense-style .supplier-offer-history-card{grid-template-columns:minmax(0,1fr) auto}
  .central-expense-style .supplier-offer-history-card>span{grid-column:1/-1;justify-self:start}
}
.central-expense-style .central-compact-summary .central-summary-card:last-child:nth-child(odd){grid-column:auto}
.central-expense-style .expense-custom-range button{grid-column:auto}
.central-expense-style .supplier-offer-history-card>span{grid-column:auto;justify-self:auto}
@media(max-width:430px){
  .central-expense-style .supplier-offer-history-card>span{grid-column:1/-1;justify-self:start}
}

/* Phase 53: add/edit order actions stay in normal flow and never cover uploads. */
.orders-app-page .embedded-order-form .embedded-order-actions,
.order-entry-page .order-form-main .orders-form-actions{
  position:static;
  bottom:auto;
  z-index:auto;
}
.orders-app-page .embedded-order-form .embedded-order-actions{
  margin:12px 0 0;
  padding-top:0;
}
.order-entry-page .order-form-main .orders-form-actions{
  margin:12px 0 8px;
}


/* Phase 56 — order pricing VAT and operation-pricing return flow. */
.pricing-item-head-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  min-width:0;
}
.pricing-item-head-actions .pricing-item-status{
  flex:0 0 auto;
}
.operation-pricing-launch{
  min-height:26px;
  border:1px solid #8bcfbe;
  border-radius:8px;
  background:#edf9f5;
  color:#087a65;
  padding:4px 7px;
  font:inherit;
  font-size:7px;
  font-weight:900;
  white-space:nowrap;
  cursor:pointer;
}
.pricing-input-grid{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.pricing-fixed-tax{
  width:100%;
  min-width:0;
  height:35px;
  border:1px solid #d5e5e1;
  border-radius:9px;
  background:#f1f7f5;
  color:#087a65;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:900;
  box-sizing:border-box;
}
.pricing-result-grid{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.pricing-result-grid .pricing-dual-result,
.pricing-grand-summary .pricing-dual-result{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}
.pricing-dual-result>span{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:2px;
  min-width:0;
}
.pricing-dual-result em{
  font-style:normal;
  color:#6d827e;
  font-size:6.2px;
  line-height:1;
}
.pricing-dual-result>span b{
  min-width:0;
  margin:0;
  text-align:center;
  font-size:8.2px!important;
}
.pricing-grand-summary{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.pricing-grand-summary .pricing-dual-result>span b{
  font-size:8.8px!important;
}
@media(max-width:390px){
  .pricing-item-head{gap:4px}
  .pricing-item-head-actions{gap:3px}
  .operation-pricing-launch{padding-inline:5px;font-size:6.3px}
  .pricing-reference-item-card .pricing-item-status{padding-inline:5px;font-size:6.2px}
  .pricing-input-grid{gap:3px}
  .pricing-input-grid label>span{font-size:6.6px}
  .pricing-input-grid input,.pricing-input-grid select,.pricing-fixed-tax{height:32px;padding-inline:4px;font-size:8px}
  .pricing-input-grid label>small{font-size:5.8px}
  .pricing-result-grid{gap:2px}
  .pricing-result-grid>div{padding:5px 1px}
  .pricing-result-grid small{font-size:5.4px}
  .pricing-result-grid b{font-size:7.1px}
  .pricing-dual-result em{font-size:5.2px}
  .pricing-dual-result>span b{font-size:6.8px!important}
  .pricing-grand-summary{gap:2px;padding-inline:5px}
  .pricing-grand-summary>div{padding-inline:1px}
  .pricing-grand-summary small{font-size:5.6px}
  .pricing-grand-summary b{font-size:7.6px}
  .pricing-grand-summary .pricing-dual-result>span b{font-size:7px!important}
}


/* Phase 59: shared period filter without changing the existing status cards. */
.app-list-period-filter{display:grid;gap:6px;margin:0 0 8px}
.app-list-period-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.app-list-period-tabs a{min-width:0;min-height:34px;display:grid;place-items:center;border:1px solid #d9e7e3;border-radius:10px;background:#fff;color:#31524a;text-decoration:none;font-size:8px;font-weight:900;text-align:center;padding:3px}
.app-list-period-tabs a.active{background:#2d9a82;border-color:#2d9a82;color:#fff}
.app-list-custom-range{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 58px;gap:5px;align-items:end;padding:7px;border:1px solid #dce9e5;border-radius:12px;background:#fff}
.app-list-custom-range label{display:grid;gap:3px;min-width:0;color:#526a62;font-size:7.5px;font-weight:900}
.app-list-custom-range input,.app-list-custom-range button{width:100%;min-width:0;height:35px;min-height:35px;border-radius:9px;font:inherit;font-size:8.5px}
.app-list-custom-range input{border:1px solid #d8e5e0;background:#fbfdfc;padding:0 5px;color:#17362e}
.app-list-custom-range button{border:0;background:#2fa589;color:#fff;font-weight:900;padding:0 5px}
.pricing-reference-search label input[type="search"]{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;-webkit-appearance:none;appearance:none;padding:0!important}

/* Phase 61 — customers directory aligned with the approved reference tool.
   Scoped to the customers page; shared header and bottom navigation are untouched. */
.customers-directory-page .customers-directory-main{
  width:100%;
  max-width:520px;
  margin:0 auto;
  padding:9px 9px calc(18px + var(--app-global-nav-h,72px));
  overflow-x:hidden;
}
.customers-directory-page .customers-directory-main>.alert{
  margin-bottom:7px;
  border-radius:11px;
  padding:8px 10px;
  font-size:9px;
}
.customers-directory-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  margin-bottom:7px;
}
.customers-directory-tabs a,
.customers-directory-tabs span{
  min-width:0;
  height:38px;
  border:1px solid #249f86;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:#fff;
  color:#157c69;
  text-decoration:none;
  font-size:10.5px;
  font-weight:950;
}
.customers-directory-tabs a.active{
  background:linear-gradient(135deg,#2daa8e,#19836f);
  color:#fff;
  box-shadow:0 6px 16px rgba(15,126,105,.15);
}
.customers-directory-tabs span[aria-disabled="true"]{opacity:.5}
.customers-directory-controls{
  display:grid;
  gap:6px;
  margin:0 0 7px;
}
.customers-directory-primary-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 96px;
  gap:6px;
  min-width:0;
}
.customers-directory-primary-row.no-create-button{grid-template-columns:1fr}
.customers-directory-search{
  position:relative;
  display:block;
  min-width:0;
  margin:0;
}
.customers-directory-search>span{
  position:absolute;
  top:50%;
  right:10px;
  z-index:1;
  transform:translateY(-50%);
  color:#718580;
  font-size:13px;
  pointer-events:none;
}
.customers-directory-search input{
  width:100%;
  height:38px;
  min-width:0;
  padding:0 31px 0 10px;
  border:1px solid #d8e7e3;
  border-radius:12px;
  background:#fff;
  color:#173832;
  font:inherit;
  font-size:9.5px;
  outline:none;
  box-shadow:none;
}
.customers-directory-search input:focus{
  border-color:#2daa8e;
  box-shadow:0 0 0 2px rgba(45,170,142,.10);
}
.customers-directory-search input::placeholder{color:#8a9b97}
.customers-directory-new{
  height:38px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#2daa8e,#19836f);
  color:#fff;
  text-decoration:none;
  font-size:10px;
  font-weight:950;
  white-space:nowrap;
}
.customers-directory-select-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  min-width:0;
}
.customers-directory-select-row select{
  width:100%;
  min-width:0;
  height:36px;
  padding:0 10px 0 28px;
  border:1px solid #d8e7e3;
  border-radius:12px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23173832' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:left 9px center;
  background-size:9px 6px;
  color:#173832;
  -webkit-appearance:none;
  appearance:none;
  font:inherit;
  font-size:9px;
  font-weight:800;
  outline:none;
}
.customers-directory-select-row select:focus{
  border-color:#2daa8e;
  box-shadow:0 0 0 2px rgba(45,170,142,.10);
}
.customers-directory-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  margin-bottom:7px;
}
.customers-directory-summary a{
  min-width:0;
  min-height:72px;
  padding:6px 3px 5px;
  border:1px solid #dfeae7;
  border-radius:13px;
  display:grid;
  grid-template-rows:22px 22px 1fr;
  place-items:center;
  background:#fff;
  color:#173832;
  text-decoration:none;
  box-shadow:0 5px 14px rgba(7,61,51,.055);
}
.customers-directory-summary a.selected{
  border-color:#22a286;
  box-shadow:0 0 0 1px rgba(34,162,134,.08),0 6px 16px rgba(7,61,51,.08);
}
.customers-directory-summary a>span{font-size:17px;line-height:1}
.customers-directory-summary a>strong{font-size:17px;line-height:1;font-weight:950}
.customers-directory-summary a>b{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#647a75;
  font-size:7.5px;
  line-height:1.1;
}
.customers-directory-summary a.selected>b{color:#147865}
.customer-directory-results{
  position:relative;
  min-width:0;
}
.customer-directory-result-count{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
.customer-directory-list{
  display:grid;
  gap:7px;
}
.customer-directory-card{
  min-width:0;
  overflow:hidden;
  border:1px solid #deebe7;
  border-radius:15px;
  background:#fff;
  box-shadow:0 7px 20px rgba(7,61,51,.065);
}
.customer-directory-overview{
  display:grid;
  grid-template-columns:58px minmax(0,1.22fr) minmax(95px,.92fr);
  gap:6px;
  min-width:0;
  padding:8px 8px 7px;
  align-items:stretch;
}
.customer-directory-kind{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.customer-directory-kind span{
  max-width:100%;
  padding:5px 7px;
  border-radius:999px;
  background:#e5f6f0;
  color:#18806c;
  font-size:8px;
  font-weight:950;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-directory-identity{
  min-width:0;
  border-left:1px solid #edf3f1;
  padding-left:6px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}
.customer-directory-name{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#143a33;
  text-decoration:none;
  font-size:11px;
  line-height:1.35;
  font-weight:950;
}
.customer-directory-identity>b{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#314c46;
  font-size:8.5px;
  line-height:1.3;
}
.customer-directory-phone{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#173832;
  text-decoration:none;
  font-size:8.5px;
  direction:ltr;
  text-align:right;
}
.customer-directory-phone.is-empty{color:#8a9b97;pointer-events:none}
.customer-directory-code-state{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}
.customer-directory-code-state>span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#758983;
  font-size:7px;
}
.customer-directory-code-state>em{
  flex:0 0 auto;
  padding:2px 5px;
  border-radius:999px;
  font-style:normal;
  font-size:6.5px;
  font-weight:950;
}
.customer-directory-code-state>em.is-active{background:#dcfce7;color:#166534}
.customer-directory-code-state>em.is-inactive{background:#f1f5f9;color:#64748b}
.customer-directory-activity{
  min-width:0;
  display:grid;
  grid-template-rows:repeat(3,minmax(0,1fr));
  gap:2px;
}
.customer-directory-activity>div{
  min-width:0;
  padding:2px 3px;
  text-align:center;
}
.customer-directory-activity span,
.customer-directory-activity b{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-directory-activity span{color:#788c87;font-size:6.5px;line-height:1.2}
.customer-directory-activity b{margin-top:1px;color:#173832;font-size:7px;line-height:1.25;font-weight:900}
.customer-directory-actions{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:4px;
  padding:6px 7px;
  border-top:1px solid #edf3f1;
  background:#fbfdfc;
}
.customer-directory-actions>a,
.customer-directory-actions>span{
  min-width:0;
  height:43px;
  border:1px solid #e6efed;
  border-radius:9px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  background:#f4f8f7;
  color:#31504a;
  text-decoration:none;
  text-align:center;
}
.customer-directory-actions>a>span,
.customer-directory-actions>span>span{font-size:13px;line-height:1}
.customer-directory-actions b{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:7px;
  line-height:1;
}
.customer-directory-actions .is-disabled{opacity:.42}
.customer-directory-debt{
  min-height:28px;
  padding:5px 9px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  background:linear-gradient(90deg,#fff4d7,#fff9e9);
  color:#946000;
  text-decoration:none;
  font-size:7.5px;
  font-weight:900;
}
.customer-directory-debt strong{
  direction:ltr;
  white-space:nowrap;
  font-size:9px;
}
.customer-directory-empty{
  padding:24px 10px;
  border:1px dashed #d4e5e0;
  border-radius:14px;
  background:#fff;
  color:#70847f;
  text-align:center;
  font-size:10px;
}
.customer-directory-pagination{
  display:flex;
  justify-content:center;
  gap:5px;
  flex-wrap:wrap;
  margin-top:8px;
}
.customer-directory-pagination a{
  width:30px;
  height:30px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:#eaf5f2;
  color:#147865;
  text-decoration:none;
  font-size:9px;
  font-weight:950;
}
.customer-directory-pagination a.current{background:#1d987e;color:#fff}
@media(max-width:390px){
  .customers-directory-page .customers-directory-main{padding-inline:7px}
  .customers-directory-primary-row{grid-template-columns:minmax(0,1fr) 90px;gap:5px}
  .customers-directory-select-row{gap:5px}
  .customers-directory-summary{gap:4px}
  .customers-directory-summary a{min-height:69px;padding-inline:2px}
  .customer-directory-overview{grid-template-columns:54px minmax(0,1.15fr) minmax(88px,.85fr);gap:4px;padding:7px 6px 6px}
  .customer-directory-identity{padding-left:4px}
  .customer-directory-actions{gap:3px;padding-inline:5px}
  .customer-directory-actions>a,
  .customer-directory-actions>span{height:41px}
}
@media(max-width:340px){
  .customer-directory-overview{grid-template-columns:50px minmax(0,1fr) 82px}
  .customer-directory-name{font-size:10px}
  .customer-directory-summary a>b{font-size:6.8px}
  .customer-directory-actions b{font-size:6.4px}
}
