:root{font-family:Inter,"Segoe UI",sans-serif;color:#202722;background:#f5f6f3;font-size:14px;--ink:#202722;--green:#245b44;--line:#dce2da;--muted:#607065;--surface:#fff}
*{box-sizing:border-box}
body{margin:0}
button,input,select,textarea{font:inherit}
button,input,select,textarea{border:1px solid var(--line);border-radius:8px;color:var(--ink);background:white;padding:9px 12px}
button{cursor:pointer;font-weight:600}
button:hover{background:#edf1eb}
button:disabled{cursor:wait;opacity:.6}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #408365;outline-offset:2px}
input,select,textarea{min-width:0;width:100%}
textarea{resize:vertical}
.primary{color:white;background:var(--green);border-color:var(--green)}
.primary:hover{background:#194431}
.login{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 30% 10%,#dcebe0,transparent 65%),#f4f5ef}
.login form{width:min(100%,410px);padding:34px}
.login h1{margin-top:32px}
.login .primary{width:100%}
.login label+label{margin-top:14px}
.sidebar{position:fixed;inset:0 auto 0 0;width:222px;display:flex;flex-direction:column;background:#182b22;color:#fff;padding:22px 15px;overflow:auto}
.brand{display:flex;gap:12px;align-items:center;font-size:22px;font-weight:750}
.brand span{display:grid;place-items:center;background:#b9d8c2;color:#153d2c;border-radius:11px;width:42px;height:42px;font-size:24px}
.brand small,.profile small{display:block;font-size:12px;font-weight:500;opacity:.8}
.sidebar .brand{padding:2px 10px 26px}
.sidebar nav{display:grid;gap:3px}
.sidebar nav button{text-align:left;background:transparent;color:#dfeae2;border-color:transparent}
.sidebar nav button:hover,.sidebar nav .active{background:#325342;color:white}
.profile{margin-top:auto;padding:22px 10px 2px;line-height:1.55}
.profile button{display:block;margin-top:10px;color:white;background:transparent;border-color:#6f8578}
.main{margin-left:222px;padding:36px clamp(18px,4vw,58px)}
header,.actions,.toolbar,.dialog-head,.dialog-foot,.section-head{display:flex;align-items:center;gap:10px}
header,.dialog-head,.dialog-foot,.section-head{justify-content:space-between}
header{margin-bottom:24px}
.header-actions{flex-wrap:wrap;justify-content:flex-end;margin-inline-start:auto}
.section-help{display:grid;place-items:center;width:37px;height:37px;padding:0;border-radius:50%;font-size:17px}
.section-help-dialog{width:min(620px,calc(100% - 24px))}
.section-help-list{margin:0;padding-inline-start:22px;line-height:1.5}
.section-help-list li+li{margin-top:9px}
.sms-recipients{max-height:240px;overflow:auto;display:grid;gap:8px;margin:12px 0}
h1,h2,h3{margin:0 0 10px}
h1{font-size:30px;letter-spacing:-.035em}
h2{font-size:22px}
h3{font-size:15px}
header h1,.dialog-head h2,.section-head h3{margin:0}
header p,.muted,small{color:var(--muted)}
.brand small,.profile small{color:inherit}
header p{margin:5px 0 0}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:15px;box-shadow:0 8px 24px #20272207}
.toolbar{padding:15px}
.toolbar input{max-width:360px}
.toolbar select{max-width:175px}
.toolbar .report-date{width:min(190px,45%);font-size:12px;color:var(--muted)}
.report-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;padding:15px}
.report-summary article{display:grid;gap:6px;padding:16px;border:1px solid var(--line);border-radius:10px;background:#f8faf7}
.report-summary strong{font-size:22px}
.expense-group{margin:18px 0}.expense-group h2{font-size:17px;margin:0 0 10px}.expense-order{max-width:620px;margin:16px 0}
.report-note{padding:0 15px}
.material-check{min-width:230px;padding:3px 0;font-size:12px}.material-check.ok{color:#245b44}.material-check.pending{color:#936414}.material-check.missing{color:#a43b32}
.report-graph{padding:12px 15px 18px}
.report-graph h2{font-size:17px}
.report-chart{display:grid;grid-template-columns:repeat(var(--days),minmax(34px,1fr));gap:8px;overflow-x:auto;padding:10px 2px 4px}
.report-chart-day{text-align:center;font-size:11px;color:var(--muted)}
.report-chart-track{height:150px;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid var(--line);background:linear-gradient(to bottom,transparent 49.5%,#edf1eb 50%,transparent 50.5%)}
.report-chart-track span{display:block;width:min(28px,80%);min-height:0;background:#347454;border-radius:4px 4px 0 0}
.report-chart-day small{display:block;white-space:nowrap;margin-top:5px}
.rate-note{padding:0 15px;margin-bottom:0}
.rate-categories{display:grid;gap:10px;padding:15px}.rate-category{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#fff}.rate-category summary{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;list-style:none;background:#f8faf7}.rate-category summary::-webkit-details-marker{display:none}.rate-category summary::before{content:'›';color:var(--accent);font-size:22px;line-height:14px;transition:transform .15s}.rate-category[open] summary::before{transform:rotate(90deg)}.rate-category summary strong{font-size:15px}.rate-category summary span{margin-left:auto;color:var(--muted);font-size:12px}.rate-category table{min-width:620px}.rate-category th:first-child,.rate-category td:first-child{width:30%}
.rate-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px;padding:12px 15px}
.rate-actions .error{margin:0 auto 0 0}
.scroll{overflow:auto}
table{border-collapse:collapse;width:100%}
th,td{text-align:left;vertical-align:middle;padding:12px 15px;border-top:1px solid #e7ebe5}
th{background:#f1f4ef;font-size:12px;color:#47594e;white-space:nowrap}
td small{display:block;white-space:nowrap}
td button{white-space:nowrap}
.empty{padding:26px 15px;color:var(--muted);margin:0}
.badge{display:inline-block;border-radius:20px;background:#f0ede0;color:#655620;padding:4px 9px;font-size:12px;white-space:nowrap}
.badge.good{background:#e1f1e5;color:#225d3c}
.badge.off{background:#f1e2e2;color:#802c2c}
dialog{width:min(900px,calc(100% - 24px));max-height:90vh;padding:0;border:1px solid var(--line);border-radius:16px;color:var(--ink)}
dialog::backdrop{background:#15261cb0}
dialog form{display:flex;flex-direction:column;max-height:90vh}
.dialog-head,.dialog-foot{padding:14px 20px}
.dialog-head{border-bottom:1px solid var(--line)}
.dialog-foot{border-top:1px solid var(--line)}
.dialog-foot .actions{margin-left:auto}
.dialog-body{padding:18px 20px;overflow:auto}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.wide{grid-column:1/-1}
fieldset{border:0;margin:12px 0 0;padding:0;min-width:0}
label{display:grid;gap:6px;font-weight:600}
.material-field{padding:11px;border:1px solid #d4b36c;border-radius:10px;background:#fff8e8;color:#59451b}
.material-field input{background:#fff;border-color:#d8c89f}
.check{display:flex;align-items:center;gap:8px;font-weight:500}
.check input{width:auto}
.checks,.history{display:flex;flex-wrap:wrap;gap:8px 15px}
.order-scopes{margin-top:8px}
.order-scopes .check{padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:#f8faf7}
.order-scopes .check:has(input:checked){border-color:#347454;background:#e8f2eb;color:#204b35}
.order-scopes input{width:auto}
.history{margin:10px 0}
.error{color:#a52b24;margin:10px 0}
.error:empty,.muted:empty,[hidden]{display:none!important}
.dialog-body section{margin-top:18px;border-top:1px solid var(--line);padding-top:15px}
.section-head{margin-bottom:10px}
.amount{font-size:16px;font-weight:700;margin-bottom:10px}
#printout{display:none}
.car-tree,.purchase{padding:12px 16px}
.car-tree details{margin:5px 0;border:1px solid var(--line);border-radius:8px}
.car-tree summary{cursor:pointer;padding:10px 12px;font-weight:650}
.car-tree summary small{margin-left:8px}
.car-tree details>div{padding:0 10px 6px}
.car-card{margin:4px}
.car-structure-editor{display:grid;gap:5px;max-height:58vh;overflow:auto;padding:5px 4px}
.car-structure-row{display:grid;grid-template-columns:28px 92px minmax(140px,1fr) auto auto auto;align-items:center;gap:8px;padding:6px;border:1px solid var(--line);border-radius:8px;background:#fff}
.car-structure-row[data-level="1"]{margin-left:24px;background:#f8faf7}
.car-structure-row[data-level="2"]{margin-left:48px;background:#f1f6f1}
.car-structure-row[data-level="3"]{margin-left:72px;background:#eaf1ec}
.car-structure-row input{min-width:0}
.car-structure-row.dragging{opacity:.45}
.car-structure-row.drop-target{outline:2px solid #286749}
.car-drag-handle{cursor:grab;text-align:center;font-size:20px;color:var(--muted);touch-action:none}
.car-node-kind{font-size:12px;color:var(--muted)}
.car-structure-row small{white-space:nowrap}
.dialog-foot:has(#add-car-make){justify-content:space-between}
.seat-photos{display:flex;gap:12px;flex-wrap:wrap}
.seat-photos figure{margin:0 0 10px;display:grid;gap:4px}
.seat-photos img{width:140px;height:100px;object-fit:cover;border-radius:8px}
.order-photo-actions{margin-top:12px;flex-wrap:wrap}
.problem-notice{padding:10px;border:1px solid #e5ad62;background:#fff4df;border-radius:8px}
.problem-notice button{margin-inline-start:8px}
.problem-description{white-space:pre-wrap;overflow-wrap:anywhere}
.roll-layout{display:grid;grid-template-columns:minmax(135px,220px) minmax(0,1fr);border-top:1px solid var(--line)}
.roll-skus{border-right:1px solid var(--line);padding:12px}
.roll-skus>div{display:grid;gap:4px;max-height:62vh;overflow:auto;margin-top:8px}
.roll-skus button{text-align:left;overflow-wrap:anywhere}
.roll-skus button[aria-pressed=true]{background:#245b44;color:#fff}
.roll-zero{padding:12px 15px}
.roll-negative{background:#fff1ef;color:#8a2929}
.roll-results [data-roll-row]{cursor:pointer}
.roll-results .roll-selected{outline:2px solid #4e8566;outline-offset:-2px}
#roll-usage{border-top:1px solid var(--line);margin-top:12px}
#roll-usage h3{margin:12px 15px}
#roll-usage .roll-order-0{background:#fff}
#roll-usage .roll-order-1{background:#edf4ef}
@media(max-width:560px){.roll-layout{grid-template-columns:minmax(95px,32%) minmax(0,1fr)}.roll-skus{padding:7px}}
.callback{background:#ad2626;border-color:#ad2626;color:white}
.callback:hover{background:#8e1e1e}
.order-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr));gap:12px}
.order-gallery img{display:block;width:100%;max-height:360px;object-fit:contain;background:#f1f4ef;border-radius:8px}
.purchase+.purchase,.purchase-row{border-top:1px solid var(--line)}
.purchase-row{padding:9px 0;display:flex;align-items:center;justify-content:space-between;gap:10px}
a.button{display:inline-block;text-decoration:none;padding:9px 12px;border-radius:8px;font-weight:600}
.timeline{display:grid;grid-template-columns:max-content 1fr;gap:7px 14px}
.timeline dd{margin:0}
.barcode{width:65mm;max-width:100%;height:auto;margin-bottom:8px}
.contract{font:11pt/1.38 "Segoe UI",sans-serif;color:#111;overflow-wrap:anywhere}
.contract p{margin:.45em 0}
.contract table{margin:.7em 0}
.contract th,.contract td{font-size:10pt;white-space:normal;padding:4px 7px;border:1px solid #999}
.contract h1,.contract h2,.contract h3{break-after:avoid}
.contract tr{break-inside:avoid}
@media print{.contract hr{break-after:page;border:0;margin:0}}
@media(max-width:730px){.sidebar{position:static;width:auto;padding:14px}.sidebar nav{display:flex;overflow:auto}.sidebar nav button{white-space:nowrap}.sidebar .brand{padding-bottom:12px}.profile{display:flex;gap:10px;align-items:center;padding-top:10px}.profile button{margin:0}.main{margin:0;padding:20px 12px}header{flex-wrap:wrap}}
@media(max-width:650px){.car-structure-row{grid-template-columns:24px 72px minmax(100px,1fr) auto}.car-structure-row button[data-add-child],.car-structure-row button[data-remove-node]{grid-row:2}.car-structure-row[data-level="1"]{margin-left:16px}.car-structure-row[data-level="2"]{margin-left:32px}.car-structure-row[data-level="3"]{margin-left:48px}}
@media(max-width:450px){.grid{grid-template-columns:1fr}.dialog-foot{flex-wrap:wrap}}
@media print{#app,dialog,dialog::backdrop{display:none!important}#printout{display:block}body{background:white}th,td{border:1px solid #888}}

