
:root{--blue:#0065f7;--ink:#121820;--line:#dce4ee;--muted:#49576a;--surface:#f9fbff;--shadow:0 2px 6px #193a6820;--soft-blue:#dfedff;--color-primary:var(--blue);--design-radius-sm:8px;--design-radius-md:10px;--design-radius-lg:15px;--design-shadow-sm:0 2px 5px #25456908;--design-shadow-md:0 3px 10px #15325108;--design-space-1:4px;--design-space-2:8px;--design-space-3:12px;--design-space-4:16px;--design-space-5:20px;--design-font-xs:12px;--design-font-sm:13px;--design-font-md:14px;--design-font-lg:16px;--design-font-xl:22px}
*{box-sizing:border-box}
body{margin:0;background:#f0f5fd;color:var(--ink);font:14px/1.35 Arial,Helvetica,sans-serif}
a{color:#0058d9}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default}svg{vertical-align:middle;flex:none}
.icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.shell{display:grid;grid-template-columns:271px minmax(0,1fr);min-height:100vh}
.side{background:linear-gradient(125deg,#122843,#0c1b30 70%);color:#eef5ff;position:relative;isolation:isolate;min-height:100%;padding:12px 8px;display:flex;flex-direction:column;overflow:hidden}
.side:after{content:"";position:absolute;z-index:0;bottom:0;left:0;right:0;height:260px;background:url("../img/sidebar-car.webp") center bottom/100% auto no-repeat;pointer-events:none}
.side>*{position:relative;z-index:1}
.brand{display:flex;align-items:center;gap:13px;margin:0 10px 25px}.brand .icon{width:60px;height:40px;color:#5cb6ff;stroke-width:1.25}.brand b{font-size:24px;display:block;color:#fff;white-space:nowrap}.brand small{color:#a9bed5;font-size:15px;display:block;margin-top:2px}
.nav{display:grid;gap:4px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;align-content:start}.nav-item{color:inherit;text-decoration:none;border:0;background:transparent;text-align:left;border-radius:10px;height:44.5px;display:flex;gap:24px;align-items:center;padding:0 18px;font-size:16px;white-space:nowrap;min-width:0}.nav-item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-item .icon{width:26px;height:26px}.nav-item[aria-current]{background:linear-gradient(100deg,#0080ff,#0057f4);font-weight:700}.nav-item[href]:hover{background:#1978f6}
.header{height:62px;background:#fafbfe;border-bottom:1px solid #e4ebf5;box-shadow:0 3px 10px #15325108;display:flex;align-items:center;justify-content:flex-end;gap:25px;padding:0 22px;color:#29364a}
.user{display:flex;align-items:center;gap:14px;border-left:1px solid #dce4ee;padding-left:25px}.user strong{display:block;font-size:16px;color:#111823}.user small{font-size:14px}.avatar{background:linear-gradient(135deg,#4291ff,#81b3ff);color:white;font-size:18px;width:43px;height:43px;border-radius:100%;display:grid;place-items:center}.notification{position:relative}.notification:after{content:"";position:absolute;top:3px;right:4px;background:#f12643;border-radius:50%;width:8px;height:8px}
.content{padding:15px 14px 22px 19px}h1,h2,h3,p{margin:0}h1{font-size:34px;line-height:1.2;letter-spacing:-.7px;color:#101319}h2{font-size:22px}h3{font-size:18px}
.card{border:1px solid var(--line);border-radius:15px;background:linear-gradient(120deg,#fff,#f7faff);box-shadow:0 2px 5px #25456908}
.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:20px 0 25px}.metric{min-height:119px;display:flex;align-items:flex-start;gap:20px;padding:13px 17px;position:relative;overflow:hidden}.metric>div{position:relative;z-index:1}.metric label{display:block;font-size:16px}.metric strong{display:block;font-size:38px;line-height:1.12;letter-spacing:-.9px;margin:3px 0 1px;color:#080e16}.metric:last-child strong{font-size:32px;margin:6px 0 5px}.badge{border-radius:12px;background:linear-gradient(135deg,#e4efff,#d3e5fe);color:#0869ee;display:inline-grid;place-items:center;width:56px;height:54px;flex:none}.badge .icon{width:34px;height:34px}.metric .watermark{position:absolute;right:16px;bottom:12px;color:#d8e3f2;width:85px;height:75px;stroke-width:2}
.green{color:#13782c}.red{color:#db2237}.muted{color:var(--muted)}.blue{color:#005bdc}
.controls{display:grid;grid-template-columns:1.58fr 1.24fr .82fr .83fr auto;gap:12px;margin-bottom:20px}
.control,.button{display:inline-flex;align-items:center;gap:10px;border:1px solid #d4deed;border-radius:10px;background:#f8fafd;color:#213149;min-height:42px;padding:0 13px;white-space:nowrap;text-decoration:none;box-shadow:0 2px 5px #27456b0c}.control{min-width:0}.control input,.control select{width:100%;min-width:0;border:0;background:transparent;color:inherit;outline:none}.control input::placeholder{color:#4f5e71}.control:focus-within{outline:2px solid #68aaff;outline-offset:1px}
.button{justify-content:center;font-weight:600}.button:hover{background:#eaf2ff}.button.primary{color:#fff;background:linear-gradient(100deg,#007dff,#005bf3);border-color:#0065ee}.button.primary:hover{background:#005ce3}.button.icon-only{padding:0;width:47px;min-height:34px;background:#edf2f8}.button.icon-only:hover{background:#e0eaff}.button.finance{color:#0061e8;background:#ebf4ff;border-color:#bfd5f1}.button.danger{color:#e63a49;background:#fff0f2;border-color:#f7e0e4}
.list-card{overflow:hidden}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left}th{background:#f1f5fc;color:#151f2d;font-weight:700}th,td{border-bottom:1px solid #e5eaf2}.orders{table-layout:fixed;min-width:1000px}.orders th,.orders td{padding:0 9px}.orders th{height:49px}.orders td{height:58px;vertical-align:middle}.orders td:first-child,.orders th:first-child{padding-left:20px}.orders td:nth-child(n+8),.orders th:nth-child(n+8){text-align:center;padding:0 2px}.orders td:nth-child(7){white-space:nowrap}.orders td a{font-weight:700;font-size:16px}.orders td span.sub{display:block;margin-top:2px;color:#38465a}.orders .selected td{background:#e2eeff}.orders .selected td:first-child{box-shadow:inset 5px 0 #0065ff}.status{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;border:1px solid #c5dff2;border-radius:7px;background:#dbf0ff;color:#173f63;min-height:30px;padding:0 8px;font-size:13px;font-weight:700;text-decoration:none}.status:before{content:"";width:8px;height:8px;background:#0871f5;border-radius:100%;flex:none}.status .icon{width:15px;height:15px;margin-left:auto}.orders .status{width:100%;max-width:141px}.status.progress{background:#fff0ce;border-color:#f8e6ba;color:#794800}.status.progress:before{background:#f89912}.status.agree{background:#f1e9ff;border-color:#e9dcfa;color:#442487}.status.agree:before{background:#6744e6}.status.closed{background:#dff9e7;border-color:#d3f0dc;color:#144a2e}.status.closed:before{background:#12804b}
.list-footer{display:flex;align-items:center;justify-content:space-between;min-height:63px;padding:0 14px 0 19px;color:#354459}.pager{display:flex;gap:10px}.pager .button{width:39px;min-height:35px;padding:0;border-radius:8px}.pager .button:disabled{color:#6a788c}
.tip{margin-top:27px;display:flex;align-items:center;gap:11px;min-height:52px;padding:8px 20px;background:linear-gradient(105deg,#e4efff,#dbe7fc);border-radius:14px;color:#1e324e}.tip .icon{color:#0568f4}.tip a{font-weight:700}
.edit{padding-top:7px}.back{display:inline-flex;align-items:center;gap:7px;text-decoration:none;font-weight:600;margin-bottom:4px}.back .icon{width:19px;height:19px}.edit-bar{display:flex;align-items:center;gap:12px;margin:17px 0 16px;flex-wrap:wrap}.edit-title{display:flex;gap:14px;align-items:center;white-space:nowrap}.edit-title .badge{width:45px;height:45px;border-radius:10px}.edit-title .badge .icon{width:28px;height:28px}.saved{background:#dcf9e1;border-radius:8px;padding:9px 10px;color:#206a30;white-space:nowrap;font-size:12px;font-weight:700}.saved .icon{width:16px;height:16px;margin-right:4px}.edit-actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.edit-actions .button{min-height:39px;font-size:13px}.status-control{gap:5px;min-height:37px;font-size:13px;padding:0 5px 0 10px}.status-control .status{min-width:125px;min-height:28px}
.identity{display:grid;grid-template-columns:.82fr 1fr;gap:15px;margin-bottom:16px}.identity .card{padding:10px 13px 16px;min-height:146px}.section-title{display:flex;align-items:center;gap:14px;min-height:30px;font-weight:700;letter-spacing:-.25px}.section-title .icon{color:#0068ef;width:33px;height:30px}.identity-fields{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;margin:6px 0 12px}.identity-fields .control,.identity-fields .button{min-height:36px;border-radius:8px}.chips{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.client-chips{justify-content:flex-start;gap:20px}.chip{display:inline-flex;align-items:center;gap:8px;background:#edf1f7;border:1px solid #e7edf5;border-radius:10px;padding:5px 10px;white-space:nowrap}.chip .icon{width:20px;height:20px;color:#344965}
.editor-grid{display:grid;grid-template-columns:minmax(0,2.27fr) minmax(285px,1fr);gap:14px}.line-card{padding:8px 12px 10px}.line-card+.line-card{margin-top:15px}.line-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:1px 8px 8px 3px}.line-head .button{min-height:33px;font-size:13px}.line-head .button .icon{width:19px;height:19px}.line-table{border:1px solid #dfe7f1;border-radius:10px}.line-table table{min-width:605px}.line-table th,.line-table td{padding:4px 6px;text-align:center;white-space:nowrap}.line-table th{font-size:13px;height:29px}.line-table td{height:34px;padding-block:2px}.line-table tr:last-child td{border-bottom:0}.line-table .left{text-align:left;padding-left:15px}.line-table .actions{width:98px;padding:1px 6px}.line-table .actions .button{width:36px;min-height:27px;border-radius:8px}.line-table .actions .icon{width:18px;height:18px}.line-table .actions .button+.button{margin-left:5px}.parts td{height:31px}.total-card{padding:8px 8px 12px}.total-card .section-title{margin-bottom:11px}.total-card .badge{width:40px;height:39px;border-radius:10px}.total-card .badge .icon{width:24px;height:24px}.money-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;border-bottom:1px solid #e4eaf3;font-size:16px}.money-row:last-child{border-bottom:0}.total-card .money-row{margin:0 8px}.total-card .grand{margin:7px 0 15px;padding:10px 16px;border-radius:9px;background:#dce9fd;font-size:20px;font-weight:700;border:0}.grand strong{font-size:28px}.profit-lines{border-top:1px solid #dbe3ee;padding-top:8px}.profit-lines .money-row:last-child{font-size:19px}.edit .tip{margin-top:16px;min-height:46px}
.scrim{position:fixed;inset:0;background:#0c203f5e}.drawer{position:fixed;right:0;top:0;bottom:0;width:min(708px,100%);background:linear-gradient(125deg,#fff,#f4f8ff);border:1px solid #e1e9f3;border-radius:19px;padding:14px 17px 27px;box-shadow:-8px 0 25px #10233d1a;overflow:auto;display:flex;flex-direction:column;gap:18px}.drawer-head{display:flex;justify-content:space-between;align-items:center;padding:0 5px 0 16px;min-height:41px}.drawer-head h1{font-size:33px}.drawer-head .button{width:37px;height:37px;min-height:37px;border:0;box-shadow:none}.drawer-order{display:flex;align-items:center;gap:17px;padding:9px 10px}.drawer-order h2{font-size:28px;letter-spacing:-.5px}.drawer-order .badge{width:51px;height:51px}.drawer-order .status{min-width:142px;min-height:33px}.drawer-details{display:grid;grid-template-columns:1.11fr 1.08fr .89fr .9fr;padding:12px 8px;margin-top:-14px}.detail{padding:0 11px;min-height:72px}.detail+.detail{border-left:1px solid #d8e3f0}.detail small{display:flex;align-items:center;gap:9px;color:#263b58;margin-bottom:5px;font-size:12px}.detail small .icon{color:#0065ee;width:23px;height:23px}.detail div{font-size:16px;line-height:1.23}
.drawer-money{display:grid;grid-template-columns:1.21fr 1fr;gap:17px}.drawer-money .card{overflow:hidden}.drawer-money .money-row{margin:0 15px;min-height:39px;padding:5px 0}.money-label{display:flex;align-items:center;gap:16px}.money-label .icon{color:#0469ef;background:#e3efff;padding:4px;border-radius:8px;width:29px;height:29px}.drawer-money .grand{margin:0;padding:7px 15px;background:#dceafe;font-weight:700;font-size:19px}.drawer-money .grand strong{font-size:24px;color:#0713a5}.panel-title{background:#eaf2ff;display:flex;align-items:center;gap:13px;padding:11px 15px;min-height:44px}.panel-title .icon{color:#0065ee;width:28px;height:25px}.payment .money-row{font-size:15px;color:#293c58;min-height:41px}.payment .money-row strong{font-size:18px}.payment .money-row:last-child{color:#17283f}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);padding:11px 10px;align-items:center;min-height:98px}.kpi{padding:3px 7px;display:flex;align-items:flex-start;justify-content:center;gap:10px;min-height:63px}.kpi+.kpi{border-left:1px solid #dbe5f2}.kpi .icon{color:#0669f3;width:27px;height:27px;margin-top:3px}.kpi span{display:block;font-size:12px;margin:2px 0 6px;white-space:nowrap}.kpi strong{display:block;font-size:21px;white-space:nowrap}.kpi:last-child{background:#dff8e8;border:0;border-radius:13px;margin-left:6px}.kpi:last-child .icon,.kpi:last-child strong{color:#137335}
.director{overflow:hidden}.director .panel-title{background:#e3edff;padding-block:8px}.insights{display:grid;grid-template-columns:.94fr 1.08fr 1.08fr;gap:10px;padding:10px 10px 14px}.insight{display:flex;align-items:flex-start;gap:9px;padding:10px;border-radius:12px;background:#e5f0ff;font-size:11px;min-height:58px}.insight .icon{margin-top:3px;color:#0065ee;width:25px;height:25px}.insight strong,.insight span{display:block}.insight strong{font-size:12px;margin-bottom:3px}.insight:first-child{background:#e0f9e8;color:#19462a}.insight:first-child .icon{color:#197c39}.insight:last-child{background:#fff4e0;color:#392c1a}.insight:last-child .icon{color:#b17111}
.drawer-footer{display:grid;grid-template-columns:1.1fr 1.1fr .97fr;gap:13px;margin-top:auto;padding-top:12px}.drawer-footer .button{min-height:49px;font-size:16px}
@media(max-width:1330px){.shell{grid-template-columns:236px minmax(0,1fr)}.nav-item{gap:15px}.brand{gap:9px}.brand b{font-size:21px}.brand small{font-size:13px}.controls{grid-template-columns:repeat(4,minmax(0,1fr))}.controls>.primary{grid-column:4}.edit-actions{margin-left:0}.metric{gap:11px}.metric .watermark{opacity:.6}}
@media(max-width:1050px){.shell{grid-template-columns:65px minmax(0,1fr)}.brand{margin:8px 0 24px}.brand .icon{width:49px}.brand span,.nav-item span{display:none}.nav-item{padding:0;justify-content:center}.side:after{display:none}.editor-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:730px){.header{padding-inline:12px;gap:12px}.user{padding-left:12px}.content{padding-inline:9px}h1{font-size:26px}.metrics,.identity,.controls{grid-template-columns:minmax(0,1fr)}.controls>.primary{grid-column:auto}.metric{min-height:90px}.metric strong{font-size:29px}.edit-title{white-space:normal}.edit-title h2{font-size:18px}.identity-fields{gap:6px;grid-template-columns:minmax(0,1fr)}.identity-fields .button{justify-self:start}.drawer{padding:12px 10px}.drawer-head h1{font-size:24px}.drawer-order{flex-wrap:wrap;gap:8px}.drawer-order h2{font-size:20px}.drawer-details,.kpis,.insights{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:10px}.detail:nth-child(3),.kpi:nth-child(3){border:0}.drawer-money,.drawer-footer{grid-template-columns:1fr}.drawer-footer{gap:7px}.tip{padding:8px 10px}.list-footer{gap:5px;padding:0 6px}.pager{gap:4px}}
@media print{.side,.header,.controls,.tip,.edit-actions,.drawer-footer,.drawer-head .button{display:none}.shell{display:block}.finance-page .shell,.scrim{display:none}.drawer{position:static;width:100%;box-shadow:none}.orders{min-width:0}.scroll{overflow:visible}body{background:white}}
.list{padding-top:18px}.sort-icon{width:13px;height:13px}.order-number{color:#0058d9;text-decoration:underline;font-size:16px;font-weight:700}.orders tr[hidden]{display:none}.identity-fields .button .icon{width:17px;height:17px}

/* Measured desktop layout and palette from the 1536 × 864 references. */
:root{--ink:#111318;--line:#e1e7f0;--muted:#394658;--surface:#fafbff}
body{background:#f4f7fe}
.header{background:#f9fafe}
.side{background:linear-gradient(180deg,#0e213f 0%,#0c1a34 43%,#0d1c34 68%,#102846 100%)}
.side:after{height:248px;background-size:100% auto}
.brand{gap:12px}
.nav{gap:3px}
.nav-item{height:45px;font-size:17px;gap:23px}
.nav-item:nth-child(-n+2){margin-bottom:3px}
.nav-item[aria-current]{background:linear-gradient(105deg,#0068fa,#065ef0);box-shadow:inset 0 1px 1px #55a2ff55;font-weight:600}
.nav-item[aria-current] .icon rect:nth-child(2){fill:none}
.header .notification{width:43px;min-height:41px;border:0}
.header .user>.icon{width:19px;height:19px;margin-left:9px}
.card{background:linear-gradient(120deg,#fdfdfe,#f8faff);border-color:#e0e6ef}
.metric{background:linear-gradient(108deg,#fdfdfe,#fafbfd)}
.metric .watermark{width:auto;height:78px;bottom:9px;right:14px;object-fit:contain}
.metric .watermark-car{right:14px}.metric .watermark-schedule{right:12px}.metric .watermark-coins{right:23px}
.controls{gap:12px}
.controls>.primary{min-height:44px}
.control,.button{background:#fafbfe}
.control select{appearance:none;cursor:pointer}
.control>.select-arrow{width:16px;height:16px;pointer-events:none}
.orders{background:#fefefe}
.orders th{background:#f4f7fc;height:50px}
.orders td{height:57px}
.orders tbody tr:first-child td{height:59px}
.orders tbody tr:nth-child(3) td{height:58px}
.orders tbody tr:last-child td{height:66px}
.orders .selected td{background:linear-gradient(180deg,#e5effe,#deebfe)}
.orders .selected td:first-child{position:relative;box-shadow:none}
.orders .selected td:first-child:before{content:"";position:absolute;inset:0 auto 0 0;width:5px;border-radius:4px 0 0 4px;background:#0763f9}
.orders td:nth-child(5){padding-left:6px}
.orders td strong{font-weight:700}
.list-footer{background:#f9fafe;min-height:63px}
.tip{background:linear-gradient(105deg,#e5efff,#d9e6fc)}
.edit .saved{background:#d6f8da;color:#246834}
.identity-fields .control{background:#f7f9fe;border-color:#c8d8ef;padding-inline:10px}
.chip{background:linear-gradient(#eceff5,#e8ecf3)}
.line-table th{background:#f0f3fa}
.line-table td{background:#fdfdfe}
.line-table .left{padding-left:15px}
.line-table .actions{padding-inline:3px}
.line-table .button.finance{background:#e3eeff;border-color:#d9e8fd}
.total-card .grand{background:#d7e5fc}
.edit .tip{background:linear-gradient(105deg,#dbe8ff,#d7e5fa)}
.scrim{left:271px;background:#14284662}
.drawer{background:linear-gradient(115deg,#fdfdff,#f6f9ff)}
.drawer-order{background:linear-gradient(110deg,#fcfdff,#f9fbff);box-shadow:none;border-color:#f6f8fc}
.drawer-details{background:#f8fbff}
.drawer-money .card:first-child .money-row:not(.grand){min-height:41px}
.drawer-money .grand{background:#d4e4fd;min-height:48px}
.drawer-money .payment .panel-title{background:#ebf2fe;min-height:49px}
.drawer-money .payment .money-row{margin-inline:16px}
.kpi:last-child{background:#e2f9e8}
.insight:first-child{background:#e2f9e7}
.insight:nth-child(2){background:#e1ecfb}
.insight:last-child{background:#fbf2e1}

@media(min-width:1331px){
  .list{padding-top:18px}
  .list h1{margin-left:3px}
  .list .metrics{margin-top:21px}
  .controls{grid-template-columns:minmax(0,343fr) minmax(0,270fr) minmax(0,177fr) minmax(0,179fr) 218px}
  .controls .button{padding-inline:9px;font-size:16px}
  .edit .back{display:flex;width:max-content;height:21px;margin-bottom:4px}
  .edit-bar{display:grid;grid-template-columns:346px auto minmax(0,1fr);gap:12px;margin-top:15px;margin-bottom:17px;min-height:45px}
  .edit-title{letter-spacing:-.35px}
  .edit-actions{width:100%;margin:0;display:grid;grid-template-columns:1.25fr .85fr 1.03fr .72fr;gap:8px}
  .edit-actions .button{padding-inline:9px}
  .edit-actions .status-control .status{min-width:0;flex:1}
  .identity{grid-template-columns:minmax(0,548fr) minmax(0,668fr);gap:16px;margin-bottom:17px}
  .identity article:nth-child(2){padding-inline:17px 13px}
  .identity article:nth-child(2) .chips{gap:7px;justify-content:space-between}
  .identity .card{min-height:147px}
  .editor-grid{grid-template-columns:minmax(0,846fr) minmax(0,372fr);gap:14px}
  .line-card{min-height:199px}
  .line-card+.line-card{margin-top:16px}
  .line-card.parts{min-height:186px}
  .line-table td{height:35px}.parts td{height:31px}
  .total-card .section-title{margin-bottom:12px}
  .total-card .money-row{min-height:37px}
  .total-card .grand{min-height:55px}
  .drawer{width:708px;padding:14px 16px 27px 17px;gap:18px}
  .drawer-head{height:41px;flex:none}
  .drawer-order{min-height:72px;flex:none}
  .drawer-details{min-height:100px;margin-top:-13px;flex:none}
  .drawer-money{min-height:215px;flex:none}
  .kpis{min-height:98px;margin-top:1px;flex:none}
  .director{min-height:128px;flex:none}
  .drawer-footer{flex:none}
  .finance-page .list .metrics{margin-bottom:24px;grid-template-columns:336px 336px minmax(0,1fr)}
  .finance-page .controls{grid-template-columns:289px 246px minmax(0,1fr) minmax(0,1fr) 218px}
  .finance-page .orders th{height:49px}
  .finance-page .orders td{height:53px}
  .finance-page .orders tbody tr:first-child td{height:59px}
  .finance-page .orders tbody tr:nth-child(3) td,.finance-page .orders tbody tr:nth-child(4) td{height:54px}
  .finance-page .orders tbody tr:last-child td{height:68px}
  .finance-page .orders col:nth-child(1){width:9.62%!important}
  .finance-page .orders col:nth-child(2){width:7.2%!important}
  .finance-page .orders col:nth-child(3){width:17.25%!important}
}
@media(max-width:1480px) and (min-width:1331px){
  .edit-bar{display:flex}
  .edit-actions{display:flex;width:auto}
  .identity article:nth-child(2) .chips{justify-content:flex-start}
}
@media(max-width:1330px){.scrim{left:236px}}
@media(max-width:1050px){.scrim{left:65px}.nav-item{gap:0}}
@media(max-width:730px){
  .scrim{left:0}
  .drawer-order{padding:8px}
  .drawer-details{margin-top:0}
  .detail div{overflow-wrap:anywhere}
  .kpi strong{font-size:19px}
  .kpi span{white-space:normal}
  .metric .watermark{height:64px}
}
.orders td:nth-child(3) strong,.orders td:nth-child(4) strong{white-space:nowrap;font-size:13.8px}
.finance-page .orders td:nth-child(3) strong{font-size:13px}
.edit .saved{font-size:11.7px}
@media(min-width:731px){.list h1{font-size:35px;letter-spacing:0;line-height:40.8px}}


/* Keep the underlying page below overlays, including positioned card labels. */
.shell { isolation: isolate; }
.scrim { z-index: 10; }
.drawer { z-index: 11; overflow: hidden; }
.finance-page { overflow: hidden; }
.drawer:focus { outline: none; }
.drawer-head, .drawer-footer { flex: 0 0 auto; }
.drawer-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer-content > * { flex-shrink: 0; }
.drawer-footer { margin-top: 0; padding-top: 0; }
.drawer-footer .button { min-width: 0; }
.drawer-head .button { flex: none; }

.orders { min-width: 1080px; }
.orders td:nth-child(3) strong, .orders td:nth-child(4) strong {
  white-space: normal;
  overflow-wrap: anywhere;
  display: block;
}
.orders td:nth-child(5) .status {
  padding-inline: 6px;
  gap: 4px;
  font-size: clamp(11px, 1vw, 13px);
}
.orders td:nth-child(5) .status .icon { width: 13px; }

.nav-toggle, .nav-close, .nav-backdrop { display: none; }
@media screen and (max-width: 1050px) {
  .nav-toggle, .nav-close { display: inline-flex; }
  .header .nav-toggle { margin-right: auto; min-width: 42px; }
  .shell-content { grid-column: 2; }
  .side.is-open {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(271px, calc(100vw - 44px));
    z-index: 4;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 16px;
    box-shadow: 8px 0 28px #081a3b40;
  }
  .side.is-open .brand { margin: 4px 6px 20px; padding-right: 31px; gap: 8px; }
  .side.is-open .brand span, .side.is-open .nav-item span { display: inline; }
  .side.is-open .nav-item { justify-content: flex-start; gap: 14px; padding: 0 12px; font-size: 16px; }
  .nav-close {
    position: absolute;
    top: 17px;
    right: 10px;
    padding: 0;
    width: 34px;
    min-height: 34px;
    color: #f5f9ff;
    background: #ffffff12;
    border-color: #ffffff35;
  }
  .nav-close:hover { background: #ffffff30; }
  .nav-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #0c203f60;
    z-index: 3;
  }
  body.nav-open { overflow: hidden; }
}
@media screen and (max-width: 730px) {
  .header { gap: 8px; padding-inline: 9px; }
  .header .user { gap: 7px; padding-left: 8px; min-width: 0; }
  .header .user > .icon { margin-left: 0; width: 16px; }
  .header .avatar { width: 34px; height: 34px; font-size: 14px; }
  .header .user strong { font-size: 13px; }
  .header .user small { font-size: 11px; }
  .header .notification { width: 35px; min-height: 35px; flex: none; }
  .drawer { gap: 10px; border-radius: 0; }
  .drawer-content { gap: 12px; }
  .drawer-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-footer .primary { grid-column: 1 / -1; }
  .drawer-footer .button { min-height: 39px; font-size: 13px; white-space: normal; padding-inline: 6px; }
  .drawer-footer .icon { width: 18px; height: 18px; }
  .drawer-details .detail { padding-inline: 6px; min-width: 0; }
  .drawer-details .detail small { gap: 5px; }
}
@media print {
  .orders { min-width: 0; }
  .drawer { overflow: visible; }
  .drawer-content { display: block; overflow: visible; }
  .drawer-content > * { margin: 0 0 12px; }
  .nav-toggle, .nav-close, .nav-backdrop { display: none !important; }
}

/* Django shell additions: preserve the reference rules above and only add the
   dynamic organization shell, desktop collapse and accessibility hooks. */
.otto-icon-sprite{position:absolute;width:0;height:0;overflow:hidden}
.brand__logo{width:60px;height:40px;object-fit:contain}
.sidebar-tools{display:flex;gap:8px;margin-top:auto;padding:12px 10px 4px;border-top:1px solid #ffffff1c;position:sticky;bottom:0;flex:none;background:linear-gradient(125deg,#122843f2,#0c1b30f2 70%)}
.sidebar-tools .button{min-height:35px;flex:1;color:#eaf3ff;background:#ffffff12;border-color:#ffffff30;box-shadow:none}
.sidebar-tools .button:hover{background:#ffffff26}
.user-menu{position:relative}
.user-menu summary{display:grid;place-items:center;cursor:pointer;list-style:none}
.user-menu summary::-webkit-details-marker{display:none}
.user-menu__logout{position:absolute;right:0;top:30px;z-index:30;min-width:92px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);box-shadow:var(--shadow);text-align:left;cursor:pointer}
.notification--unread:after{content:"";position:absolute;top:3px;right:4px;background:#f12643;border-radius:50%;width:8px;height:8px}
.header .notification:not(.notification--unread):after{display:none}
body{font-family:"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
@media screen and (min-width:1051px){
  html.otto-sidebar-collapsed .shell{grid-template-columns:76px minmax(0,1fr)}
  html.otto-sidebar-collapsed .side{padding-inline:7px}
  html.otto-sidebar-collapsed .brand{justify-content:center;margin-inline:0}
  html.otto-sidebar-collapsed .brand span,.otto-sidebar-collapsed .nav-item span{display:none}
  html.otto-sidebar-collapsed .brand .icon,.otto-sidebar-collapsed .brand__logo{width:49px}
  html.otto-sidebar-collapsed .nav-item{justify-content:center;gap:0;padding-inline:0}
  html.otto-sidebar-collapsed .sidebar-tools{flex-direction:column}
  html.otto-sidebar-collapsed .sidebar-collapse .icon{transform:rotate(180deg)}
  html.otto-sidebar-collapsed .side:after{display:none}
}

/* ==== Страница редактирования заказ-наряда: блок итогов ==== */
/* Order totals follow both line-item tables. Each label wraps with its value. */
.total-card {
  margin-top: 14px;
  padding: 10px 13px 13px;
}
.total-card .section-title { margin-bottom: 9px; }
.total-card .badge { width: 40px; height: 39px; border-radius: 10px; }
.total-card .badge .icon { width: 24px; height: 24px; }
.total-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.total-item {
  flex: 1 1 116px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 11px;
  border: 1px solid #e1e9f3;
  border-radius: 9px;
  background: #f7f9fd;
}
.total-item dt { color: var(--muted); }
.total-item dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.total-item-cost { flex-basis: 145px; }
.total-item-profit { flex-basis: 173px; }
.total-item-grand {
  background: #d7e5fc;
  border-color: #d7e5fc;
}
.total-item-grand dt { color: var(--ink); font-weight: 700; }
.total-item-grand dd { font-size: 23px; }
@media print {
  .total-card { break-inside: avoid; }
}
