/* Desktop workspace: scroll records and details independently; keep actions visible. */
#application{height:100dvh;overflow:hidden}
.main-shell{height:100dvh;min-height:0;margin-left:0}
.topbar{height:28px;flex:0 0 28px;padding:0 12px}
.topbar .avatar{width:24px;height:24px}.topbar .quiet{padding:3px 10px}.topbar .test-badge{padding:2px 7px}
.content-shell{display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-height:0;overflow:hidden}
.content-shell.has-detail{grid-template-columns:minmax(0,1fr) 326px}
.content-shell>main{display:flex;flex-direction:column;min-height:0;padding:8px 8px 0;overflow:hidden;background:#fff}
.page-heading{flex:none;margin:0 0 8px;gap:12px;min-height:34px}
.page-title{flex:none;max-width:34%}
.page-heading h1{font-size:22px;line-height:1.25;margin:0}
.page-heading .eyebrow,.page-heading p{display:none}
.heading-search{min-width:180px;background:white;height:32px}
.heading-search svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5}
.heading-search input{padding:6px 0;font-size:12px}
.page-actions{flex:none;gap:6px;margin-left:auto}
.page-actions button,.page-heading>.filter-button{padding:6px 10px;font-size:12px;min-height:32px}
.page-heading>.filter-button{max-width:175px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:none}
.summary-bar{display:flex;align-items:stretch;gap:12px;flex:none;margin-bottom:8px}
/* Excel dashboard: rounded common frame, inset dividers, label above value.
   92px matches the supplied Excel view (76.75pt at its 90% zoom). */
