:root{color-scheme:light;--navy:#102a4c;--blue:#1769d2;--line:#d9e2ef;--bg:#f3f6fb;--green:#11895f;--red:#d92d20;--amber:#c87500;--text:#132238;--muted:#607087;--forecast:#8b96a6}
*{box-sizing:border-box}html{min-height:100%;scrollbar-width:none}html::-webkit-scrollbar{width:0;height:0}body{margin:0;min-height:100vh;font:14px/1.4 "Segoe UI",Arial,sans-serif;color:var(--text);background:var(--bg)}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.screen{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-card{width:min(470px,100%);padding:28px;border:1px solid var(--line);border-radius:22px;background:#fff;box-shadow:0 22px 60px rgba(16,42,76,.14)}
.brand{display:flex;align-items:center;gap:12px}.brand-logo{width:88px;height:46px;object-fit:contain;border-radius:6px;background:#fff}.brand-mark{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;color:#d7b85b;background:var(--navy);font-size:24px;font-weight:900}.brand strong{display:block;font-size:18px}.brand small{display:block;color:var(--muted)}h1{margin:22px 0 6px;font-size:27px}.subtle{margin:0 0 20px;color:var(--muted)}
label{display:block;margin:12px 0 5px;font-size:12px;font-style:italic;font-weight:650}input,select,textarea{width:100%;min-height:42px;padding:9px 11px;border:1px solid #bdcadb;border-radius:9px;color:var(--text);background:#fff;font-weight:400}textarea{min-height:78px;resize:vertical}input:focus,select:focus,textarea:focus{outline:3px solid rgba(23,105,210,.16);border-color:var(--blue)}
.btn{min-height:40px;padding:9px 15px;border:0;border-radius:9px;color:#fff;background:var(--blue);font-weight:750}.btn.secondary{color:#23344d;background:#dfe7f1}.btn.success{background:var(--green)}.btn.danger{background:var(--red)}.btn.warning{background:var(--amber)}.btn.ghost{color:#dceaff;background:#173b65;border:1px solid #31577f}.btn.small{min-height:32px;padding:5px 9px;font-size:12px}.btn.icon{width:38px;min-height:38px;padding:0;font-size:18px}.btn:disabled{cursor:not-allowed;opacity:.55}.wide{width:100%;margin-top:16px}.link-btn{border:0;background:transparent;color:var(--blue);padding:14px 0 0;font-weight:700}
.message{min-height:21px;margin:10px 0;color:var(--red);font-weight:650}.message.success{color:var(--green)}.message.inline{min-height:0;margin:0}.toast{position:fixed;top:76px;right:18px;z-index:120;width:min(410px,calc(100vw - 36px));padding:13px 16px;border-radius:10px;color:#fff;background:var(--red);box-shadow:0 12px 34px rgba(16,42,76,.28);font-weight:700}.toast.success{background:var(--green)}
header{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 18px;color:#fff;background:var(--navy);box-shadow:0 3px 14px rgba(16,42,76,.2)}header .brand-mark{width:38px;height:38px;background:#071a31}header .brand small{color:#b9c7d8}.header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.connection{display:flex;align-items:center;gap:7px;margin-right:4px;color:#d7e3f0;font-size:12px}.dot{width:9px;height:9px;border-radius:50%;background:var(--amber)}.dot.online{background:#31c48d}.dot.offline{background:#ff5a5f}
.layout{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100vh - 62px)}nav{padding:16px 10px;border-right:1px solid var(--line);background:#fff}nav button{width:100%;margin:2px 0;padding:10px 12px;border:0;border-radius:9px;text-align:left;color:#24405f;background:transparent;font-weight:700}nav button:hover{background:#edf4ff}nav button.active{color:#fff;background:var(--blue)}
main{min-width:0;padding:0 18px 18px}.page{display:none}.page.active{display:block}.panel{margin-top:14px;border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}.toolbar{display:flex;align-items:end;gap:12px;padding:10px 14px}.toolbar .field{min-width:170px}.toolbar label{margin-top:0}.toolbar-spacer{flex:1}.sync-info{color:var(--muted);font-size:12px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border-bottom:1px solid var(--line)}.panel-head h2{margin:0;font-size:20px}.tools{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.tools .search{width:min(280px,50vw)}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}.metric{padding:16px;border:1px solid var(--line);border-radius:14px;background:#fff}.metric small{display:block;color:var(--muted);font-weight:700}.metric strong{display:block;margin-top:6px;font-size:25px}.metric.good strong{color:var(--green)}.metric.warn strong{color:var(--amber)}.metric.bad strong{color:var(--red)}.metric .secondary-value{margin-top:4px;color:var(--forecast);font-size:12px}.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.dashboard-grid .table-scroll{overflow-x:hidden}.dashboard-grid table{min-width:0;table-layout:fixed}.dashboard-grid th,.dashboard-grid td{padding-right:8px;padding-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-grid th:nth-child(1),.dashboard-grid td:nth-child(1){width:23%}.dashboard-grid th:nth-child(2),.dashboard-grid td:nth-child(2){width:15%}.dashboard-grid th:nth-child(3),.dashboard-grid td:nth-child(3){width:13%}.dashboard-grid th:nth-child(4),.dashboard-grid td:nth-child(4),.dashboard-grid th:nth-child(5),.dashboard-grid td:nth-child(5),.dashboard-grid th:nth-child(6),.dashboard-grid td:nth-child(6){width:16.33%}.legend{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:12px}.actual-dot,.forecast-dot{display:inline-block;width:9px;height:9px;border-radius:50%}.actual-dot{background:#152238}.forecast-dot{background:#a2aab6}
.table-scroll{overflow:auto;max-height:calc(100vh - 215px)}.table-scroll.tall{max-height:calc(100vh - 285px)}table{width:100%;min-width:850px;border-collapse:separate;border-spacing:0}thead{position:sticky;top:0;z-index:2}th{padding:11px 10px;text-align:left;color:#fff;background:#24486f;font-size:12px;white-space:nowrap}td{padding:10px;border-bottom:1px solid #e5ebf3;vertical-align:top;overflow-wrap:anywhere}tbody tr:hover{background:#edf5ff}.name{font-weight:700}.muted{color:var(--muted)}.forecast{color:var(--forecast)}.money,.number{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.status{display:inline-block;padding:3px 7px;border-radius:999px;font-size:11px;font-weight:800}.status.ok{color:#096644;background:#e6f8f0}.status.open{color:#8b5100;background:#fff1d8}.status.cancelled{color:#a11a12;background:#ffe8e5}.empty{padding:38px;text-align:center;color:var(--muted)}
.matrix-scroll{max-height:calc(100vh - 190px)}.matrix-table{min-width:max-content}.matrix-table th:first-child,.matrix-table td:first-child{position:sticky;left:0;z-index:1;background:#fff}.matrix-table th:first-child{z-index:3;background:#24486f}.matrix-table td{min-width:130px}.matrix-table td:first-child{min-width:112px;font-weight:700}.matrix-table .future-row td{color:var(--forecast)}.matrix-table .matrix-total td{position:sticky;bottom:0;color:#fff;background:var(--navy);font-weight:800}.matrix-table .matrix-total td:first-child{background:var(--navy)}
.filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:12px 14px;border-bottom:1px solid var(--line);background:#f8fafc}.filters .field{min-width:155px}.filters .field.grow{flex:1;min-width:220px}.filters label{margin-top:0}.save-hint{color:var(--muted);font-size:12px}.adjust-table{min-width:1320px}.issue{color:var(--red);font-size:11px;font-weight:700}.override-mark{color:var(--blue);font-size:11px;font-weight:800}
.calculation-filters .field{width:240px}.calculation-table{min-width:1180px}.calculation-table .future-row td{color:var(--forecast)}
.trip-overview-filters .field:first-child{width:240px}.trip-overview-table{min-width:760px;table-layout:fixed}.trip-overview-table th:nth-child(1),.trip-overview-table td:nth-child(1){width:24%}.trip-overview-table th:nth-child(2),.trip-overview-table td:nth-child(2){width:58%}.trip-overview-table th:nth-child(3),.trip-overview-table td:nth-child(3){width:8%}.trip-overview-table th:nth-child(4),.trip-overview-table td:nth-child(4){width:10%}.trip-route{display:flex;align-items:center;gap:9px}.route-address{min-width:0;flex:1}.route-arrow{flex:0 0 auto;color:var(--blue);font-weight:900}.metric-save-status{flex:0 0 auto;color:var(--green);font-weight:700}.metric-input{min-width:70px;min-height:34px;padding:6px 8px;text-align:right;font-variant-numeric:tabular-nums}
.modal-backdrop{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:18px;background:rgba(5,19,38,.62)}.modal{width:min(980px,100%);max-height:93vh;overflow:auto;border-radius:18px;background:#fff;box-shadow:0 24px 80px rgba(0,0,0,.32)}.modal-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;color:#fff;background:var(--navy)}.modal-head h2{margin:0;font-size:20px}.modal-actions{display:flex;gap:8px}.modal-body{padding:18px;overflow:auto}.modal-message{padding:0 18px 8px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}.form-grid .full{grid-column:1/-1}.check-row{display:inline-flex;align-items:center;gap:9px;margin:12px 0 5px;font-style:normal;cursor:pointer}.check-row .check{flex:0 0 auto;width:18px;height:18px;min-height:0;margin:0;padding:0;accent-color:var(--blue)}.field-note{margin:4px 0 0;color:var(--muted);font-size:11px}.section-line{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px;padding-bottom:8px;border-bottom:1px solid var(--line)}.section-line h3{margin:0}.trip-rate-list{margin-top:7px}.trip-rate-row{display:grid;grid-template-columns:minmax(160px,1fr) minmax(230px,1.4fr) 120px 40px 40px;gap:8px;align-items:end;padding:8px 0;border-bottom:1px solid var(--line)}.trip-rate-row label{margin-top:0}.trip-rate-row .row-button{height:42px}.danger-icon{color:#fff;background:var(--red)}.plus-icon{color:#fff;background:var(--green)}
.import-panel p{padding:0 14px;color:var(--muted)}.import-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 14px}.file-picker{display:flex;align-items:center;gap:10px;width:min(560px,100%);margin:0;font-style:normal}.file-picker .btn{display:inline-flex;align-items:center;flex:0 0 auto}.file-name{min-width:0;overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.native-file{position:absolute;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;opacity:0;pointer-events:none}.import-panel>.message{padding:0 14px}
.dashboard-grid th:nth-child(1),.dashboard-grid td:nth-child(1){width:21%}.dashboard-grid th:nth-child(2),.dashboard-grid td:nth-child(2){width:14%}.dashboard-grid th:nth-child(n+3),.dashboard-grid td:nth-child(n+3){width:auto}.matrix-table th:not(:first-child){text-align:right}.detail-table{min-width:900px;table-layout:fixed}.detail-table th:nth-child(1),.detail-table td:nth-child(1){width:12%}.detail-table th:nth-child(2),.detail-table td:nth-child(2){width:48%}.detail-table th:nth-child(3),.detail-table td:nth-child(3){width:23%}.detail-table th:nth-child(4),.detail-table td:nth-child(4){width:17%}.detail-date{font-weight:750;white-space:nowrap}.detail-route-id{margin-top:2px;font-weight:700}.detail-time{margin-top:3px;color:var(--blue);font-weight:750}.detail-address{margin-top:2px;color:var(--muted);font-size:12px}.detail-filters .field{width:240px}
.busy{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:rgba(243,246,251,.8)}.busy-box{display:flex;align-items:center;gap:12px;padding:18px 22px;border-radius:14px;background:#fff;box-shadow:0 16px 50px rgba(16,42,76,.2);font-weight:750}.spinner{width:24px;height:24px;border:3px solid #c8d6e8;border-top-color:var(--blue);border-radius:50%;animation:spin .75s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
@page detail{size:A4 portrait;margin:12mm}.detail-panel{page:detail}@page payroll{size:A4 portrait;margin:12mm}.payroll-panel{page:payroll}.payroll-statement{padding:16px 18px 4px}.payroll-letter-head{display:flex;justify-content:space-between;gap:30px;min-height:155px}.payroll-letter-head>div:first-child{display:flex;flex-direction:column}.payroll-letter-head>div:first-child>strong{font-size:22px}.payroll-recipient{display:flex;flex-direction:column;margin-top:34px}.payroll-logo{text-align:right;font-size:24px;font-weight:900;letter-spacing:.5px}.payroll-logo small{display:block;color:#c9a640;font:italic 28px Georgia,serif}.payroll-meta{display:flex;justify-content:space-between;gap:20px;margin:14px 0 24px}.payroll-statement>h3{margin:0 0 8px;padding:7px;text-align:center;background:#e9e5ef;font-size:20px}.payroll-warning{margin:6px 0;padding:8px;color:#8b5100;background:#fff1d8;font-weight:700}.payroll-wage,.payroll-deductions table{min-width:0;table-layout:fixed}.payroll-wage th,.payroll-deductions th{color:var(--text);background:transparent}.payroll-wage th,.payroll-wage td,.payroll-deductions th,.payroll-deductions td{padding:6px 4px;border:0}.payroll-subtotal td{border-top:1px solid #d9d2e5;background:#e9e5ef;font-weight:800}.payroll-subtotal td:first-child{text-align:right}.payroll-deductions{margin-top:16px}.payroll-deductions table{width:60%}.payroll-totals{width:50%;margin:12px 0 0 auto}.payroll-totals>div{display:flex;justify-content:space-between;gap:12px;margin:5px 0;padding:5px 8px;background:#d9e8f7}.payroll-totals .deduction{color:var(--red)}.payroll-totals .payout{padding:8px;font-size:17px}.payroll-bank{display:flex;flex-direction:column;gap:13px;margin:30px 0 18px}.payroll-bank small{margin-top:8px}.payroll-list-title{margin:14px 14px 6px}.payroll-cards{grid-template-columns:repeat(3,minmax(0,1fr));padding:0 14px}.payroll-table{min-width:800px;table-layout:fixed}.payroll-table th:nth-child(1),.payroll-table td:nth-child(1){width:13%}.payroll-table th:nth-child(2),.payroll-table td:nth-child(2){width:17%}.payroll-table th:nth-child(3),.payroll-table td:nth-child(3){width:24%}.payroll-table th:nth-child(4),.payroll-table td:nth-child(4){width:31%}.payroll-table th:nth-child(5),.payroll-table td:nth-child(5){width:15%}.payroll-table td{vertical-align:middle;white-space:nowrap}.payroll-time{color:var(--blue);font-weight:750;font-variant-numeric:tabular-nums}.payroll-filters .field{width:240px}
@media print{#page-payroll .panel{break-inside:auto}#page-details .detail-table,#page-payroll .payroll-table{font-size:10pt!important}#page-details th,#page-details td,#page-payroll .payroll-table th,#page-payroll .payroll-table td{padding:6px 7px}.payroll-statement{padding:0}.payroll-letter-head{min-height:42mm}.payroll-cards{display:none!important}.payroll-list-title{margin:7mm 0 2mm}.payroll-statement>h3{font-size:14pt}.payroll-logo{font-size:17pt}.payroll-letter-head>div:first-child>strong{font-size:15pt}.payroll-wage,.payroll-deductions table{font-size:9.5pt!important}.payroll-bank{margin-top:8mm}}
@media(max-width:1100px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}
@media(max-width:850px){.layout{grid-template-columns:1fr}nav{position:sticky;top:62px;z-index:10;display:flex;overflow:auto;border-right:0;border-bottom:1px solid var(--line);padding:8px}nav button{width:auto;white-space:nowrap}main{padding:0 10px 10px}.toolbar{align-items:stretch;flex-direction:column}.toolbar .field{width:100%}.toolbar-spacer{display:none}.panel-head{align-items:flex-start;flex-direction:column}.form-grid{grid-template-columns:1fr}.trip-rate-row{min-width:760px}.modal-body{overflow:auto}header{align-items:flex-start}.toast{top:68px;right:10px}.dashboard-grid .table-scroll{overflow-x:auto}.dashboard-grid table{min-width:700px;table-layout:auto}}
@media(max-width:560px){.cards{grid-template-columns:1fr}.header-actions .connection{width:100%}.header-actions .btn{font-size:11px;padding:7px}.metric strong{font-size:22px}}
@media print{@page{size:A4 landscape;margin:9mm}body{min-height:0;color:#000;background:#fff;font-size:9pt}#configScreen,#loginScreen,header,nav,.toolbar,.tools,.toast,.modal-backdrop,.busy,button,.filters{display:none!important}#appScreen{display:block!important}.layout{display:block;min-height:0}main{padding:0}.page{display:none!important}.page.active{display:block!important}.panel{overflow:visible;border:0;border-radius:0;break-inside:avoid}#page-monthly .panel{break-inside:auto}.panel-head{display:block;padding:0 0 4mm;border:0}.panel-head h2{font-size:15pt}.table-scroll{overflow:visible;max-height:none}table{min-width:0;font-size:8pt}thead{position:static;display:table-header-group}th{color:#000;background:#e7edf4!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}th,td{padding:4px 5px}tr{break-inside:avoid}.matrix-table .matrix-total td{position:static;break-inside:avoid;color:#000;background:#e7edf4!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}.cards{grid-template-columns:repeat(4,1fr)}.metric{padding:8px}.metric strong{font-size:16pt}}

/* Finance R1.7 layout and print refinements */
html{scrollbar-width:none}html::-webkit-scrollbar{width:0;height:0}
nav{position:sticky;top:62px;align-self:start;height:calc(100vh - 62px);overflow-y:auto}
#contextFilters{display:flex;align-items:flex-end;min-width:0}#contextFilters>.filters{padding:0;border:0;background:transparent}
.matrix-panes{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:0 12px 12px}.matrix-panes .table-scroll{overflow:hidden}.matrix-panes table{min-width:0;table-layout:fixed}.matrix-table th:not(:first-child){text-align:right}
.detail-table{min-width:1050px;table-layout:fixed;font-size:14px}.detail-table th:nth-child(1),.detail-table td:nth-child(1){width:10%}.detail-table th:nth-child(2),.detail-table td:nth-child(2){width:14%}.detail-table th:nth-child(3),.detail-table td:nth-child(3){width:42%}.detail-table th:nth-child(4),.detail-table td:nth-child(4){width:19%}.detail-table th:nth-child(5),.detail-table td:nth-child(5){width:15%}.detail-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.detail-address{color:var(--text);font-size:13px}
.driver-trips-table{min-width:1100px;table-layout:fixed}.driver-trips-table th:nth-child(1){width:10%}.driver-trips-table th:nth-child(2){width:15%}.driver-trips-table th:nth-child(3){width:35%}.driver-trips-table th:nth-child(4){width:16%}.driver-trips-table th:nth-child(5){width:14%}.driver-trips-table th:nth-child(6){width:10%}.driver-trips-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.driver-ledger-trigger{cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}.driver-ledger-table{min-width:760px}.driver-ledger-table tfoot td{font-weight:800;background:#e7edf4}
.driver-account-open .modal{width:min(1320px,100%)}.driver-account-modal .account-modal-meta{margin:0 0 10px;color:var(--muted);font-weight:700}.driver-account-modal .account-cards{grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 14px}.driver-account-modal .driver-ledger-table{min-width:1050px}.driver-account-modal .driver-ledger-table th:nth-child(1){width:10%}.driver-account-modal .driver-ledger-table th:nth-child(2){width:13%}.driver-account-modal .driver-ledger-table th:nth-child(3){width:10%}.driver-account-modal .driver-ledger-table th:nth-child(4),.driver-account-modal .driver-ledger-table th:nth-child(5),.driver-account-modal .driver-ledger-table th:nth-child(6){width:12%}.driver-account-modal .driver-ledger-table th:nth-child(7){width:31%}
.payroll-logo{text-align:right}.payroll-logo img{display:block;width:235px;max-height:150px;object-fit:contain;object-position:right top}
.inline-warning{margin:0 0 12px;padding:9px 12px;border:1px solid #e8ad45;border-radius:9px;color:#7b4800;background:#fff6e6;font-weight:700}
.finance-overview-split{display:grid;grid-template-columns:minmax(430px,1fr) minmax(480px,1fr);gap:14px}.finance-overview-split>.panel{min-width:0}.finance-month-table{min-width:0}.finance-month-row{cursor:pointer}.finance-month-row.selected{background:#e3f0ff;box-shadow:inset 4px 0 var(--blue)}.finance-month-row .balance-positive{color:var(--green);font-weight:850}.finance-month-row .balance-negative{color:var(--red);font-weight:850}.finance-tree{max-height:calc(100vh - 285px);overflow:auto;padding:10px 14px 16px}.finance-tree details{border-bottom:1px solid #e6ecf4}.finance-tree summary{display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none}.finance-tree summary::-webkit-details-marker{display:none}.finance-tree summary:before{content:"›";color:var(--blue);font-size:20px;font-weight:900;transition:transform .15s}.finance-tree details[open]>summary:before{transform:rotate(90deg)}.finance-tree .tree-main{padding:11px 4px;font-size:16px;font-weight:850}.finance-tree .tree-sub{margin-left:22px;padding:9px 4px;font-size:14px;font-weight:750}.finance-tree .tree-segment{display:flex;justify-content:space-between;gap:12px;margin-left:50px;padding:7px 4px;color:#41536a;font-size:13px;font-style:italic}.finance-tree .tree-amount{margin-left:auto;white-space:nowrap;font-style:normal;font-variant-numeric:tabular-nums}.finance-tree-empty{padding:36px 12px;text-align:center;color:var(--muted)}.category-preview{padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:#f6f9fd;font-weight:700}
#page-overview>.cards{grid-template-columns:repeat(8,minmax(0,1fr));gap:7px}#page-overview>.cards .metric{padding:8px 10px;border-radius:10px}#page-overview>.cards .metric small{font-size:10px}#page-overview>.cards .metric strong{margin-top:2px;font-size:15px}#page-overview>.cards .secondary-value{font-size:9px}
@media(max-width:850px){nav{height:auto}.matrix-panes{grid-template-columns:1fr}#contextFilters{display:block}}
@media(max-width:1100px){.finance-overview-split{grid-template-columns:1fr}}
@media print{
  @page{size:A4 landscape;margin:12mm}
  .payroll-screen-title{display:none!important}
  .payroll-statement{min-height:calc(267mm - 1px);padding:0;break-after:page}
  .payroll-list-title{margin:0 0 3mm;font-size:15pt}
  .payroll-logo img{width:55mm;max-height:34mm}
  #page-details .detail-table{font-size:10.5pt!important;table-layout:fixed}
  #page-details .detail-table th,#page-details .detail-table td{padding:5px 4px;white-space:nowrap}
  #page-details .detail-address{font-size:9pt}
  .matrix-panes{gap:5mm;padding:0}
  .matrix-panes .matrix-table{font-size:7.2pt!important}
  .matrix-panes th,.matrix-panes td{padding:1.5px 3px}
}

/* Dashboard tables: keep labels and amounts readable on screen. */
@media screen{
  .dashboard-grid{grid-template-columns:1fr}
  .dashboard-grid .table-scroll{overflow-x:hidden}
  .dashboard-grid table{width:100%;min-width:0!important;table-layout:fixed}
  .dashboard-grid th,.dashboard-grid td{overflow:hidden;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
  .dashboard-grid th{line-height:1.25;vertical-align:middle}
  .dashboard-grid th:nth-child(1),.dashboard-grid td:nth-child(1){width:18%}
  .dashboard-grid th:nth-child(2),.dashboard-grid td:nth-child(2){width:15%}
  .dashboard-grid th:nth-child(3),.dashboard-grid td:nth-child(3){width:14%}
  .dashboard-grid th:nth-child(4),.dashboard-grid td:nth-child(4){width:15%}
  .dashboard-grid th:nth-child(5),.dashboard-grid td:nth-child(5){width:12%}
  .dashboard-grid th:nth-child(6),.dashboard-grid td:nth-child(6){width:13%}
  .dashboard-grid th:nth-child(7),.dashboard-grid td:nth-child(7){width:13%}
  .dashboard-grid td.number,.dashboard-grid td.money{white-space:normal;font-variant-numeric:tabular-nums}
  .dashboard-grid td.forecast{color:var(--forecast);font-weight:400}
  .finance-overview-split{grid-template-columns:1fr}
  .finance-overview-split .table-scroll{overflow-x:hidden}
  .finance-month-table{width:100%;min-width:0!important;table-layout:fixed}
  .finance-month-table th,.finance-month-table td{overflow:hidden;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
  .finance-month-table th:nth-child(1),.finance-month-table td:nth-child(1){width:28%}
  .finance-month-table th:nth-child(2),.finance-month-table td:nth-child(2),.finance-month-table th:nth-child(3),.finance-month-table td:nth-child(3),.finance-month-table th:nth-child(4),.finance-month-table td:nth-child(4){width:24%}
}

/* R2.0.6: Fahrtdetails kilometre/süre özeti ve bağımsız baskı seçenekleri */
.detail-summary-cards{grid-template-columns:repeat(3,minmax(0,1fr));padding:0 14px 12px}
.print-options{display:flex;align-items:center;gap:16px;min-width:410px;margin:0;padding:4px 12px 7px;border:1px solid var(--line);border-radius:9px}
.print-options legend{padding:0 5px;color:var(--muted);font-size:11px;font-weight:750}
.print-options .check-row{margin:0;white-space:nowrap}
.detail-table{min-width:1180px}
.detail-table th:nth-child(1),.detail-table td:nth-child(1){width:9%}
.detail-table th:nth-child(2),.detail-table td:nth-child(2){width:13%}
.detail-table th:nth-child(3),.detail-table td:nth-child(3){width:35%}
.detail-table th:nth-child(4),.detail-table td:nth-child(4){width:16%}
.detail-table th:nth-child(5),.detail-table td:nth-child(5){width:14%}
.detail-table th:nth-child(6),.detail-table td:nth-child(6){width:6%}
.detail-table th:nth-child(7),.detail-table td:nth-child(7){width:7%}

@media(max-width:850px){.print-options{min-width:0;width:100%;align-items:flex-start;flex-direction:column;gap:5px}.detail-summary-cards{grid-template-columns:1fr}}

@media print{
  #page-details .detail-summary-cards{grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 4mm;padding:0}
  body.print-hide-detail-km #page-details .detail-km-column,body.print-hide-detail-km #page-details .detail-km-total{display:none!important}
  body.print-hide-detail-duration #page-details .detail-duration-column,body.print-hide-detail-duration #page-details .detail-duration-total{display:none!important}
}

/* Finance R2.1: unified invoices, compact outputs and driver current account */
.invoice-account-heading{margin-top:10px}
.invoice-account-cards{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:8px}
.incoming-list-panel{margin-top:8px}
.incoming-compact-table{min-width:680px;table-layout:fixed}
.incoming-compact-table th:nth-child(1){width:27%}.incoming-compact-table th:nth-child(2){width:20%}.incoming-compact-table th:nth-child(3){width:16%}.incoming-compact-table th:nth-child(4){width:18%}.incoming-compact-table th:nth-child(5){width:19%}
.incoming-invoice-row{cursor:pointer;outline:none}.incoming-invoice-row:focus{box-shadow:inset 0 0 0 3px rgba(23,105,210,.22)}
.table-help{margin:0;padding:8px 12px;color:var(--muted);font-size:12px}
.company-register{padding:0}.company-register>summary{cursor:pointer;padding:11px 14px;font-weight:800}.company-register>summary .muted{float:right;font-weight:600}
.monthly-grand-total{display:flex;align-items:center;justify-content:flex-end;gap:24px;margin:0 12px 12px;padding:11px 15px;border-radius:9px;color:#fff;background:var(--navy);font-size:16px;font-weight:850}.monthly-grand-total strong{min-width:130px;text-align:right;font-size:19px;font-variant-numeric:tabular-nums}
.detail-table tfoot td{border-top:2px solid #7b8ca1;background:#eef3f8;font-weight:850}.cancelled-trip-row{color:#8c3b35;background:#fff5f4}
.payroll-output-actions{display:flex;justify-content:flex-end;padding:12px 14px}
.print-only-statement{display:none}
.driver-current-table{min-width:1180px;table-layout:fixed}.driver-current-table th:nth-child(1){width:18%}.driver-current-table th:nth-child(2){width:10%}.driver-current-table th:nth-child(3){width:10%}.driver-current-table th:nth-child(n+4){width:10.33%}
.driver-current-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 14px}.driver-current-form .form-field{max-width:none}.modal:has(.driver-current-form){width:min(1220px,100%)}

@media(max-width:900px){.driver-current-form{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-account-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.driver-current-form{grid-template-columns:1fr}.invoice-account-cards{grid-template-columns:1fr}}

@media print{
  @page detail{size:A4 portrait;margin:12mm}
  @page payroll{size:A4 portrait;margin:12mm}
  @page drivertrips{size:A4 landscape;margin:12mm}
  @page tripentry{size:A4 portrait;margin:12mm}
  #page-details{page:detail}
  #page-payroll{page:payroll}
  #page-driver-trips{page:drivertrips}
  #page-trips{page:tripentry}
  #page-payroll .print-only-statement{display:block!important}
  #page-details .detail-summary-cards{grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 4mm;padding:0}
  #page-details .detail-table{font-size:8.6pt!important}
  #page-details .detail-table th,#page-details .detail-table td{padding:4px 3px;white-space:normal}
  #page-details .detail-table th:nth-child(1),#page-details .detail-table td:nth-child(1){width:11%}
  #page-details .detail-table th:nth-child(2),#page-details .detail-table td:nth-child(2){width:13%}
  #page-details .detail-table th:nth-child(3),#page-details .detail-table td:nth-child(3){width:35%}
  #page-details .detail-table th:nth-child(4),#page-details .detail-table td:nth-child(4){width:17%}
  #page-details .detail-table th:nth-child(5),#page-details .detail-table td:nth-child(5){width:8%}
  #page-details .detail-table th:nth-child(6),#page-details .detail-table td:nth-child(6){width:8%}
  #page-details .detail-table th:nth-child(7),#page-details .detail-table td:nth-child(7){width:8%}
  #page-monthly .monthly-grand-total{margin:4mm 0 0;color:#000;background:#e7edf4!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}
}

/* Finance V2 Alpha 4: tablet-first macro-to-micro workspace */
:root{--gold:#c5a24a;--surface-soft:#f7f9fc;--navy-deep:#081d35}
body{font-size:16px;line-height:1.5}
label{margin-top:10px;font-size:14px;font-style:normal;font-weight:700}
input,select,textarea{min-height:46px;padding:10px 12px;font-size:16px}
.btn{min-height:44px;padding:10px 16px}
.btn.small{min-height:38px;padding:7px 11px;font-size:14px}
header{background:linear-gradient(110deg,var(--navy-deep),var(--navy))}
.layout{grid-template-columns:232px minmax(0,1fr)}
nav{top:70px;height:calc(100vh - 70px)}
.layout{min-height:calc(100vh - 70px)}
nav{padding:12px 10px 20px}
.nav-group{display:block;margin:15px 12px 5px;color:#75869b;font-size:12px;font-weight:850;letter-spacing:.09em;text-transform:uppercase}
nav .nav-group:first-child{margin-top:2px}
nav button{min-height:42px;margin:2px 0;padding:9px 12px;font-size:14px}
nav button.active{box-shadow:inset 3px 0 var(--gold)}
main{padding:0 20px 22px}
.toolbar{min-height:70px;padding:10px 16px}
.toolbar .field.compact{width:11rem;min-width:11rem}
.toolbar .field.compact input[type="month"]{width:10.5rem}
.sync-info{font-size:13px}
.overview-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-top:20px;padding:0 2px}
.overview-heading h1{margin:2px 0 0;font-size:30px;line-height:1.15;letter-spacing:-.025em}
.eyebrow,.panel-kicker{display:block;color:#4c6e94;font-size:12px;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.period-badge{display:inline-flex;align-items:center;min-height:38px;padding:8px 12px;border:1px solid #bdcde0;border-radius:999px;color:#294767;background:#fff;font-size:14px;font-weight:750;white-space:nowrap}
#page-overview>.overview-kpis{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.overview-kpis .metric{position:relative;min-height:112px;padding:14px 15px;border-radius:12px;box-shadow:0 5px 18px rgba(16,42,76,.05)}
.overview-kpis .metric:nth-child(-n+4){border-top:4px solid var(--blue);background:linear-gradient(180deg,#fff,#f9fbfe)}
.overview-kpis .metric:nth-child(3){border-top-color:var(--gold)}
.overview-kpis .metric small{font-size:14px}
.overview-kpis .metric strong{margin-top:5px;font-size:23px;letter-spacing:-.02em}
.overview-kpis .metric .secondary-value{font-size:12px}
.panel-head>div{min-width:0}.panel-head .panel-kicker+ h2{margin-top:2px}
.finance-overview-split{grid-template-columns:minmax(420px,.9fr) minmax(470px,1.1fr)}
.finance-month-table{min-width:760px}.finance-month-row{outline:none}.finance-month-row:focus{box-shadow:inset 0 0 0 3px rgba(23,105,210,.24)}
.finance-month-row.selected{background:#e7f1ff;box-shadow:inset 5px 0 var(--blue)}
.finance-tree{max-height:430px;font-size:15px}
.driver-name-button{max-width:100%;padding:3px 0;border:0;border-bottom:1px dashed #6b8caf;color:#105faf;background:transparent;font-weight:800;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.driver-name-button:hover,.driver-name-button:focus{color:#073f79;border-bottom-color:#073f79;outline:none}
.form-grid{gap:4px 16px;align-items:start}
.form-grid .form-field{width:100%}.form-grid>div:not(.full){max-width:27rem}.form-grid .field-short{max-width:14rem}.form-grid .field-medium{max-width:27rem}.form-grid .field-long{max-width:none}
.filters input[type="date"],.filters input[type="month"],.filters input[type="time"]{width:12rem}
.filters input[type="number"]{width:9rem}
.filters input[type="search"]{max-width:22rem}
.filters select{max-width:20rem}
th{font-size:13px}td{font-size:14px}

@media(max-width:1180px){
  .layout{grid-template-columns:204px minmax(0,1fr)}
  #page-overview>.overview-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .finance-overview-split{grid-template-columns:1fr}
}
@media(max-width:850px){
  body{font-size:16px}
  .layout{grid-template-columns:1fr}
  header{position:relative}
  nav{top:0;height:auto;padding:7px 8px}
  .nav-group{display:none}
  nav button{min-height:46px;padding:10px 14px}
  main{padding:0 12px 16px}
  .toolbar{align-items:flex-end;flex-direction:row;flex-wrap:wrap}
  .toolbar .field,.toolbar .field.compact{width:11rem;min-width:11rem}
  #contextFilters{flex:1;min-width:16rem}
  .overview-heading{align-items:flex-start;flex-direction:column;margin-top:16px}
  .overview-heading h1{font-size:27px}
  .panel-head{align-items:flex-start;flex-direction:row}
}
@media(max-width:600px){
  #page-overview>.overview-kpis{grid-template-columns:1fr}
  .overview-heading .period-badge{white-space:normal}
  .form-grid{grid-template-columns:1fr}.form-grid .field-short,.form-grid .field-medium{max-width:100%}
}
@media(pointer:coarse){
  input,select,textarea,.btn,nav button{min-height:48px}
  .btn.small{min-height:44px}
  .finance-month-row td{padding-top:13px;padding-bottom:13px}
  .driver-name-button{min-height:40px;padding:8px 0}
}

/* Finance V2 Alpha 5: LOS 4 / LOS 5 invoice workspace */
@page invoice{size:A4 portrait;margin:12mm}
.invoice-controls-panel{overflow:visible}
.invoice-controls-panel .tools{align-items:center}
.invoice-filters .invoice-group-field{width:14rem}.invoice-filters .invoice-number-field{width:11rem}.invoice-filters .invoice-date-field{width:12rem}.invoice-filters .invoice-vat-field{width:7rem}
.invoice-filters .invoice-number-field input{width:10.5rem}.invoice-filters .invoice-vat-field input{width:6.5rem}
.invoice-meta-grid{display:grid;grid-template-columns:minmax(15rem,1.2fr) minmax(14rem,1fr) minmax(10rem,.7fr);gap:14px;padding:4px 14px 12px}
.invoice-meta-grid .field{min-width:0}.invoice-source-note{margin:0;padding:0 14px 6px;color:var(--muted);font-size:13px}.invoice-message{padding:0 14px 8px}
.invoice-summary-cards{grid-template-columns:repeat(4,minmax(0,1fr));max-width:1120px;margin-right:auto;margin-left:auto}
.invoice-document{margin-top:16px;padding:22px;border-radius:16px;background:#dfe5ed;overflow:auto}
.invoice-empty{display:grid;place-items:center;min-height:320px;color:var(--muted);background:#fff;font-weight:750}
.invoice-document-inner{display:grid;gap:24px;justify-items:center}
.invoice-sheet{page:invoice;position:relative;width:210mm;max-width:100%;min-height:297mm;padding:12mm;color:#111;background:#fff;box-shadow:0 12px 38px rgba(8,29,53,.18);font-family:Calibri,"Segoe UI",Arial,sans-serif}
.invoice-draft .invoice-cover:after{content:"ENTWURF";position:absolute;top:46%;left:50%;z-index:0;transform:translate(-50%,-50%) rotate(-28deg);color:rgba(217,45,32,.095);font-size:58pt;font-weight:900;letter-spacing:.08em;pointer-events:none}
.invoice-cover>*{position:relative;z-index:1}
.invoice-letter-head{display:grid;grid-template-columns:1fr 1fr;gap:9mm;min-height:59mm}
.invoice-company{display:flex;align-items:flex-start;flex-direction:column;font-size:11pt}.invoice-company img{width:48mm;height:19mm;margin:0 0 2mm;object-fit:contain;object-position:left center}.invoice-company strong{font-size:13pt}.invoice-company .invoice-contact-spacer{height:5mm}.invoice-email{color:#c2a13a}.invoice-web{color:#00a1df}
.invoice-recipient{display:grid;grid-template-columns:31mm 1fr;grid-auto-rows:min-content;gap:1.5mm 3mm;padding:5mm;background:#e7e7e7;font-size:10pt}.invoice-recipient>div{display:contents}.invoice-recipient span{grid-column:1}.invoice-recipient strong,.invoice-recipient b{grid-column:2;font-weight:400}.invoice-recipient strong{font-size:12pt;font-weight:700}.invoice-recipient-gap{display:block!important;grid-column:1/-1;height:3mm}
.invoice-title-band{margin:0 -1px;padding:1.2mm 2mm;color:#fff;background:#888;font-size:25pt;font-weight:850;line-height:1.05}
.invoice-description-head{display:flex;justify-content:space-between;padding:1mm 0;border-bottom:1px solid #111;font-size:8pt}
.invoice-service{min-height:95mm;padding-top:1.5mm;border-right:1px solid #111;font-size:11pt}.invoice-service>strong{display:block;margin-bottom:9mm;font-size:12.5pt}.invoice-service-row{display:grid;grid-template-columns:46mm 1fr;margin:1.2mm 0}.invoice-service-row b{font-weight:400}.invoice-service-amount{grid-template-columns:46mm 1fr 38mm;margin-top:2mm}.invoice-service-amount b{text-align:right;padding-right:2mm}
.invoice-totals{width:78mm;margin-left:auto;padding:2mm 0;background:#e7e7e7;font-size:10.5pt}.invoice-totals>div{display:grid;grid-template-columns:1fr 31mm;gap:3mm;padding:.8mm 1.5mm}.invoice-totals span{text-align:right}.invoice-totals strong{text-align:right;font-weight:700}
.invoice-grand-total{display:grid;grid-template-columns:1fr 45mm;align-items:center;margin-top:1mm;padding:1.5mm 2mm;color:#fff;background:#aaa;font-size:13pt;font-weight:850}.invoice-grand-total span{text-align:right}.invoice-grand-total strong{text-align:right}
.invoice-footer{padding-top:6mm;font-size:10.5pt}.invoice-footer p{margin:0 0 6mm}.invoice-footer p:nth-child(2){margin-bottom:5mm}.invoice-footer p:nth-child(3),.invoice-footer p:nth-child(4),.invoice-footer p:nth-child(5){margin-bottom:4mm}
.invoice-detail-pages{padding-top:9mm}.invoice-detail-table{min-width:0;table-layout:fixed;border-collapse:collapse;font-size:8.5pt}.invoice-detail-table thead{position:static}.invoice-detail-table th{padding:2.1mm 1.4mm;color:#111;background:#e7e7e7;border-bottom:1px solid #999;white-space:normal}.invoice-detail-table td{padding:1.8mm 1.4mm;border-bottom:1px solid #d6d6d6;vertical-align:top;overflow-wrap:break-word}.invoice-detail-table th:nth-child(1),.invoice-detail-table td:nth-child(1){width:11%}.invoice-detail-table th:nth-child(2),.invoice-detail-table td:nth-child(2){width:16%}.invoice-detail-table th:nth-child(3),.invoice-detail-table td:nth-child(3),.invoice-detail-table th:nth-child(4),.invoice-detail-table td:nth-child(4){width:24%}.invoice-detail-table th:nth-child(5),.invoice-detail-table td:nth-child(5){width:7%}.invoice-detail-table th:nth-child(6),.invoice-detail-table td:nth-child(6){width:9%}.invoice-detail-table th:nth-child(7),.invoice-detail-table td:nth-child(7){width:9%}.invoice-detail-table .invoice-detail-heading th{padding:0 0 4mm;text-align:left;color:#111;background:#fff;border-bottom:2px solid #888}.invoice-detail-heading span{display:block;font-size:18pt}.invoice-detail-heading small{display:block;margin-top:1mm;color:#555;font-size:10pt;font-weight:700}.invoice-detail-table tfoot td{padding-top:2.4mm;border-top:2px solid #777;border-bottom:0;background:#e7e7e7;font-weight:850}.invoice-detail-table tfoot td:first-child{text-align:right}

@media(max-width:1000px){.invoice-meta-grid{grid-template-columns:1fr 1fr}.invoice-meta-grid .field:last-child{max-width:14rem}.invoice-summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-document{padding:12px}}
@media(max-width:650px){.invoice-meta-grid{grid-template-columns:1fr}.invoice-meta-grid .field:last-child{max-width:none}.invoice-summary-cards{grid-template-columns:1fr}.invoice-document{margin-right:-12px;margin-left:-12px;padding:8px;border-radius:0}.invoice-sheet{min-width:760px}}
@media(pointer:coarse){.invoice-controls-panel .btn{min-height:48px}.invoice-detail-table td{padding-top:2.2mm;padding-bottom:2.2mm}}

@media print{
  body.invoice-printing{font-size:10pt}
  body.invoice-printing .screen-only{display:none!important}
  body.invoice-printing #page-invoices{display:block!important}
  body.invoice-printing .invoice-document{margin:0;padding:0;background:#fff;overflow:visible}
  body.invoice-printing .invoice-document-inner{display:block}
  body.invoice-printing .invoice-sheet{width:100%;max-width:none;min-height:273mm;padding:0;box-shadow:none}
  body.invoice-printing .invoice-cover{break-after:page;page-break-after:always}
  body.invoice-printing .invoice-detail-pages{padding-top:0}
  body.invoice-printing .invoice-detail-table{font-size:8pt!important}
  body.invoice-printing .invoice-detail-table thead{display:table-header-group}
  body.invoice-printing .invoice-detail-table tfoot{display:table-row-group}
  body.invoice-printing .invoice-detail-table tr{break-inside:avoid;page-break-inside:avoid}
  body.invoice-printing .invoice-detail-table th{color:#111;background:#e7e7e7!important}
  body.invoice-printing .invoice-detail-table .invoice-detail-heading th{background:#fff!important}
}

/* Finance V2 Alpha 6: compact top area */
header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;padding:5px 12px}
header>.brand{grid-column:1;min-width:0}
header .brand-logo{width:64px;height:34px}
header .brand strong{font-size:15px;line-height:1.1}
header .brand small{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-period{grid-column:2;justify-self:center}
.header-period .field{width:10.5rem}
.header-period label{margin:0 0 2px;color:#c9d7e7;font-size:10px;font-style:normal;line-height:1.05;text-align:center}
.header-period input{width:10.5rem;min-height:34px;padding:4px 8px;border-color:#506b89;border-radius:7px;font-size:14px}
.header-actions{grid-column:3;justify-self:end;min-width:0;gap:5px;flex-wrap:nowrap}
.header-actions .connection{margin-right:1px;font-size:10px;white-space:nowrap}
.header-actions .btn{min-height:34px;padding:5px 8px;border-radius:7px;font-size:11px;white-space:nowrap}
.layout{min-height:calc(100vh - 50px)}
nav{top:50px;height:calc(100vh - 50px)}
main{padding-right:14px;padding-left:14px}
.toolbar{min-height:34px;margin-top:5px;padding:3px 8px}
.toolbar .message,.toolbar .sync-info{font-size:11px}
.panel{margin-top:8px;border-radius:10px}
.panel-head{gap:8px;padding:8px 10px}
.panel-head h2{font-size:17px;line-height:1.2}
.panel-kicker{font-size:9px;line-height:1.1}
.overview-heading{align-items:center;margin-top:8px;gap:10px}
.overview-heading .eyebrow{display:none}
.overview-heading h1{margin:0;font-size:21px;line-height:1.1}
.period-badge{min-height:28px;padding:4px 8px;font-size:11px}
.cards{grid-auto-flow:column;grid-auto-columns:minmax(112px,1fr);grid-template-columns:none!important;gap:6px;margin-top:7px;padding-bottom:2px;overflow-x:auto}
.metric{min-height:56px;padding:5px 7px;border-radius:8px}
.metric small{font-size:10px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metric strong{margin-top:1px;font-size:15px;line-height:1.15;white-space:nowrap}
.metric .secondary-value{margin-top:1px;font-size:9px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page-overview>.overview-kpis{grid-template-columns:repeat(8,minmax(112px,1fr))!important;gap:6px}
.overview-kpis .metric{min-height:56px;padding:5px 7px;border-top-width:2px;border-radius:8px;box-shadow:none}
.overview-kpis .metric small{font-size:10px}
.overview-kpis .metric strong{margin-top:1px;font-size:15px}
.overview-kpis .metric .secondary-value{font-size:9px}
.finance-overview-split{gap:8px}

@media(max-width:1180px){
  #page-overview>.overview-kpis{grid-template-columns:repeat(8,minmax(112px,1fr))!important}
  .header-actions .connection{display:none}
  .header-actions .btn{padding-right:6px;padding-left:6px;font-size:10px}
}
@media(max-width:850px){
  header{position:relative;grid-template-columns:minmax(56px,1fr) auto minmax(56px,1fr);padding:5px 8px}
  header .brand-logo{width:52px;height:32px}
  header .brand>div{display:none}
  .header-actions{grid-column:1/-1;grid-row:2;justify-self:center;flex-wrap:wrap}
  .header-period{grid-column:2;grid-row:1}
  nav{top:0;height:auto}
  main{padding-right:10px;padding-left:10px}
  .toolbar{align-items:center;flex-direction:row;min-height:32px}
  #contextFilters{min-width:0}
  .overview-heading{align-items:center;flex-direction:row;margin-top:7px}
  .overview-heading h1{font-size:19px}
  .panel-head{align-items:center;flex-direction:row}
}
@media(max-width:600px){
  #page-overview>.overview-kpis{grid-template-columns:repeat(8,minmax(108px,1fr))!important}
  .overview-heading .period-badge{white-space:nowrap}
}
@media(pointer:coarse){
  .header-period input,.header-actions .btn{min-height:38px}
  .metric{min-height:58px}
}
@media print{
  .cards,#page-overview>.overview-kpis{grid-auto-flow:row;grid-template-columns:repeat(4,minmax(0,1fr))!important;overflow:visible}
}

/* Finance V2 Alpha 7: invoice ledger and payment finalization */
.invoice-status{margin-left:7px;vertical-align:2px;font-size:11px}
.invoice-actions{justify-content:flex-end}
.invoice-actions .btn{min-height:38px;padding:7px 10px;font-size:12px}
.invoice-record-meta{min-height:18px;margin:0;padding:0 14px 3px;color:#36516f;font-size:12px;font-weight:750}
.invoice-ledger-panel{margin-top:8px}
.invoice-ledger-filters{gap:8px;padding:6px 10px}
.invoice-ledger-filters .field:first-child{width:15rem;min-width:12rem}
.invoice-ledger-filters .field:last-child{width:13rem;min-width:11rem}
.invoice-ledger-filters label{margin:0 0 3px;font-size:12px}
.invoice-ledger-filters input,.invoice-ledger-filters select{min-height:38px;padding:6px 9px;font-size:14px}
.invoice-ledger-scroll{max-height:230px}
.invoice-ledger-table{min-width:980px;table-layout:fixed}
.invoice-ledger-table th,.invoice-ledger-table td{padding-top:7px;padding-bottom:7px}
.invoice-ledger-table th:nth-child(1){width:14%}.invoice-ledger-table th:nth-child(2){width:12%}.invoice-ledger-table th:nth-child(3){width:10%}.invoice-ledger-table th:nth-child(4){width:15%}.invoice-ledger-table th:nth-child(5){width:7%}.invoice-ledger-table th:nth-child(6),.invoice-ledger-table th:nth-child(7),.invoice-ledger-table th:nth-child(8){width:10%}.invoice-ledger-table th:nth-child(9){width:12%}
.invoice-ledger-selected{background:#e7f1ff;box-shadow:inset 4px 0 var(--blue)}
.money.good{color:var(--green);font-weight:750}.money.bad{color:var(--red);font-weight:750}

@media(max-width:850px){
  .invoice-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}
  .invoice-actions .btn{flex:0 0 auto}
  .invoice-ledger-filters{align-items:flex-end;flex-direction:row}
}

/* Finance V2 Alpha 9: incoming invoices, companies and linked payments */
.incoming-controls-panel{margin-bottom:8px}.incoming-filters{gap:8px;padding:6px 10px}.incoming-filters .field{min-width:12rem}.incoming-filters .field.grow{min-width:18rem}.incoming-controls-panel .tools{display:flex;gap:6px;flex-wrap:wrap}.incoming-controls-panel .btn{min-height:38px}.incoming-controls-panel~.panel{margin-top:8px}.incoming-controls-panel~.panel table{min-width:900px}.incoming-company-iban{font-variant-numeric:tabular-nums;white-space:nowrap}.linked-payment-note{padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#f6f9fd;color:var(--muted);font-size:13px}.incoming-paid{color:var(--green);font-weight:700}.incoming-open{color:var(--orange);font-weight:700}
@media(max-width:600px){
  .invoice-ledger-filters{flex-wrap:wrap}
  .invoice-ledger-filters .field:first-child,.invoice-ledger-filters .field:last-child{flex:1 1 100%;width:100%;max-width:none}
}

/* Driver trip list: keep the printout inside one A4 landscape page width. */
@media print{
  @page{size:A4 landscape;margin:12mm}
  #page-driver-trips .driver-trips-panel{break-inside:auto}
  #page-driver-trips .table-scroll{height:auto!important;max-height:none!important;overflow:visible!important}
  #page-driver-trips .driver-trips-table{width:100%;min-width:0!important;table-layout:fixed;font-size:8.5pt}
  #page-driver-trips .driver-trips-table thead{display:table-header-group;position:static}
  #page-driver-trips .driver-trips-table th,
  #page-driver-trips .driver-trips-table td{padding:4px 5px;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;vertical-align:top}
  #page-driver-trips .driver-trips-table th:nth-child(1),#page-driver-trips .driver-trips-table td:nth-child(1){width:10%}
  #page-driver-trips .driver-trips-table th:nth-child(2),#page-driver-trips .driver-trips-table td:nth-child(2){width:16%}
  #page-driver-trips .driver-trips-table th:nth-child(3),#page-driver-trips .driver-trips-table td:nth-child(3){width:34%}
  #page-driver-trips .driver-trips-table th:nth-child(4),#page-driver-trips .driver-trips-table td:nth-child(4){width:16%}
  #page-driver-trips .driver-trips-table th:nth-child(5),#page-driver-trips .driver-trips-table td:nth-child(5){width:14%}
  #page-driver-trips .driver-trips-table th:nth-child(6),#page-driver-trips .driver-trips-table td:nth-child(6){width:10%}
}

/* R2.1 final precedence overrides */
#page-invoices .incoming-compact-table{min-width:680px}
#page-details .detail-summary-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.print-filter-summary{display:none}
@media print{
  @page detail{size:A4 portrait;margin:12mm}
  @page payroll{size:A4 portrait;margin:12mm}
  @page tripentry{size:A4 portrait;margin:12mm}
  @page drivertrips{size:A4 landscape;margin:12mm}
  #page-details{page:detail}
  #page-payroll{page:payroll}
  #page-trips{page:tripentry}
  #page-driver-trips{page:drivertrips}
  #page-payroll .print-only-statement{display:block!important}
  #page-details .detail-summary-cards{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .print-filter-summary{display:block!important;margin:0 0 5mm;padding:0 0 2mm;border-bottom:1px solid #777;color:#111;font-size:9pt;font-weight:700}
}

