*{box-sizing:border-box}
body{margin:0;font:14px/1.45 Arial,Helvetica,sans-serif;color:#222;background:#f5f3f8}
a{color:#5b2a86}
header.top{background:#4a148c;color:#fff;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;padding:8px 16px}
header.top a{color:#fff;text-decoration:none}
.brand{font-weight:bold;font-size:17px;margin-right:8px}
header nav{display:flex;flex-wrap:wrap;gap:2px}
header nav a{padding:6px 10px;border-radius:4px}
header nav a.on,header nav a:hover{background:#6a1b9a}
.who{margin-left:auto;font-size:12px;opacity:.9}
.menu-btn{display:none;background:#6a1b9a;color:#fff;border:0;padding:6px 10px;border-radius:4px}
main{max-width:1250px;margin:0 auto;padding:16px}
h1{font-size:21px;color:#4a148c;margin:4px 0 14px}
h2{font-size:16px;color:#4a148c;margin:18px 0 8px}
.card{background:#fff;border:1px solid #e1d8ec;border-radius:6px;padding:14px;margin-bottom:14px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:10px 14px}
label{display:block;font-size:12px;color:#555;margin-bottom:3px}
input,select,textarea{width:100%;padding:7px;border:1px solid #c9bdd8;border-radius:4px;font:inherit;background:#fff}
input[type=number]{text-align:right}
input.in{background:#fffbe6}
input:focus,select:focus{outline:2px solid #9575cd}
button,.btn{display:inline-block;background:#6a1b9a;color:#fff;border:0;border-radius:4px;padding:8px 14px;font:inherit;cursor:pointer;text-decoration:none}
.btn-light{background:#ede7f6;color:#4a148c}
.btn-red{background:#c62828}
.btn-green{background:#2e7d32}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{border:1px solid #e1d8ec;padding:5px 7px;text-align:left;vertical-align:top}
th{background:#6a1b9a;color:#fff;font-weight:normal;font-size:12px}
td.n,th.n{text-align:right;white-space:nowrap}
tr.tot td{font-weight:bold;background:#f3e5f5}
tr.muted td{color:#aaa}
.table-wrap{overflow-x:auto}
.flash{padding:10px 12px;border-radius:4px;margin-bottom:12px}
.flash-ok{background:#e8f5e9;border:1px solid #a5d6a7}
.flash-err{background:#ffebee;border:1px solid #ef9a9a}
.flash-warn{background:#fff8e1;border:1px solid #ffe082}
.badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:12px}
.badge-loaded{background:#fff3e0;color:#e65100}.badge-returned{background:#e3f2fd;color:#1565c0}.badge-settled{background:#e8f5e9;color:#2e7d32}
.big{font-size:22px;font-weight:bold}
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;margin-bottom:14px}
a.kpi{text-decoration:none;color:inherit}
.kpi{background:#fff;border:1px solid #e1d8ec;border-radius:6px;padding:10px}
.kpi .lab{font-size:12px;color:#666}.kpi .v{font-size:19px;font-weight:bold;color:#4a148c}
.neg{color:#c62828}.pos{color:#2e7d32}
.flag{background:#c62828;color:#fff;padding:1px 6px;border-radius:3px;font-size:12px}
.filters{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin-bottom:12px}
.filters>div{min-width:150px}
.hint{font-size:12px;color:#777}
.login{max-width:360px;margin:60px auto}
.sum-box{background:#f3e5f5;border:1px solid #ce93d8;border-radius:6px;padding:12px;margin-top:10px}
.sum-box div{display:flex;justify-content:space-between;padding:2px 0}
.sum-box .line{border-top:1px solid #ce93d8;margin-top:4px;padding-top:6px;font-weight:bold}
header nav{align-items:center}
.dd{position:relative}
.dd-btn{background:none;color:#fff;padding:6px 10px;border-radius:4px}
.dd-btn.on,.dd:hover .dd-btn,.dd:focus-within .dd-btn{background:#6a1b9a}
.dd-menu{display:none;position:absolute;top:100%;left:0;z-index:20;background:#fff;border:1px solid #d1c4e9;border-radius:4px;min-width:220px;box-shadow:0 4px 14px rgba(0,0,0,.15);padding:4px 0}
.dd:hover .dd-menu,.dd:focus-within .dd-menu{display:block}
.dd-menu a{display:block;color:#4a148c!important;padding:7px 12px;border-radius:0}
.dd-menu a:hover,.dd-menu a.on{background:#ede7f6}
.chart{width:100%;height:auto;max-height:260px}
.chart .grid{stroke:#ece6f3;stroke-width:1}.chart .base{stroke:#bbb;stroke-width:1}
.chart .ax{font-size:10px;fill:#777}
.chart .mark{fill:#7b3fb0}.chart .hit{fill:transparent}
.chart .bar:hover .mark{fill:#4a148c}
.hbar{display:flex;align-items:center;gap:8px}.hbar .track{flex:1;background:#f3eef8;border-radius:3px;height:12px}
.hbar .fill{background:#7b3fb0;height:12px;border-radius:3px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.alert{color:#b71c1c;font-weight:bold}
td input,td select{padding:4px;min-width:70px}
.lines td{padding:3px}
@media (max-width:760px){
  .two{grid-template-columns:1fr}
  .dd-menu{display:block;position:static;box-shadow:none;border:0;background:transparent;padding:0 0 0 12px}
  .dd-menu a{color:#fff!important}
  .dd-btn{text-align:left;width:100%}
  .menu-btn{display:block}
  header nav{display:none;width:100%;flex-direction:column}
  body.nav-open header nav{display:flex}
  .who{margin-left:0;width:100%}
  main{padding:10px}
  th,td{padding:4px}
}
@media print{header.top,.filters,.actions,.no-print{display:none!important}body{background:#fff}main{max-width:none}}
.actions form{display:inline;margin:0}
.quick .qgrp{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}.quick .qgrp .hint{min-width:90px}.quick .btn{padding:5px 10px}
.two.mp{grid-template-columns:minmax(0,2.4fr) minmax(0,1fr)}
table.compact td,table.compact th{padding:2px 6px;font-size:13px;line-height:1.25}
table.compact td input{padding:2px 4px;font-size:13px}
@media (max-width:760px){.two.mp{grid-template-columns:1fr}}
/* letterhead on reports, invoices and receipts */
.letterhead{display:flex;gap:16px;align-items:center;border-bottom:2px solid #4a148c;padding-bottom:10px;margin-bottom:14px;background:#fff}
.letterhead img{max-height:72px;max-width:150px;object-fit:contain}.letterhead .lh-name{font-size:20px;font-weight:700;color:#4a148c}
.letterhead .lh-doc{margin-left:auto;text-align:right;font-size:18px;font-weight:700;letter-spacing:.5px}.letterhead .lh-doc small{font-size:13px;font-weight:600}
.print-only{display:none!important}
.doc-parties{display:flex;gap:30px;flex-wrap:wrap;margin:6px 0 14px}.doc-parties .party{min-width:220px;flex:1}
.doc{background:#fff;border:1px solid #e3e6ea;border-radius:10px;padding:18px;max-width:900px}
@media print{.print-only{display:flex!important}.screen-only{display:none!important}.doc{border:0;padding:0}main>h1{font-size:16px}}
/* terms & conditions */
details.terms{background:#fafafa;border:1px solid #e3e6ea;border-radius:8px;padding:8px 12px;margin:12px 0}details.terms summary{cursor:pointer;font-weight:600}
.terms-text{max-height:320px;overflow:auto;font-size:13px;line-height:1.45;margin-top:8px}
/* ratings and vehicles */
.stars{color:#f9a825;letter-spacing:1px}.stars .off{color:#d7dbdf}
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.vcard{position:relative;font-size:14px;color:#222;margin:0;background:#fff;border:2px solid #e3e6ea;border-radius:10px;overflow:hidden;display:flex;flex-direction:column;cursor:pointer;font-weight:normal}
.vcard:has(input:checked){border-color:#6a1b9a;box-shadow:0 0 0 2px #e1bee7}.vcard input{position:absolute;margin:8px;width:auto}
.vcard img,.vcard .noimg{width:100%;height:130px;object-fit:cover;background:#f1f3f5;display:flex;align-items:center;justify-content:center;color:#90a4ae}.vcard .b{padding:10px 12px;line-height:1.5}
.badge{display:inline-block;padding:2px 9px;border-radius:10px;font-size:12px;font-weight:600}.b-new{background:#e3f2fd;color:#0d47a1}
.flag-warn{background:#fff3e0;color:#e65100;padding:1px 7px;border-radius:8px;font-size:12px}.flag-bad{background:#ffebee;color:#b71c1c;padding:1px 7px;border-radius:8px;font-size:12px}
.btn-wa{background:#1fa855;color:#fff}.btn-wa:hover{background:#178a45}

/* version 17: menu down the left side */
.shell{display:flex;align-items:flex-start}
aside.side{flex:0 0 235px;width:235px;background:#fff;border-right:1px solid #e1d8ec;position:sticky;top:0;height:100vh;overflow-y:auto;padding:8px 0 30px}
.shell>main{flex:1;min-width:0;margin:0;max-width:none}
aside.side a{text-decoration:none}
aside.side .top-link,aside.side summary{display:block;padding:9px 16px;color:#4a148c;font-weight:bold;cursor:pointer;user-select:none;border-left:3px solid transparent}
aside.side summary{list-style:none}
aside.side summary::-webkit-details-marker{display:none}
aside.side summary::after{content:'\25B8';float:right;color:#9575cd}
aside.side details[open]>summary::after{content:'\25BE'}
aside.side .top-link:hover,aside.side summary:hover{background:#f3eef9}
aside.side summary.on{background:#f3eef9}
aside.side .sg a{display:block;padding:6px 14px 6px 28px;color:#333;font-size:13px;border-left:3px solid transparent}
aside.side .sg a:hover{background:#f6f2fb;color:#4a148c}
aside.side a.on{background:#ede7f6;color:#4a148c;font-weight:bold;border-left-color:#6a1b9a}
aside.side details[open]{padding-bottom:4px;border-bottom:1px solid #f0eaf6}
@media (max-width:760px){
  .shell{display:block}
  aside.side{display:none;position:static;width:auto;height:auto;border-right:0;border-bottom:1px solid #e1d8ec}
  body.nav-open aside.side{display:block}
}
@media print{aside.side{display:none!important}.shell{display:block}}
.flag-ok{background:#e8f5e9;color:#1b5e20;padding:1px 7px;border-radius:8px;font-size:12px}

/* version 19: one centred main panel per page; everything on it has the same width */
main{max-width:none}
.page{max-width:1200px;margin:0 auto;background:#fff;border:1px solid #e1d8ec;border-radius:10px;padding:20px 24px 24px;box-shadow:0 2px 12px rgba(74,20,140,.07)}
.page>*{margin-left:0;margin-right:0}
.page .card,.page .table-wrap,.page table,.page form,.page .flash,.page .sum-box,.page .kpis,.page .doc,.page>div{width:100%;max-width:none!important;box-sizing:border-box}
.page .grid input,.page .grid select,.page .grid textarea{width:100%}
.page .card{background:#fbf9fd;border-color:#e6def0}
.page .card .card{background:#fff}
.page .table-wrap{border:1px solid #e6def0;border-radius:6px;margin-bottom:14px}
.page .table-wrap table{border:0}
.page table{margin-bottom:0}
.page>h1{border-bottom:2px solid #ede7f6;padding-bottom:10px;margin-bottom:16px}
.page>p.hint,.page>.hint{margin-top:10px}
@media (max-width:760px){.page{padding:12px;border-radius:0;border-left:0;border-right:0;box-shadow:none}}
@media print{.page{border:0;box-shadow:none;padding:0;max-width:none}.page .table-wrap{border:0}.page .card{background:#fff}}
.page.page-narrow{max-width:520px;margin-top:30px}
.page .login{margin:0}
body>.flash{max-width:1200px;margin:12px auto 0!important}
/* version 21: product photos (up to 2) — click a small photo to show it large */
.pgal{position:relative}
.pgal img.pmain{width:100%;height:150px;object-fit:cover;display:block;background:#f1f3f5}
.pthumbs{position:absolute;right:6px;bottom:6px;display:flex;gap:4px}
.pgal .pthumbs img{width:34px;height:34px;object-fit:cover;border:2px solid #fff;border-radius:5px;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.25)}
@media print{.page:has(.doc)>h1{display:none}}
@media print{.page:has(>.letterhead:not(.print-only))>h1{display:none}}
/* version 30: printed documents — single line spacing, tighter rows and gaps (the screen is unchanged) */
@media print{
  body{line-height:1.15}
  th,td{padding:3px 6px}
  p{margin:5px 0}
  .letterhead{padding-bottom:6px;margin-bottom:8px}
  .doc-parties{margin:4px 0 8px;gap:20px}
  .page>h1,.page h2,.page h3{margin:8px 0 4px}
  .table-wrap{margin-bottom:8px!important}
  .terms-text,.vcard .b{line-height:1.15}
}
/* version 31: no browser headers / footers (date, title, web address, page numbers) on printouts.
   Chrome / Edge leave them out when the page margin is 0; the white margin is put back inside the page,
   on every printed page (box-decoration-break: clone). */
@page{size:auto;margin:0}
@media print{
  html,body{margin:0}
  .page,main{padding:0!important}
  .shell>main,body>main{padding:12mm 13mm!important;-webkit-box-decoration-break:clone;box-decoration-break:clone}
}
