/* V6.6.18 Office totals: loader-app-style customer drilldown plus office filters. */
.totals-headline{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:15px}
.totals-headline h1{font-size:27px;letter-spacing:-.8px;line-height:1.2;margin:0 0 4px}
.totals-headline p{margin:0;color:#788493;font-size:13px}
.totals-controls{background:#fff;border:1px solid #e1e6ed;border-radius:12px;padding:13px 15px;margin-bottom:14px}
.totals-period-line{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.totals-period-line label{display:flex;flex-direction:column;gap:5px;margin:0;color:#68788a;font-size:11px}
.totals-period-line select,.totals-period-line input{min-height:42px;padding:9px 12px;border:1px solid #d5dde7;border-radius:9px;background:#fff;color:#202936;font:inherit;font-size:14px}
.totals-custom-dates{display:flex;gap:8px;align-items:end;min-width:0}
.totals-period-label{margin-left:auto;font-size:13px;color:#536174;font-weight:650}
.tot-pit-tabs{display:flex;gap:7px;overflow-x:auto;padding:2px 1px 10px;margin:0 0 12px}
.tot-pit-tab{flex:0 0 auto;margin:0!important;min-height:42px;padding:9px 14px!important;border:1px solid #dce3eb;border-radius:999px;background:#fff;color:#506075;display:flex;gap:7px;align-items:center;justify-content:center;font-size:13px;font-weight:700;white-space:nowrap}
.tot-pit-tab.active{background:#245cba;color:#fff;border-color:#245cba}.tot-pit-tab small{font-size:10px;opacity:.82}

.tot-customer-list{display:grid;gap:9px;margin:14px 0}
.tot-customer-card,.tot-location-card{width:100%;margin:0!important;border:1px solid #dfe6ee;background:#fff;color:#202936;border-radius:12px;padding:14px 15px!important;display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;box-shadow:0 2px 8px rgba(34,54,84,.025)}
.tot-customer-card:hover,.tot-location-card:hover,.tot-customer-card:focus,.tot-location-card:focus{background:#f7faff;border-color:#bdd3f6}
.tot-customer-card>span,.tot-location-card>span{display:flex;flex-direction:column;gap:4px;min-width:0}
.tot-customer-card strong,.tot-location-card strong{font-size:16px;line-height:1.15}.tot-customer-card small,.tot-location-card small{font-size:11px;color:#748296;font-weight:500;white-space:normal}
.tot-customer-card .tot-customer-value,.tot-location-card>span:last-child{align-items:flex-end;flex:0 0 auto}.tot-customer-card .tot-customer-value strong,.tot-location-card>span:last-child strong{font-size:17px;color:#16253a}
.tot-customer-card .tot-customer-value small,.tot-location-card>span:last-child small{color:#245cba;font-weight:700}
.tot-empty-card{padding:18px;border:1px dashed #d9e0e8;border-radius:12px;color:#7b8796;background:#fff;text-align:center;font-size:13px}

.tot-customer-detail{background:#fff;border:1px solid #dfe6ee;border-radius:14px;padding:15px;margin:14px 0}
.tot-detail-head{display:flex;align-items:flex-start;gap:13px;margin-bottom:13px}.tot-detail-head>div{min-width:0}.tot-detail-head h2{font-size:22px;line-height:1.15;margin:1px 0 4px}.tot-detail-head p,.tot-location-title p{margin:0;color:#657487;font-size:12px}
.tot-detail-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:12px}.tot-detail-tabs button{width:100%!important;margin:0!important;background:#f8fafc;color:#536174;border:1px solid #dfe6ee;padding:10px!important}.tot-detail-tabs button.active{background:#245cba;color:#fff;border-color:#245cba}
.tot-breakdown-panel{border:1px solid #e5eaf0;border-radius:10px;overflow:hidden}.tot-simple-grid{display:grid;grid-template-columns:minmax(0,1fr) 75px 110px;gap:8px;align-items:center;padding:10px 11px;border-bottom:1px solid #e9edf2;font-size:12px}.tot-simple-grid:last-child{border-bottom:0}.tot-simple-grid span:nth-child(n+2){text-align:right;font-variant-numeric:tabular-nums}.tot-simple-head{background:#f6f8fa;color:#68788a;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.25px}.tot-location-item+.tot-location-item{border-top:1px solid #e9edf2}.tot-location-card{border:0;border-radius:0;box-shadow:none}.tot-location-card[aria-expanded="true"]{background:#f4f8ff}.tot-location-card .tot-location-value{display:flex;flex-direction:row;align-items:center;gap:9px}.tot-location-chevron{display:inline-flex;align-items:center;justify-content:center;color:#245cba;font-size:23px;line-height:1;transform-origin:center;transition:transform .15s ease}.tot-location-card[aria-expanded="true"] .tot-location-chevron{transform:rotate(90deg)}.tot-location-inline{background:#fbfcfe;border-top:1px solid #e9edf2}.tot-location-inline .tot-simple-grid:last-child{border-bottom:0}

.tot-advanced{margin-top:15px;border:1px solid #e1e6ed;border-radius:12px;background:#fff}.tot-advanced>summary{cursor:pointer;padding:13px 15px;font-weight:750;color:#536174}.tot-advanced-inner{padding:0 14px 14px}.tot-advanced-help{margin:0 0 10px;color:#7b8796;font-size:11px}.tot-mode{display:flex;gap:5px;flex-wrap:wrap;margin:0 0 12px}.tot-mode button{margin:0!important;background:#fff;color:#506075;border:1px solid #dce3eb;padding:9px 12px!important;font-size:12px}.tot-mode button.active{background:#245cba;color:#fff;border-color:#245cba}
.tot-table-card{background:#fff;border:1px solid #e0e6ed;border-radius:12px;overflow:hidden}.tot-table-scroll{overflow-x:auto}.tot-table{width:100%;border-collapse:collapse;min-width:620px;font-size:13px}.tot-table th,.tot-table td{padding:11px 12px;border-bottom:1px solid #e6ebf0;text-align:left}.tot-table th{background:#f6f8fa;color:#536174;font-weight:700}.tot-table th:nth-last-child(-n+2),.tot-table td:nth-last-child(-n+2){text-align:right;font-variant-numeric:tabular-nums}.tot-table tr:last-child td{border-bottom:0}.tot-table-note{padding:11px 14px;color:#7b8796;font-size:12px}
.tot-destination-detail{background:#fff;border:1px solid #dce4ee;border-radius:12px;margin:0 0 12px;padding:14px 15px;box-shadow:0 4px 14px rgba(34,54,84,.05)}.tot-destination-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.tot-destination-detail-head h2{font-size:20px;line-height:1.2;margin:2px 0 4px;color:#202936}.tot-destination-detail-head p{margin:0;color:#657487;font-size:12px}.tot-destination-kicker{display:block;color:#245cba;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.45px}.tot-product-breakdown{border:1px solid #e4e9ef;border-radius:9px;overflow:hidden}.tot-product-breakdown-row{display:grid;grid-template-columns:minmax(0,1fr) 70px 110px;align-items:center;gap:8px;padding:9px 11px;border-bottom:1px solid #e8edf2;font-size:12px}.tot-product-breakdown-row:last-child{border-bottom:0}.tot-product-breakdown-row span:nth-child(n+2){text-align:right;font-variant-numeric:tabular-nums}.tot-product-breakdown-header{background:#f6f8fa;color:#68788a;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.25px}.tot-destination-row{cursor:pointer}.tot-destination-row:hover td,.tot-destination-row:focus td{background:#f4f8ff}.tot-destination-row:focus{outline:2px solid #8bb7ff;outline-offset:-2px}.tot-destination-row.selected td{background:#edf5ff}.tot-destination-row td:first-child{position:relative;padding-right:30px}.tot-row-chevron{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-size:22px;line-height:1;color:#245cba;font-weight:500}

@media(max-width:760px){.totals-headline h1{font-size:23px}.totals-controls{padding:11px}.totals-period-line{gap:7px}.totals-period-line>label{width:100%}.totals-period-line select{width:100%}.totals-custom-dates{width:100%;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.totals-custom-dates label{width:100%;min-width:0}.totals-custom-dates input{min-width:0;width:100%}.totals-period-label{width:100%;margin:2px 0 0}.tot-pit-tab{min-height:39px;padding:8px 12px!important;font-size:12px}.tot-mode{display:grid;grid-template-columns:1fr 1fr}.tot-mode button{width:100%!important}.tot-table{font-size:12px}.tot-table th,.tot-table td{padding:9px 8px}.tot-customer-card,.tot-location-card{padding:13px!important}}
@media(max-width:600px){#office-totals-page .db-stats strong{white-space:nowrap;font-size:19px;letter-spacing:-.5px}.tot-customer-card strong,.tot-location-card strong{font-size:15px}.tot-customer-card .tot-customer-value strong,.tot-location-card>span:last-child strong{font-size:16px}.tot-customer-detail{padding:11px}.tot-detail-head{flex-direction:column;gap:8px}.tot-detail-head h2{font-size:20px}.tot-simple-grid{grid-template-columns:minmax(0,1fr) 52px 86px;padding:9px 8px;gap:5px}.tot-table-card{border:0;background:transparent;overflow:visible}.tot-table-scroll{overflow:visible}.tot-table{display:block;min-width:0;width:100%;background:transparent}.tot-table thead{display:none}.tot-table tbody{display:grid;gap:8px}.tot-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:#fff;border:1px solid #e0e6ed;border-radius:10px;overflow:hidden}.tot-table tbody td{display:flex;flex-direction:column;gap:3px;min-width:0;padding:9px 10px!important;border:0;border-right:1px solid #edf0f4;border-bottom:1px solid #edf0f4;text-align:left!important;white-space:normal;overflow-wrap:anywhere}.tot-table tbody td:before{content:attr(data-label);font-size:9px;color:#7b8796;font-weight:700;text-transform:uppercase;letter-spacing:.2px}.tot-table tbody td:nth-child(even){border-right:0}.tot-table tbody td:nth-last-child(-n+2){border-bottom:0}.tot-destination-detail{padding:12px}.tot-product-breakdown-row{grid-template-columns:minmax(0,1fr) 52px 86px;padding:9px 8px;gap:5px}.tot-destination-row td:first-child{padding-right:34px!important}.tot-row-chevron{right:10px}}


/* V7.19 quick customer/product totals switch */
.tot-overview-tabs{display:inline-flex;gap:4px;padding:4px;background:#edf2f8;border:1px solid #dde5ee;border-radius:11px;margin:14px 0 2px}
.tot-overview-tabs button{margin:0!important;border:0;background:transparent;color:#56667a;padding:9px 16px!important;border-radius:8px;font-size:13px;font-weight:750}
.tot-overview-tabs button.active{background:#fff;color:#1f4f99;box-shadow:0 1px 4px rgba(32,57,87,.12)}
.tot-product-list{display:grid;gap:9px;margin:14px 0}
.tot-product-card{width:100%;border:1px solid #dfe6ee;background:#fff;color:#202936;border-radius:12px;padding:14px 15px;display:flex;align-items:center;justify-content:space-between;gap:14px;box-shadow:0 2px 8px rgba(34,54,84,.025)}
.tot-product-card>span{display:flex;flex-direction:column;gap:4px;min-width:0}
.tot-product-card strong{font-size:16px;line-height:1.15}.tot-product-card small{font-size:11px;color:#748296;font-weight:500}
.tot-product-card .tot-product-value{align-items:flex-end;flex:0 0 auto}.tot-product-card .tot-product-value strong{font-size:17px;color:#16253a}
@media(max-width:600px){.tot-overview-tabs{display:grid;grid-template-columns:1fr 1fr;width:100%}.tot-overview-tabs button{width:100%!important}.tot-product-card{padding:13px}.tot-product-card strong{font-size:15px}.tot-product-card .tot-product-value strong{font-size:16px}}


/* V7.21 owner/admin material-value totals */
#office-totals-page .db-stats.pricing-visible{grid-template-columns:repeat(4,minmax(0,1fr))}
#tot-value-stat small{display:block;margin-top:5px;color:#7b8796;font-size:10px;line-height:1.35;font-weight:550}
.tot-product-money{color:#1f6b45!important;font-weight:750!important}
.tot-product-money-note{color:#8a6a25!important;text-align:right}
.tot-customer-money{color:#1f6b45!important;font-weight:700!important}
@media(max-width:760px){#office-totals-page .db-stats.pricing-visible{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* A customer detail owns its summary; company controls return with All customers. */
#tot-stats[hidden],#tot-overview-tabs[hidden]{display:none!important}
#tot-customer-grand{font-size:clamp(17px,2vw,23px);font-weight:750;color:#203d61;line-height:1.4;margin-top:8px;overflow-wrap:anywhere}
.tot-detail-head{padding-bottom:14px;border-bottom:1px solid #e5eaf0}
.tot-detail-tabs button{min-height:44px}
.tot-simple-grid strong,.tot-customer-card strong,.tot-location-card strong{overflow-wrap:anywhere}