.kpis{flex:1;min-width:0;max-width:1100px;gap:0;margin:0 auto;border:1px solid #d7e2ee;border-radius:18px;background:#f7f8fa;overflow:hidden}
.kpi{height:90px;min-height:90px;padding:14px 10px 12px 23px;border:0;border-radius:0;background:transparent;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:0;container-type:inline-size}
.kpi:not(:first-child):after{content:"";position:absolute;left:0;top:12px;bottom:12px;width:1px;background:#afc0d2}
.kpi:before{top:19px;bottom:19px;left:10px;width:5px;border-radius:0}
.kpi small{font-size:11px;line-height:16px;font-weight:700;color:#17365d;letter-spacing:0;max-width:100%}
.kpi strong{font-size:23px;line-height:29px;margin:0;color:#102a43;max-width:100%;white-space:nowrap}
.kpi.money strong{font-size:clamp(12px,9cqw,20px)}
/* Offers keep the four-part Excel summary, not the generic amount totals. */
.content-shell[data-page="offers"] .kpis{max-width:820px}
.content-shell[data-page="offers"] .kpi{height:96px;min-height:96px}
.content-shell[data-page="offers"] .kpi:before{top:21px;bottom:21px}
.content-shell[data-page="offers"] .kpi:not(:first-child):after{top:14px;bottom:14px}
/* Depot totals use the same Excel strip; additional depots scroll horizontally. */
.content-shell[data-page="tires"] .kpis{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(170px,1fr);overflow-x:auto}
.content-shell[data-page="tires"] .kpi:last-child{grid-column:auto}
/* Only the tire summary actions use this Excel palette; disabled controls stay muted. */
.content-shell[data-page="tires"] .detail-buttons button[data-action="tire-buy"]:not(:disabled){background:#139354;border-color:#0f8048;color:#fff;font-weight:600}
.content-shell[data-page="tires"] .detail-buttons button[data-action="tire-move"]:not(:disabled){background:#0d5bac;border-color:#0d5bac;color:#fff;font-weight:600}
.content-shell[data-page="tires"] .detail-buttons button[data-action="tire-history"]:not(:disabled){background:#fff;border-color:#0066cc;color:#0066cc;font-weight:600}
.content-shell[data-page="tires"] .detail-buttons button[data-action="tire-edit"]:not(:disabled){background:#fff;border-color:#f07800;color:#e57000;font-weight:600}
/* Exact palette from the Excel offer detail panel, including every terminal state. */
.status.offer-draft{background:#e8ecf1;color:#526579}
.status.offer-waiting{background:#fff0c9;color:#815800}
.status.offer-approved{background:#d8f3e4;color:#126537}
.status.offer-converted{background:#dcecff;color:#195b98}
.status.offer-expired{background:#fde0dc;color:#923126}
.status.offer-revised{background:#e4eef9;color:#245b88}
.status.offer-rejected{background:#f8d7da;color:#8e1c24}
.status.balance-overdue{background:#fdecea;color:#b42318}
.status.balance-tracking{background:#fff4d6;color:#8a5a00}
.status.balance-creditor{background:#eef6ff;color:#1766b3}
.status.balance-current{background:#eaf8f0;color:#137947}
.summary-tools{display:flex;flex-direction:column;justify-content:center;align-items:flex-end;gap:3px;flex:none}
.summary-tools button{font-size:11px;padding:3px 6px}
.summary-tools .row-count{margin:0 6px;white-space:nowrap}
.table-surface{display:flex;flex-direction:column;flex:1;min-height:0;border:0;border-radius:0}
.toolbar{padding:4px 0 8px;min-height:0;background:#fff;border:0}
.toolbar input,.toolbar select{padding:5px 8px}
.table-foot,.app-footer{display:none}
.toolbar,.table-foot{flex:none}
.workspace{display:flex;flex:1;min-height:0;max-height:none;overflow:hidden}
.workspace>.table-scroll{flex:1}
.table-scroll{min-height:0;max-height:none;overscroll-behavior:contain;scrollbar-gutter:stable}
#dataTable{font-size:12px;line-height:18px}
#dataTable th{background:#5b9bd5;font-size:11px;letter-spacing:0;border-right:1px solid #c6dbed}
#dataTable .th-content{height:27px;padding:3px 5px;gap:3px;overflow:hidden}
#dataTable [data-sort]{min-width:0;overflow:hidden;text-overflow:ellipsis}
#dataTable th button{flex:none;color:#fff;font-size:11px;min-width:14px}
#dataTable td{height:27px;padding:4px 5px;border-right:1px solid #d5e4f0;border-bottom:1px solid #c5dbed;line-height:18px}
/* Record values only. Column/group headings, badges, filters and inputs keep their own colors. */
.content-shell #dataTable tbody tr[data-row]>td{color:#000}
.content-shell #dataTable tfoot td.num{color:#000}
/* Loss values remain visible within the otherwise black data text. */
.content-shell[data-page="profit"] #dataTable tbody tr[data-row]>td.negative,
.content-shell[data-page="profit"] #dataTable tfoot td.num.negative{color:#c62828}
#dataTable tbody tr:nth-child(even){background:#f5f9fd}
#dataTable tbody tr.selected{background:#d4e8fa;box-shadow:inset 3px 0 #0878c5}
#dataTable tbody tr[data-row]:hover{background:#b8daf7}
#dataTable .status{display:block;width:max-content;font-size:11px;line-height:16px;padding:0 4px;border-radius:2px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
#dataTable tfoot td{height:27px;padding:3px 5px;background:#e7f1fa}
#dataTable .group-row td{padding:3px 5px}
.content-shell[data-page="vehicles"] #dataTable{table-layout:fixed;min-width:2536px}
.content-shell[data-page="vehicles"]{--vehicle-hover-bg:#b8daf7}
.content-shell[data-page="vehicles"] #dataTable tbody tr:hover{background:var(--vehicle-hover-bg)}
/* Keep horizontal overflow inside the vehicle table; heading/KPIs are siblings. */
.content-shell[data-page="vehicles"]>main,
.content-shell[data-page="vehicles"] :is(.summary-bar,.table-surface,.workspace,.table-scroll){min-width:0}
@media screen and (min-width:701px){
 /* Matches the first four colgroup widths: 94 + 98 + 82 + 95 = 369px.
    Small screens retain the existing whole-table scroll so pinned cells cannot
    cover the entire viewport. Print remains an ordinary, unfrozen table. */
 .content-shell[data-page="vehicles"] .table-scroll{scroll-padding-left:369px;isolation:isolate}
 .content-shell[data-page="vehicles"] #dataTable{border-collapse:separate;border-spacing:0}
 .content-shell[data-page="vehicles"] #dataTable tr>:nth-child(1){--vehicle-pin-left:0px}
 .content-shell[data-page="vehicles"] #dataTable tr>:nth-child(2){--vehicle-pin-left:94px}
 .content-shell[data-page="vehicles"] #dataTable tr>:nth-child(3){--vehicle-pin-left:192px}
 .content-shell[data-page="vehicles"] #dataTable tr>:nth-child(4){--vehicle-pin-left:274px}
 .content-shell[data-page="vehicles"] #dataTable tr>:nth-child(-n+4){position:sticky;left:var(--vehicle-pin-left)}
 .content-shell[data-page="vehicles"] #dataTable tbody tr{--vehicle-row-bg:#fff}
 .content-shell[data-page="vehicles"] #dataTable tbody tr:nth-child(even){--vehicle-row-bg:#f5f9fd}
 .content-shell[data-page="vehicles"] #dataTable tbody tr.selected{--vehicle-row-bg:#d4e8fa}
 .content-shell[data-page="vehicles"] #dataTable tbody tr:hover{--vehicle-row-bg:var(--vehicle-hover-bg)}
 .content-shell[data-page="vehicles"] #dataTable tbody td:nth-child(-n+4){z-index:2;background:var(--vehicle-row-bg)}
 .content-shell[data-page="vehicles"] #dataTable tbody tr.selected td:first-child{box-shadow:inset 3px 0 #0878c5}
 .content-shell[data-page="vehicles"] #dataTable thead th{z-index:4}
 .content-shell[data-page="vehicles"] #dataTable thead th:nth-child(-n+4){z-index:5}
 .content-shell[data-page="vehicles"] #dataTable tfoot td{z-index:3}
 .content-shell[data-page="vehicles"] #dataTable tfoot td:nth-child(-n+4){z-index:4}
}
.detail-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;background:#fff}
.detail-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.detail-panel>.empty-detail{padding:32px 20px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.detail-panel .detail-section{padding:7px 12px;border:0}
.detail-panel .detail-section h3{font-size:11px;letter-spacing:0;color:#005797;margin:0 0 5px}
.detail-panel dl{margin:0}
.detail-panel .detail-field{font-size:12px;line-height:1.4;margin:2px 0;gap:10px;align-items:baseline}
.detail-field dt{color:#56758f;flex-shrink:0;max-width:52%}
.detail-field dd{color:#173b5c;min-width:0}
.vehicle-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px 7px;position:sticky;top:0;background:#fff;z-index:1;border-bottom:1px solid #e2ebf3}
.vehicle-panel-head h2{margin:0;font-size:22px;letter-spacing:.2px;color:#152d42;white-space:nowrap}
.vehicle-status{padding:5px 9px;font-size:11px;font-weight:600;background:#e9eef3;color:#38536b;text-align:center}
.vehicle-status.ready{background:#139354;color:#fff}.vehicle-status.rented{background:#fff0cc;color:#815700}.vehicle-status.service{background:#d78b10;color:#fff}.vehicle-status.closed{background:#e6ebf0;color:#536c80}
.vehicle-basics>strong{display:block;font-size:14px;color:#152d42;margin-bottom:3px}
.vehicle-basics p{font-size:12px;margin:2px 0;line-height:1.4}
.detail-buttons{flex:none;border-top:1px solid #bed2e5;background:#fff;padding:8px 10px;gap:5px;box-shadow:none}
.detail-buttons button{min-height:32px;font-size:12px;padding:6px 5px;border-radius:0;white-space:normal;line-height:1.2}
.detail-buttons .green{background:#159353;border-color:#117c46;color:#fff}
.detail-buttons .amber{background:#d18a10;border-color:#b97a0d;color:#fff}
.detail-buttons .red{background:#9d1e23;border-color:#89181d;color:#fff}
.detail-buttons .blue{background:#2c70b3;border-color:#24639f;color:#fff}
.detail-buttons .teal{background:#167b86;border-color:#126a74;color:#fff}
.detail-buttons button:hover:not(:disabled){filter:brightness(.94)}
.detail-buttons button:disabled{cursor:not-allowed;opacity:1;background:#f3f6f9;border-color:#d1dce7;color:#778da0;font-weight:400}
.detail-buttons button:not(:disabled).green,.detail-buttons button:not(:disabled).amber,.detail-buttons button:not(:disabled).red,.detail-buttons button:not(:disabled).blue,.detail-buttons button:not(:disabled).teal{font-weight:600}
.module-surface{flex:1;height:auto;min-height:0;border:0;border-radius:0}
/* Embedded modules own their page title and actions; do not frame them as a second page. */
.content-shell.module-page>main{padding:0}
.content-shell.module-page>main>.page-heading{display:none}
.module-page .module-surface{margin:0;border:0;border-radius:0;box-shadow:none}
.module-page #moduleFrame{display:block}
/* One Excel-style navigation surface, never a duplicated side menu. */
.navigation.excel-ribbon{position:relative;inset:auto;width:100%;height:92px;min-height:92px;flex:none;display:flex;flex-direction:row;align-items:stretch;transform:none;transition:none;z-index:2;border:0;border-bottom:1px solid #bfcfe0;background:#fff;box-shadow:0 1px 3px #214e7515;overflow:hidden}
.excel-ribbon .brand{flex:none;width:90px;padding:3px 6px;display:flex;flex-direction:column;justify-content:center;gap:3px;border:0;border-right:1px solid #d5e1ee;margin:4px 0;color:#0757a3;text-align:center}
.excel-ribbon .brand img{width:48px;height:48px}
.excel-ribbon .brand span{font-size:9px;letter-spacing:0;font-weight:600}
.excel-ribbon nav{display:flex;align-items:stretch;gap:0;padding:1px 4px 3px;overflow-x:auto;overflow-y:hidden;min-width:0;scrollbar-width:thin;scrollbar-color:#b4c8db #f4f7fb;overscroll-behavior-x:contain}
.ribbon-group{flex:1 0 auto;min-width:0;border-right:1px solid #d5e1ee;padding:0 5px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}
.ribbon-group:last-child{border-right:0}
.ribbon-group h2{font-size:9px;color:#0066c7;text-align:center;font-weight:500;letter-spacing:.25px;margin:0 0 1px;line-height:13px;white-space:nowrap}
.ribbon-items{display:flex;align-items:stretch;justify-content:center;gap:1px}
.excel-ribbon .ribbon-item{flex:none;min-width:55px;width:58px;min-height:64px;padding:2px 3px;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:2px;border:1px solid transparent;border-radius:2px;margin:0;background:transparent;color:#064d93;text-decoration:none;text-align:center;position:relative;font-size:11px;line-height:1.15;letter-spacing:0;white-space:normal}
.excel-ribbon .ribbon-item img{width:32px;height:32px;flex:none;object-fit:contain}
.excel-ribbon .ribbon-item span{display:block;width:100%;overflow-wrap:normal}
.excel-ribbon .ribbon-item:hover{background:#edf6ff;border-color:#a9ceef}
.excel-ribbon .ribbon-item.active{background:#e7f2fd;border-color:#8bbce8;font-weight:600}
.excel-ribbon .ribbon-item.active:before{content:"";inset:auto 7px 0;height:3px;width:auto;background:#0878c5}
.excel-ribbon .ribbon-primary,.excel-ribbon .ribbon-primary:hover{background:#09559a;color:white;border-color:#09559a}
.excel-ribbon .ribbon-primary img{display:none}
.excel-ribbon .ribbon-primary:before{content:"+";display:block;width:32px;height:32px;line-height:28px;font-size:36px;font-weight:300;color:white;flex:none}
.vehicle-details-dialog{width:min(760px,94vw);max-height:90dvh;overflow:hidden}
.vehicle-details-dialog[open]{display:flex;flex-direction:column}
.vehicle-details-dialog header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:#edf5fc;border-bottom:1px solid var(--border);gap:12px}
.vehicle-details-dialog h2{font-size:20px;margin:0}
.vehicle-details-dialog header button{font-size:22px;padding:2px 9px;border:0;background:none}
.vehicle-details-content{padding:12px 20px;overflow:auto;min-height:0}
.vehicle-details-content .detail-field{font-size:14px;padding:6px 0;border-bottom:1px solid #e7eef5}
.vehicle-details-content a{color:#0074bd}
.vehicle-details-dialog footer{padding:12px 18px;display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border)}
@media(min-width:1600px){.content-shell.has-detail{grid-template-columns:minmax(0,1fr) 338px}.excel-ribbon .ribbon-item{width:61px}}
@media(max-width:1250px){.content-shell.has-detail{grid-template-columns:minmax(0,1fr) 310px}.page-heading{flex-wrap:wrap;gap:7px}.page-heading h1{font-size:20px}.topbar-right{gap:9px}.page-heading .heading-search{flex:1}.kpi{padding-left:18px;padding-right:8px}.kpi:before{left:7px;width:4px}}
@media(max-width:960px) and (min-width:701px){.workspace{min-height:0;max-height:none}.table-scroll{max-height:none}.module-surface{height:auto;min-height:0}}
@media(max-width:700px){
 #application{height:auto;min-height:100dvh;overflow:visible}.main-shell{height:auto;min-height:100dvh}
 .content-shell,.content-shell.has-detail{display:flex;flex-direction:column;overflow:visible}.content-shell>main{overflow:visible;padding:8px 6px 0}.page-heading{flex-direction:row;align-items:center}.page-title{max-width:none}.page-actions{justify-content:flex-start;margin-left:0}.page-heading .heading-search{min-width:170px;flex-basis:50%}
 .summary-bar{flex-direction:column;gap:4px}.summary-tools{flex-direction:row;align-items:center;justify-content:space-between}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi:last-child:nth-child(odd){grid-column:1/-1}
 .workspace{display:flex;flex-direction:column;min-height:0;max-height:none;overflow:visible}
 .table-scroll{max-height:48dvh;min-height:180px}.detail-panel{max-height:74dvh;min-height:300px;border-left:0;border-top:1px solid var(--border)}
 .detail-panel:has(.vehicle-actions){height:74dvh}.detail-panel>.empty-detail{min-height:90px}
 .detail-buttons{position:sticky;bottom:0}.module-surface{height:78dvh;min-height:580px;flex:none}
 .vehicle-details-dialog footer button{font-size:13px}
}
@media print{#application,.main-shell{height:auto;overflow:visible}.content-shell,.content-shell.has-detail{display:block;overflow:visible}.content-shell>main{display:block;overflow:visible}.table-surface{display:block}.workspace{display:block;overflow:visible;max-height:none}.table-scroll{overflow:visible;max-height:none}.detail-panel,.vehicle-details-dialog,.heading-search,.filter-button,.summary-tools{display:none!important}.content-shell[data-page="vehicles"] #dataTable{min-width:0;table-layout:auto}#dataTable col{width:auto!important}#dataTable th,#dataTable tfoot td{position:static}#dataTable td{height:auto;font-size:9px;white-space:normal;padding:3px}}
/* Report semantics stay visible without changing the table density. */
#movementSummaryNote{margin-left:12px;color:#496984;font-size:11px;line-height:1.35;max-width:680px}
#reportCostNote{margin:0 8px 6px;color:#496984;font-size:11px;line-height:1.35}
#reportCostNote.has-issue{color:#a02c22}

/* Mobile summary: explicit width prevents shrink-to-content inside a column flexbox. */
@media screen and (max-width:700px){
 .summary-bar{width:100%;min-width:0;gap:8px}
 .summary-bar .kpis{width:100%;max-width:100%;flex:0 0 auto;align-self:stretch;margin:0;grid-template-columns:repeat(2,minmax(0,1fr));border-radius:12px}
 .summary-bar .kpi{height:64px;min-height:64px;padding:7px 10px 7px 19px;gap:2px}
 .summary-bar .kpi:before{top:12px;bottom:12px;left:8px;width:4px}
 .summary-bar .kpi:not(:first-child):after{top:8px;bottom:8px}
 .summary-bar .kpi small{font-size:10px;line-height:14px;overflow-wrap:anywhere}
 .summary-bar .kpi strong{font-size:21px;line-height:26px;margin:0}
 .summary-bar .kpi.money strong{font-size:clamp(12px,9cqw,20px)}
 .summary-tools{min-width:0;flex-wrap:wrap}
 .summary-tools button{min-height:36px}
 .page-heading{gap:8px}
 .page-heading .page-title{flex:0 0 100%}
 .page-heading .heading-search{flex:1 0 100%;width:100%;min-width:0;height:40px}
 .page-heading .heading-search input{font-size:16px}
 .page-heading>.filter-button{flex:1 1 140px;max-width:none;min-width:0;min-height:40px}
 .page-actions{width:100%;flex-wrap:wrap;gap:6px}
 .page-actions button{min-height:40px}
 .navigation.excel-ribbon{height:80px;min-height:80px}
 .excel-ribbon .brand{width:62px;padding:3px}
 .excel-ribbon .brand img{width:36px;height:36px}
 .excel-ribbon .brand span{font-size:8px}
 .excel-ribbon .ribbon-group{padding:0 3px}
 .excel-ribbon .ribbon-item{width:54px;min-width:54px;min-height:58px;font-size:10px}
 .excel-ribbon .ribbon-item img{width:28px;height:28px}
 .excel-ribbon .ribbon-primary:before{width:28px;height:28px;line-height:26px;font-size:31px}
 .table-scroll{width:100%;min-width:0;overflow:auto;overscroll-behavior-x:contain}
 .content-shell[data-page="tires"] .summary-bar .kpis{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr)}
}
