:root{--bg:#f4f6f9;--panel:#fff;--line:#e2e7ef;--text:#172033;--muted:#718096;--nav:#111827;--blue:#2563eb;--red:#dc2626;--green:#15803d}*{box-sizing:border-box}html,body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px}a{text-decoration:none;color:var(--blue)}.layout{min-height:100vh;display:flex}aside{width:230px;position:fixed;inset:0 auto 0 0;background:var(--nav);color:#fff;display:flex;flex-direction:column}.brand{height:66px;display:flex;align-items:center;gap:11px;padding:0 17px;border-bottom:1px solid #293449;font-size:17px}.brand b,.loginlogo>b{width:34px;height:34px;border-radius:9px;background:var(--blue);display:grid;place-items:center;font-size:20px}.brand span{font-weight:700}nav{padding:11px 8px;flex:1}nav a{display:block;color:#cbd5e1;padding:10px 12px;border-radius:7px;margin:2px 0}nav a:hover,nav a.active{background:#233047;color:#fff}.aside-foot{padding:14px 17px;border-top:1px solid #293449;color:#a9b6c8}.aside-foot a{color:#cbd5e1}main{margin-left:230px;min-width:0;flex:1}header{height:66px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 25px;position:sticky;top:0;z-index:5}header h1{font-size:20px;margin:0}header span{color:var(--muted)}.content{padding:22px 25px}.cards{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-bottom:18px}.card{background:#fff;border:1px solid var(--line);border-radius:9px;padding:15px;color:var(--text)}.card span{display:block;color:var(--muted);font-size:12px;text-transform:uppercase}.card strong{display:block;font-size:29px;margin-top:8px}.panel{background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:18px;overflow:hidden}.paneltitle{padding:13px 15px;border-bottom:1px solid var(--line);font-weight:700}.table{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{background:#f8fafc;color:#5b6779;text-align:left;padding:10px 11px;border-bottom:1px solid var(--line);white-space:nowrap}td{padding:9px 11px;border-bottom:1px solid #edf1f5;vertical-align:middle}tbody tr:hover{background:#f7faff}.click{cursor:pointer}.muted{opacity:.58}.mono{font-family:Consolas,ui-monospace,monospace}.tiny{font-size:11.5px}.badge{display:inline-block;padding:3px 7px;border-radius:99px;background:#edf2f7;color:#4a5568;font-size:11px}.badge.green,.badge.completed{background:#dcfce7;color:#166534}.badge.red,.badge.failed{background:#fee2e2;color:#991b1b}.badge.pending,.badge.processing,.badge.retry{background:#fef3c7;color:#92400e}.badge.cancelled{background:#e5e7eb;color:#4b5563}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.toolbar form{display:flex;gap:8px;flex:1}.toolbar input{max-width:500px;flex:1}input,select{border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:9px 10px;font:inherit;color:inherit}input:focus,select:focus{outline:2px solid #bfdbfe;border-color:#60a5fa}.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd5e1;background:#fff;color:#243247;border-radius:6px;padding:8px 12px;font-weight:600;cursor:pointer}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.danger{background:var(--red);border-color:var(--red);color:#fff}.btn.success{background:var(--green);border-color:var(--green);color:#fff}.pager{display:flex;align-items:center;justify-content:center;gap:12px}.twocol{display:grid;grid-template-columns:1.3fr .8fr;gap:18px}.form{padding:15px}.form label{display:block;margin-bottom:13px;color:#59677a;font-size:12px}.form label input{display:block;width:100%;margin-top:6px;color:var(--text)}.dangerbox{padding:15px;border-top:1px solid var(--line)}dl{display:grid;grid-template-columns:140px 1fr;margin:0}dt,dd{padding:10px 14px;border-bottom:1px solid #edf1f5;margin:0}dt{color:var(--muted)}.crumb{margin-bottom:12px;color:var(--muted)}.flash{padding:11px 13px;border-radius:7px;margin-bottom:14px}.flash.success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}.flash.error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}.note{background:#eff6ff;color:#1e40af;border:1px solid #dbeafe;padding:11px 13px;border-radius:7px;margin-bottom:14px}.login{min-height:100vh;display:grid;place-items:center;background:#edf1f6}.loginbox{width:390px;background:#fff;border:1px solid #dce3ec;border-radius:12px;padding:28px;box-shadow:0 16px 40px rgba(15,23,42,.08)}.loginlogo{display:flex;align-items:center;gap:12px;margin-bottom:22px}.loginlogo strong{display:block;font-size:20px}.loginlogo small{display:block;color:var(--muted);margin-top:3px}.loginbox label{display:block;margin:13px 0;color:#566477}.loginbox input{display:block;width:100%;margin-top:6px}.loginbox .btn{width:100%;margin-top:7px;padding:10px}@media(max-width:1200px){.cards{grid-template-columns:repeat(3,1fr)}.twocol{grid-template-columns:1fr}}@media(max-width:800px){aside{width:72px}.brand span,nav a,.aside-foot{font-size:0}.brand{justify-content:center;padding:0}.brand b{font-size:20px}nav a:before{content:"•";font-size:22px}.aside-foot{display:none}main{margin-left:72px}.content{padding:14px}.cards{grid-template-columns:repeat(2,1fr)}}
.order-head{padding:18px 20px;display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.order-head h2{margin:5px 0 10px;font-size:22px}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.order-badges{display:flex;gap:6px;flex-wrap:wrap}.order-total{text-align:right;min-width:210px}.order-total span,.order-total small{display:block;color:var(--muted)}.order-total strong{display:block;font-size:26px;margin:5px 0}.order-cards{grid-template-columns:repeat(4,1fr)}.order-cards .card strong{font-size:20px}.empty{text-align:center;color:var(--muted);padding:20px!important}.panel h2{margin:0}.table td .tiny{color:var(--muted)}@media(max-width:1000px){.order-head{flex-direction:column}.order-total{text-align:left}.order-cards{grid-template-columns:repeat(2,1fr)}}

/* V22-R4-R1: operations-first order card */
.crumb{display:flex;align-items:center;gap:7px}
.order-summary{padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.order-summary h2{font-size:23px;margin:5px 0 10px}
.order-summary-main{min-width:0}
.order-summary-total{text-align:right;min-width:230px}
.order-summary-total>span,.order-summary-total>small{display:block;color:var(--muted)}
.order-summary-total>strong{display:block;font-size:29px;margin:4px 0}
.ops-grid{display:grid;grid-template-columns:1.05fr .8fr .95fr 1.35fr;gap:12px;margin-bottom:14px}
.ops-card{background:#fff;border:1px solid var(--line);border-radius:9px;padding:13px 15px;min-width:0}
.ops-label{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.ops-value{font-size:16px;font-weight:700;overflow:hidden;text-overflow:ellipsis}
.ops-address{font-size:14px;white-space:normal}
.ops-sub{color:var(--muted);font-size:12px;margin-top:5px;line-height:1.35;overflow-wrap:anywhere}
.money-strip{display:grid;grid-template-columns:repeat(4,1fr);background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:18px;overflow:hidden}
.money-strip>div{padding:11px 14px;border-right:1px solid var(--line)}
.money-strip>div:last-child{border-right:0}
.money-strip span{display:block;color:var(--muted);font-size:11px}
.money-strip strong{display:block;margin-top:3px;font-size:16px}
.panel-counter{font-weight:400;color:var(--muted);font-size:12px;margin-left:7px}
.operational-columns{grid-template-columns:1fr 1fr}
.contact-list{padding:4px 14px}
.contact-row{display:grid;grid-template-columns:76px 1fr;gap:10px;align-items:start;padding:11px 0;border-bottom:1px solid #edf1f5}
.contact-row:last-child{border-bottom:0}
.subline{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);margin-top:4px;font-size:12px}
.compact-dl{grid-template-columns:125px 1fr}
.compact-dl dt,.compact-dl dd{padding:8px 13px}
.tech-block{background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:12px;overflow:hidden}
.tech-block>summary{cursor:pointer;padding:13px 15px;font-weight:700;list-style:none}
.tech-block>summary::-webkit-details-marker{display:none}
.tech-block>summary:after{content:'▾';float:right;color:var(--muted)}
.tech-block[open]>summary{border-bottom:1px solid var(--line)}
.tech-block[open]>summary:after{content:'▴'}
.tech-content{padding:14px;background:#f8fafc}
.panel.nested{margin-bottom:12px;box-shadow:none}
.tech-content>.panel:last-child,.tech-content>.twocol:last-child .panel{margin-bottom:0}
.order-items td:nth-child(3){min-width:300px}
.status-order{background:#e0e7ff;color:#3730a3}
.status-payment{background:#ecfdf5;color:#166534}
.status-fulfillment{background:#eff6ff;color:#1d4ed8}
@media(max-width:1250px){.ops-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){
  .order-summary{align-items:flex-start;flex-direction:column}
  .order-summary-total{text-align:left;min-width:0}
  .ops-grid,.money-strip{grid-template-columns:1fr 1fr}
  .operational-columns{grid-template-columns:1fr}
}

/* V22-R4-R2: canonical order status navigation */
.order-subnav{margin:2px 0 8px;padding:3px 0 4px 13px;border-left:1px solid #314057}
.order-subitem{display:flex!important;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px!important;margin:1px 0!important;font-size:11.5px!important;color:#9fb0c6!important;border-radius:5px!important;background:transparent!important}
.order-subitem:hover{color:#fff!important;background:#1b2636!important}
.order-subitem.active{color:#fff!important;background:#2b3b54!important}
.order-subitem b{min-width:22px;text-align:center;padding:1px 5px;border-radius:999px;background:#202d40;color:#b8c6d9;font-size:10px}
.order-subitem.active b{background:#3b82f6;color:#fff}
.orders-view-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:12px}
.orders-view-head h2{margin:0;font-size:18px}
.orders-view-head>div>span{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.status-legend{color:var(--muted);font-size:12px}
.orders-table td:first-child{min-width:125px}
.orders-table td:nth-child(2){min-width:190px}
.orders-table .muted{color:var(--muted)}
.order-status-accepted{background:#e0e7ff;color:#3730a3}
.order-status-processed{background:#ede9fe;color:#5b21b6}
.order-status-ready_to_ship{background:#fef3c7;color:#92400e}
.order-status-completed{background:#dbeafe;color:#1d4ed8}
.order-status-closed{background:#dcfce7;color:#166534}
.order-status-cancelled{background:#f3f4f6;color:#4b5563}
.order-status-failed{background:#fee2e2;color:#991b1b}
@media(max-width:900px){.orders-view-head{align-items:flex-start;flex-direction:column}.status-legend{display:none}}


/* V23-R4: BAS-style catalog hierarchy */
.catalog-shell{display:grid;grid-template-columns:310px minmax(0,1fr);gap:16px;align-items:start}
.catalog-pane{position:sticky;top:82px;max-height:calc(100vh - 104px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:9px}
.catalog-pane-head{padding:12px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff;z-index:2}
.catalog-pane-head>div{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:8px}
.catalog-pane-head small{color:var(--muted)}
.catalog-all{display:flex;align-items:center;justify-content:space-between;padding:7px 8px;border-radius:6px;color:var(--text);font-size:12px}
.catalog-all.active,.catalog-all:hover{background:#eef4ff;color:#1d4ed8}
.catalog-all b,.catalog-group-link b{font-size:10px;color:var(--muted);font-weight:600}
.catalog-tree{padding:7px 5px 12px}
.catalog-tree-level{list-style:none;margin:0;padding-left:13px}
.catalog-tree-level.depth-0{padding-left:0}
.catalog-tree li{margin:1px 0}
.catalog-tree details>summary{list-style:none}
.catalog-tree details>summary::-webkit-details-marker{display:none}
.catalog-group-link{display:grid;grid-template-columns:14px minmax(0,1fr) auto;gap:4px;align-items:center;padding:5px 7px;border-radius:5px;color:#334155;font-size:12px;line-height:1.25}
.catalog-group-link:hover,.catalog-group-link.active{background:#eaf1ff;color:#1d4ed8}
.catalog-group-link.deleted{opacity:.5}
.catalog-folder{font-size:10px;color:#94a3b8}
.catalog-group-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.catalog-main{min-width:0}
.catalog-title-row{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:12px}
.catalog-title-row h2{margin:0;font-size:19px}
.catalog-title-row>div>span{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.catalog-sync-progress{text-align:right}
.catalog-sync-progress span{display:block!important;font-size:11px!important}
.catalog-sync-progress strong{display:block;margin-top:3px}
.catalog-products-table td:nth-child(2){min-width:280px}
.catalog-products-table td:nth-child(3){min-width:180px}
.product-meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:1100px){.catalog-shell{grid-template-columns:250px minmax(0,1fr)}}
@media(max-width:850px){.catalog-shell{grid-template-columns:1fr}.catalog-pane{position:relative;top:auto;max-height:320px}.catalog-title-row{align-items:flex-start;flex-direction:column}.catalog-sync-progress{text-align:left}.product-meta-grid{grid-template-columns:1fr}}

/* V23-R5-R4: CRM read-only Media Manager bridge */
.photo-head{width:76px}
.product-photo-cell{width:76px;padding:5px 8px!important}
.thumb-wrap{position:relative;width:58px;height:58px}
.product-thumb,.product-photo-placeholder{width:58px;height:58px;border-radius:7px;border:1px solid var(--line);background:#fff}
.product-thumb{display:block;object-fit:contain}
.product-photo-placeholder{display:grid;place-items:center;color:#a0aec0;background:#f8fafc;font-size:18px}
.photo-count{position:absolute;right:-4px;bottom:-4px;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#1f2937;color:#fff;font-size:10px;line-height:19px;text-align:center;border:2px solid #fff}
.catalog-products-table td:nth-child(3){min-width:300px}
.catalog-products-table td:nth-child(4){min-width:180px}
.product-media-panel{overflow:visible}
.product-media-panel .paneltitle{display:flex;align-items:center;gap:8px}
.media-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:99px;background:#eef2f7;color:#526176;font-size:11px}
.product-gallery{display:flex;gap:12px;overflow-x:auto;padding:14px 15px 16px}
.product-gallery-item{margin:0;flex:0 0 150px;border:1px solid var(--line);border-radius:8px;background:#fff;overflow:hidden}
.product-gallery-item.primary{border-color:#93c5fd;box-shadow:0 0 0 2px #dbeafe}
.product-gallery-item img{display:block;width:150px;height:150px;object-fit:contain;background:#fff}
.product-gallery-item figcaption{padding:8px 9px;border-top:1px solid var(--line)}
.product-gallery-item figcaption span{display:block;font-size:11px;font-weight:700;color:#334155}
.product-gallery-item figcaption small{display:block;margin-top:3px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.media-empty{padding:24px 15px;color:var(--muted)}
@media(max-width:850px){.product-gallery-item{flex-basis:120px}.product-gallery-item img{width:120px;height:120px}}

/* V23-R5-R5: editable Media Manager gallery */
.media-title-row{display:flex!important;align-items:center;justify-content:space-between;gap:12px}
.media-upload-form{margin:0}
.media-upload-button{position:relative;overflow:hidden;cursor:pointer;margin:0;display:inline-flex;align-items:center}
.media-upload-button input[type=file]{position:absolute;left:-10000px;width:1px;height:1px;opacity:0}
.media-hint{padding:8px 15px;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted);background:#fafbfc}
.editable-gallery{align-items:stretch}
.gallery-image-wrap{position:relative}
.primary-ribbon{position:absolute;left:6px;top:6px;background:#2563eb;color:#fff;border-radius:5px;padding:3px 6px;font-size:9px;font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.14)}
.gallery-actions{padding:7px 8px 9px;border-top:1px solid var(--line);background:#fafbfc}
.gallery-actions form{display:flex;gap:5px;margin:0}
.media-icon-btn{width:29px;height:27px;border:1px solid #d5dce5;border-radius:5px;background:#fff;color:#334155;font-size:16px;line-height:1;cursor:pointer;padding:0}
.media-icon-btn:hover:not(:disabled){background:#eef3f8}
.media-icon-btn:disabled{opacity:.3;cursor:not-allowed}
.media-icon-btn.star{color:#b7791f}
.media-icon-btn.danger{margin-left:auto;color:#c53030;border-color:#fed7d7}
.media-icon-btn.danger:hover{background:#fff5f5}
@media(max-width:700px){.media-title-row{align-items:flex-start;flex-direction:column}.media-upload-button{width:100%;justify-content:center}}

/* V24-R1-R29: Prom checkout data in CRM order card */
.prom-order-source-card{padding:0;overflow:hidden;border-color:#d7e3ff;background:#fbfdff}
.prom-source-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border-bottom:1px solid #dce6f5;background:#f5f8ff}
.prom-source-title{font-size:17px;font-weight:700;margin-top:3px}
.prom-choice-grid{display:grid;grid-template-columns:1fr 1.15fr 1fr 1.35fr 2.4fr}
.prom-choice-item{padding:13px 15px;min-width:0;border-right:1px solid var(--line)}
.prom-choice-item:last-child{border-right:0}
.prom-choice-item span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:5px}
.prom-choice-item strong{display:block;font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.prom-choice-item small{display:block;margin-top:4px;font-size:12px}
.prom-choice-destination strong{font-weight:600}
@media(max-width:1200px){.prom-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.prom-choice-item{border-bottom:1px solid var(--line)}.prom-choice-destination{grid-column:1/-1}.prom-choice-item:nth-child(even){border-right:0}}
@media(max-width:700px){.prom-source-head{align-items:flex-start;flex-direction:column}.prom-choice-grid{grid-template-columns:1fr}.prom-choice-item{border-right:0}.prom-choice-destination{grid-column:auto}}

/* V24-R1-R30: operational order UX */
input[type=search],textarea{border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:9px 10px;font:inherit;color:inherit}
textarea{width:100%;resize:vertical;min-height:76px}
textarea:focus,input[type=search]:focus{outline:2px solid #bfdbfe;border-color:#60a5fa}

.order-ops-grid{grid-template-columns:1fr 1fr 2fr}
.delivery-choice-card{position:relative}
.delivery-choice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.delivery-choice-address{font-size:14px;font-weight:600;line-height:1.45;margin-top:8px}
.delivery-choice-recipient{margin-top:7px}
.actual-shipment-line{margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.delivery-edit{margin-top:11px}
.delivery-edit>summary{list-style:none;width:max-content}
.delivery-edit>summary::-webkit-details-marker{display:none}
.delivery-edit[open]>summary{margin-bottom:10px}
.delivery-edit-form{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;padding-top:10px;border-top:1px solid var(--line)}
.delivery-edit-form label{display:block;color:var(--muted);font-size:12px}
.delivery-edit-form input,.delivery-edit-form textarea{display:block;width:100%;margin-top:5px}
.delivery-address-field{grid-column:1/-1}
.delivery-edit-actions{grid-column:1/-1;display:flex;justify-content:flex-end}

.orders-toolbar{display:flex;align-items:center;margin-bottom:12px}
.orders-toolbar form{display:flex;gap:8px;width:100%;max-width:760px}
.orders-toolbar input[type=search]{flex:1;min-width:260px}
.orders-date{white-space:nowrap;font-variant-numeric:tabular-nums}
.order-list-primary{font-weight:600;white-space:nowrap}
.orders-delivery-cell{min-width:280px;max-width:420px}
.order-list-address{margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:390px}
.orders-table td:nth-child(2){min-width:125px}
.orders-table td:nth-child(3){min-width:180px}

@media(max-width:1250px){
  .order-ops-grid{grid-template-columns:1fr 1fr}
  .delivery-choice-card{grid-column:1/-1}
}
@media(max-width:800px){
  .order-ops-grid{grid-template-columns:1fr}
  .delivery-choice-card{grid-column:auto}
  .delivery-edit-form{grid-template-columns:1fr}
  .delivery-address-field,.delivery-edit-actions{grid-column:auto}
  .orders-toolbar form{flex-wrap:wrap}
  .orders-toolbar input[type=search]{min-width:100%;flex-basis:100%}
}

/* V24-R1-R31: sortable order list + visible order status editor */
.sort-link{display:inline-flex;align-items:center;gap:4px;color:inherit;font-weight:inherit;text-decoration:none}
.sort-link:hover,.sort-link.active{color:#2563eb}
.order-status-editor{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:2px 0 10px}
.order-status-editor label{display:flex;flex-direction:column;gap:4px}
.order-status-editor label>span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.order-status-editor select{min-width:190px;height:34px;padding:5px 30px 5px 10px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--text)}
.order-status-note{align-self:center;color:var(--muted);font-size:11px;max-width:360px}
.orders-table th{white-space:nowrap}
.orders-table td:first-child{min-width:105px}

/* V24-R1-R32: Prom-like operational order workspace */
.prom-orders-head{margin-bottom:10px}
.prom-orders-toolbar{margin-bottom:10px}
.prom-orders-workspace{display:block}
.bulk-order-bar{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 12px;margin-bottom:8px;border:1px solid var(--line);border-radius:8px;background:#fff}
.bulk-left,.bulk-actions{display:flex;align-items:center;gap:12px}
.bulk-check-all{display:flex;align-items:center;gap:7px;font-weight:600}
.bulk-selected{font-size:12px;color:var(--muted)}
.bulk-actions select{height:34px;min-width:190px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:4px 30px 4px 9px}
.prom-orders-panel{padding:0;overflow:hidden}
.prom-orders-table-wrap{overflow:auto}
.prom-orders-table{width:100%;border-collapse:collapse;table-layout:fixed}
.prom-orders-table th{padding:10px 9px;background:#f7f9fc;border-bottom:1px solid var(--line);font-size:12px;text-align:left;vertical-align:middle}
.prom-orders-table td{padding:12px 9px;border-bottom:1px solid var(--line);vertical-align:top}
.prom-orders-table tr:last-child td{border-bottom:0}
.prom-orders-table tr:hover td{background:#fbfcff}
.prom-select-col{width:38px}.prom-order-col{width:35%}.prom-sum-col{width:11%}.prom-recipient-col{width:17%}.prom-delivery-col{width:25%}.prom-status-col{width:12%}
.prom-select-cell{text-align:center;padding-top:20px!important}
.prom-select-cell input{width:17px;height:17px}
.prom-order-main{display:flex;gap:12px;min-width:0}
.prom-order-thumb{width:58px;height:58px;flex:0 0 58px;border:1px solid var(--line);border-radius:6px;background:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center}
.prom-order-thumb img{display:block;width:100%;height:100%;object-fit:contain}
.prom-order-thumb-empty{color:#a0a9b8;font-size:18px}
.prom-order-info{min-width:0}
.prom-order-number-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.prom-order-number{font-size:14px;font-weight:700;color:#1d63d7;text-decoration:none}
.prom-order-number:hover{text-decoration:underline}
.channel-badge{font-size:10px;padding:2px 6px}
.prom-order-date{font-size:12px;color:var(--muted);margin:2px 0 7px}
.prom-main-product{display:block;color:var(--text);font-weight:600;text-decoration:none;line-height:1.3}
.prom-main-product:hover{color:#1d63d7}
.prom-main-product-meta{font-size:11px;color:var(--muted);margin-top:3px}
.prom-order-items-expand{margin-top:7px}
.prom-order-items-expand summary{cursor:pointer;color:#1767d8;font-size:12px;user-select:none}
.prom-order-items-list{margin-top:8px;border-top:1px solid var(--line)}
.prom-order-subitem{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid #edf0f5}
.prom-order-subitem:last-child{border-bottom:0}
.prom-order-subthumb{width:36px;height:36px;border:1px solid var(--line);border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff}
.prom-order-subthumb img{width:100%;height:100%;object-fit:contain}
.prom-order-subinfo{min-width:0}
.prom-order-subinfo a{display:block;color:var(--text);font-size:12px;text-decoration:none}
.prom-order-subinfo a:hover{color:#1d63d7}
.prom-order-subitem>b{font-size:12px;white-space:nowrap}
.prom-sum-cell strong{display:block;font-size:15px;white-space:nowrap}
.prom-sum-cell span{display:block;font-size:11px;color:var(--muted);margin-top:7px}
.prom-recipient-name{display:block;font-weight:600;color:#1767d8;text-decoration:none}
.prom-recipient-name:hover{text-decoration:underline}
.prom-recipient-phone{display:block;margin-top:6px;color:var(--text);text-decoration:none}
.prom-recipient-phone:hover{color:#1767d8}
.prom-delivery-line{margin-bottom:4px}
.prom-delivery-address{font-size:12px;line-height:1.4;color:#344054;margin-bottom:9px}
.prom-payment-line{display:flex;align-items:center;gap:6px;font-size:12px}
.prom-payment-dot,.payment-paid-dot,.payment-unknown-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#16c765;flex:0 0 auto}
.payment-unknown-dot{background:#c7ced9}
.row-status-form{margin:0}
.row-status-select{width:100%;min-width:125px;height:36px;border:1px solid #cfd8e6;border-radius:7px;background:#fff;padding:5px 28px 5px 10px;font-weight:600}
.prom-status-payment{margin-top:8px;font-size:11px;color:#697386;display:flex;align-items:center;gap:5px}
@media(max-width:1200px){
  .prom-order-col{width:32%}.prom-delivery-col{width:26%}.prom-recipient-col{width:18%}
}

/* V24-R1-R37: complete one-block CRM order composer */
.orders-head-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.create-order-btn{white-space:nowrap}
.order-composer{max-width:1180px;padding:0;overflow:visible}.order-composer-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px 18px;border-bottom:1px solid var(--line)}.composer-fixed{font-size:12px;color:var(--muted)}
.order-composer-form{padding:0}.composer-section{padding:17px 18px;border-bottom:1px solid var(--line)}.composer-section-title{display:flex;align-items:center;gap:8px;margin-bottom:12px}.composer-section-title>span{display:inline-flex;width:23px;height:23px;border-radius:50%;align-items:center;justify-content:center;background:#edf3ff;color:#2161d1;font-size:12px;font-weight:700}.composer-section-title>b{font-size:14px}
.composer-grid{display:grid;gap:12px 14px}.customer-grid{grid-template-columns:1.4fr 1fr 1fr}.delivery-grid{grid-template-columns:1fr 1fr 2fr}.composer-grid label{margin:0}.composer-grid input,.composer-grid select,.composer-section textarea{display:block;width:100%;margin-top:5px}.composer-section textarea{border:1px solid #cbd5e1;border-radius:6px;padding:9px 10px;font:inherit;resize:vertical}
.lookup-state{margin-top:9px;padding:8px 10px;border-radius:6px;background:#f7f9fc;font-size:12px}.customer-found{background:#eaf8ef;color:#176b36}.customer-new{background:#eef4ff;color:#245eae}.customer-possible{background:#fff8e5;color:#7b5a08}.lookup-results{display:flex;flex-direction:column;gap:4px;margin-top:6px}.lookup-result{border:1px solid var(--line);background:#fff;border-radius:6px;text-align:left;padding:8px 10px;cursor:pointer}.lookup-result:hover{border-color:#8fb1ee;background:#f8fbff}
.product-picker{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;gap:8px}.product-lookup-results{margin:8px 0;max-height:315px;overflow:auto;border-radius:7px}.product-lookup-row{width:100%;display:grid;grid-template-columns:44px minmax(0,1fr) 210px;gap:10px;align-items:center;border:0;border-bottom:1px solid var(--line);background:#fff;padding:8px;text-align:left;cursor:pointer}.product-lookup-row:hover{background:#f8fbff}.product-lookup-row img,.product-lookup-no-photo{width:42px;height:42px;object-fit:contain;border:1px solid var(--line);border-radius:5px;display:flex;align-items:center;justify-content:center}.product-lookup-main{display:flex;flex-direction:column;min-width:0}.product-lookup-main span{font-size:12px;color:var(--muted);white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.35}.product-lookup-stock{font-size:11px;color:#4c5a6d;text-align:right}
.composer-items-wrap{overflow:auto;border:1px solid var(--line);border-radius:7px}.composer-items-table{width:100%;border-collapse:collapse;min-width:900px}.composer-items-table th{background:#f7f9fc;font-size:11px;padding:8px;text-align:left}.composer-items-table td{padding:8px;border-top:1px solid var(--line);vertical-align:middle}.composer-product-cell{display:flex;gap:8px;align-items:center;min-width:280px}.composer-product-cell img,.composer-no-photo{width:42px;height:42px;object-fit:contain;border:1px solid var(--line);border-radius:5px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.composer-product-cell>div{display:flex;flex-direction:column}.composer-product-cell span{font-size:11px;color:var(--muted)}.composer-stock{font-size:11px;max-width:160px}.composer-qty{width:80px}.composer-price{width:100px}.composer-price-type{min-width:165px}.composer-line-total{font-weight:700;white-space:nowrap}.composer-total-label{text-align:right;font-weight:700}.composer-items-table tfoot td{background:#fbfcfe}.price-foundation-note{margin-top:7px}.icon-btn{border:0;background:transparent;font-size:22px;color:#8490a2;cursor:pointer}.icon-btn:hover{color:#c43131}
.composer-actions{display:flex;justify-content:flex-end;gap:8px;padding:14px 18px;background:#fbfcfe}.delivery-destination{min-width:260px}
@media(max-width:900px){.customer-grid,.delivery-grid{grid-template-columns:1fr}.product-picker{grid-template-columns:1fr auto}.product-picker .btn:last-child{grid-column:1/-1}.product-lookup-row{grid-template-columns:44px minmax(0,1fr)}.product-lookup-stock{grid-column:2;text-align:left}.order-composer-head{align-items:flex-start;flex-direction:column}}

/* V24-R1-R38: structured Nova Poshta delivery composer */
.delivery-main-grid{grid-template-columns:1fr 1.45fr 1fr}.np-destination-block,.np-address-block,.generic-delivery-block{margin-top:12px;position:relative}.np-destination-block>label,.np-address-block>label,.generic-delivery-block>label{display:block;position:relative}.np-destination-block input,.np-address-block input,.generic-delivery-block input{display:block;width:100%;margin-top:5px}.np-suggest{position:absolute;z-index:30;left:0;right:0;top:100%;max-height:300px;overflow:auto;background:#fff;border:1px solid #cbd5e1;border-radius:0 0 7px 7px;box-shadow:0 8px 22px rgba(28,45,75,.12)}#np-locality-label{position:relative}.np-suggest:empty{display:none}.np-suggest-row{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:2px;padding:9px 11px;border:0;border-bottom:1px solid var(--line);background:#fff;text-align:left;cursor:pointer}.np-suggest-row:hover{background:#f4f8ff}.np-suggest-row b{font-size:12px}.np-suggest-row span,.np-suggest-state{font-size:11px;color:var(--muted)}.np-suggest-state{padding:10px 11px}.package-fields{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:7px;background:#fafbfd}.package-fields-title{display:flex;gap:8px;align-items:baseline;margin-bottom:9px}.package-fields-title b{font-size:12px}.package-fields-title span{font-size:11px;color:var(--muted)}.package-grid{grid-template-columns:1fr 1fr 1fr 1fr}.np-validation{margin-top:10px;padding:9px 11px;border-radius:7px;font-size:12px;background:#f7f9fc}.np-ok{background:#eaf8ef;color:#176b36}.np-warning{background:#fff8e5;color:#7b5a08}.np-error{background:#fdeeee;color:#a12727}.delivery-composer-section [hidden]{display:none!important}
@media(max-width:900px){.delivery-main-grid,.package-grid{grid-template-columns:1fr 1fr}.delivery-main-grid label:nth-child(2){grid-column:1/-1}}
@media(max-width:620px){.delivery-main-grid,.package-grid{grid-template-columns:1fr}.delivery-main-grid label:nth-child(2){grid-column:auto}}



/* V24-R1-R39 quick order fulfillment panel */
.prom-delivery-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.quick-ttn-badge{display:inline-flex;align-items:center;border:1px solid #b8c9ea;border-radius:999px;padding:2px 7px;font-size:11px;font-weight:700;background:#f4f7fd;color:#244b8f}
.quick-order-actions{display:flex;gap:10px;margin-top:7px}
.quick-link{appearance:none;border:0;background:none;padding:0;color:#2865d8;font:inherit;font-size:12px;font-weight:700;cursor:pointer;text-decoration:none}
.quick-link:hover{text-decoration:underline}
.quick-fulfillment-dialog{width:min(980px,calc(100vw - 34px));max-height:92vh;border:0;border-radius:12px;padding:0;box-shadow:0 20px 70px rgba(15,23,42,.28)}
.quick-fulfillment-dialog::backdrop{background:rgba(15,23,42,.48)}
.quick-fulfillment-form{padding:20px;overflow:auto;max-height:92vh;background:#fff}
.qf-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:14px}.qf-head h3{margin:2px 0 0;font-size:20px}.qf-kicker{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.06em;font-weight:700}.qf-close{border:0;background:transparent;font-size:28px;line-height:1;cursor:pointer;color:#64748b}
.qf-grid{display:grid;gap:12px}.qf-top-grid{grid-template-columns:1fr 1.35fr 1fr}.qf-main-grid{grid-template-columns:1fr 1.5fr 1fr}.qf-recipient-grid{grid-template-columns:1.3fr 1fr;margin-top:12px}.qf-package-grid{grid-template-columns:repeat(4,1fr);margin-top:12px}
.qf-fieldset{border:1px solid #dce4f1;border-radius:10px;padding:14px;margin:16px 0 0}.qf-fieldset legend{padding:0 7px;font-weight:700}.qf-fieldset label,.qf-top-grid label{display:block;font-size:12px;font-weight:600;color:#334155}.qf-fieldset input,.qf-fieldset select,.qf-top-grid input,.qf-top-grid select{display:block;width:100%;margin-top:5px;border:1px solid #cbd5e1;border-radius:7px;padding:9px 10px;background:#fff;font:inherit;color:#0f172a}
.qf-fieldset>label{margin-top:12px}.qf-suggest-wrap{position:relative}.qf-suggest{position:absolute;z-index:50;left:0;right:0;top:100%;background:#fff;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 12px 35px rgba(15,23,42,.15);max-height:280px;overflow:auto}.qf-suggest:empty{display:none}.qf-suggest-row{display:flex;width:100%;flex-direction:column;gap:2px;text-align:left;border:0;border-bottom:1px solid #edf2f7;background:#fff;padding:9px 10px;cursor:pointer}.qf-suggest-row:hover{background:#f4f7fb}.qf-suggest-row span,.qf-state{font-size:11px;color:#64748b}.qf-state{padding:10px}
.qf-validation{margin-top:12px;padding:9px 11px;border-radius:7px;font-size:12px;background:#f1f5f9}.qf-validation.qf-ok{background:#e8f7ee;color:#176b3a}.qf-validation.qf-warning{background:#fff7df;color:#8a5a00}.qf-validation.qf-error{background:#fdecec;color:#9d2c2c}
.qf-lock{padding:10px 12px;border-radius:8px;background:#fff7df;color:#7a5100;font-size:12px;margin-bottom:12px}.qf-fieldset:disabled{opacity:.65}
.qf-actions{display:flex;align-items:center;gap:8px;margin-top:16px}.qf-spacer{flex:1}.qf-ttn-preview{margin-top:14px;padding:13px;border:1px solid #cbd8ee;border-radius:9px;background:#f7f9fd}.qf-preview-grid{display:grid;grid-template-columns:160px 1fr;gap:6px 12px;margin-top:9px;font-size:12px}.qf-preview-grid span{color:#64748b}.qf-preview-note{margin-top:10px;padding-top:9px;border-top:1px solid #dce4f1;font-size:11px;color:#64748b}
@media(max-width:800px){.qf-top-grid,.qf-main-grid,.qf-recipient-grid,.qf-package-grid{grid-template-columns:1fr}.qf-actions{flex-wrap:wrap}.qf-spacer{display:none;width:100%}}

/* V24-R1-R39-R2: source preload + Nova Poshta delivery estimate */
.qf-cost-box{margin-top:10px;border:1px solid #dbe3ef;border-radius:8px;background:#f8fafc;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.qf-cost-box[hidden]{display:none}
.qf-cost-box span{display:block;font-size:12px;color:#64748b;margin-bottom:2px}
.qf-cost-box strong{display:block;font-size:16px}
.qf-cost-button{white-space:nowrap}

/* CRM-ORDER-UX-R4: canonical Media Manager thumbnail in order item table */
.order-item-photo-head,.order-item-photo-cell{width:58px;text-align:center}
.order-item-thumb-link,.order-item-thumb-empty{width:42px;height:42px;margin:auto;border:1px solid var(--line);border-radius:5px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.order-item-thumb-link{cursor:pointer}
.order-item-thumb-link img{display:block;width:100%;height:100%;object-fit:contain}
.order-item-thumb-empty{color:#a0a9b8;font-size:16px}

/* CRM-R6 order comments */
.order-comments-panel{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.order-client-comment{
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-soft,#f8fafc);
}

.order-comment-label{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:6px;
}

.order-comment-text{
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.45;
}

.order-manager-comments{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.order-manager-comment{
  padding:10px 12px;
  border-left:3px solid var(--border);
  background:var(--surface-soft,#f8fafc);
  border-radius:0 8px 8px 0;
}

.order-comment-meta{
  margin-top:6px;
  font-size:12px;
  opacity:.68;
}

.order-comment-add{
  margin-top:2px;
}

.order-comment-add-empty{
  margin:10px 0 16px;
}

.order-comment-form{
  margin-top:10px;
  max-width:760px;
}

.order-comment-form textarea{
  display:block;
  width:100%;
  box-sizing:border-box;
  resize:vertical;
  min-height:82px;
}

.order-comment-actions{
  margin-top:8px;
}

.prom-order-comment-row td{
  padding-top:0 !important;
}

.prom-order-client-comment{
  margin:0 0 8px;
  padding:7px 10px;
  border-radius:8px;
  background:var(--surface-soft,#f8fafc);
  font-size:13px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.prom-order-client-comment span{
  font-weight:600;
  margin-right:5px;
}

.prom-order-client-comment strong{
  font-weight:500;
}

/* CRM-R6-A10-R1 manager comments in orders list */
.prom-order-manager-comment{
  margin:0 0 8px;
  padding:7px 10px;
  border-radius:8px;
  background:var(--surface-soft,#f8fafc);
  font-size:13px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.prom-order-manager-comment-label{
  font-weight:600;
  margin-right:5px;
}

.prom-order-manager-comment strong{
  font-weight:500;
}

.prom-order-manager-comment-meta,
.prom-order-manager-comment-more{
  margin-left:9px;
  opacity:.62;
  white-space:nowrap;
}

.prom-order-manager-comment-more{
  font-weight:600;
}

/* CRM_TRACKING_UI_R2 */

.np-track-status{
    display:inline-flex;
    align-items:center;
    margin-left:6px;
    padding:3px 7px;
    border-radius:999px;
    font-size:11px;
    line-height:1.25;
    font-weight:700;
    vertical-align:middle;
}

.np-track-muted{
    background:#f1f3f5;
    color:#667085;
}

.np-track-info{
    background:#eef4ff;
    color:#175cd3;
}

.np-track-warning{
    background:#fff4e5;
    color:#b54708;
}

.np-track-success{
    background:#ecfdf3;
    color:#027a48;
}

.np-track-danger{
    background:#fef3f2;
    color:#b42318;
}

.np-movement{
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid var(--border,#e5e7eb);
}

.np-movement-title{
    margin-bottom:10px;
    font-weight:700;
}

.np-movement-item{
    position:relative;
    display:flex;
    gap:10px;
    padding:0 0 14px 4px;
}

.np-movement-item:not(:last-child)::after{
    content:"";
    position:absolute;
    left:8px;
    top:16px;
    bottom:-1px;
    width:1px;
    background:var(--border,#e5e7eb);
}

.np-movement-dot{
    position:relative;
    z-index:1;
    flex:0 0 auto;
    width:10px;
    height:10px;
    margin-top:4px;
    border-radius:50%;
    background:#98a2b3;
}

.np-movement-item.current .np-movement-dot{
    background:#f79009;
}

.np-movement-body{
    min-width:0;
}

.np-movement-empty{
    padding:8px 0 2px 20px;
    color:#667085;
    font-size:12px;
}

/* ==========================================================
   RETURNS-R17-A10-R4
   Canonical explicit order tree presentation

   Structure comes ONLY from server-rendered metadata:
     data-order-tree-toggle
     data-order-tree-ancestors
     aria-expanded

   Old A21 href/:has tree styling has been removed.
   ========================================================== */


/* ----------------------------------------------------------
   Root navigation

   IMPORTANT:
   Do NOT draw one continuous border-left through the whole
   order navigation. Each hierarchy level draws its own trunk.
   ---------------------------------------------------------- */

.order-subnav{
  position:relative;
  margin:2px 0 8px!important;
  padding:3px 0 4px 13px!important;
  border-left:0!important;
}


/* Every tree row is a positioning context. */
.order-subnav > .order-subitem{
  position:relative;
}


/* ==========================================================
   LEVEL 1
   Все / Принятые / ... / Неудачные
   ========================================================== */

.order-subnav
> .order-subitem:not([data-order-tree-ancestors]){
  padding-left:8px!important;
  margin:1px 0!important;
}


/*
 * Main vertical status trunk.
 *
 * x=-13 places it at the original order-subnav border line.
 */
.order-subnav
> .order-subitem:not([data-order-tree-ancestors])::after{
  content:"";
  position:absolute;
  left:-13px;
  top:-2px;
  bottom:-2px;
  border-left:1px solid #314057;
}


/* First status starts the trunk at its own centre. */
.order-subnav
> .order-subitem:not([data-order-tree-ancestors]):first-child::after{
  top:50%;
}


/*
 * Ordinary first-level status branch.
 */
.order-subnav
> .order-subitem:not(
    [data-order-tree-ancestors]
  ):not(
    [data-order-tree-toggle]
  )::before{
  content:"";
  position:absolute;
  left:-13px;
  top:50%;
  width:9px;
  border-top:1px solid #314057;
}


/*
 * НЕУДАЧНЫЕ:
 *
 * - text uses exactly the same x position as every other
 *   first-level status;
 * - the main trunk ENDS here;
 * - nothing continues down the old first-level line.
 */
.order-subnav
> .order-tree-parent[data-order-tree-toggle="failed"]{
  padding-left:8px!important;
}

.order-subnav
> .order-tree-parent[data-order-tree-toggle="failed"]::after{
  bottom:50%;
}


/* ==========================================================
   +/- DISCLOSURE NODE
   ========================================================== */

.order-subnav .order-tree-parent::before{
  content:"+";
  box-sizing:border-box;

  position:absolute;
  top:50%;

  width:11px;
  height:11px;

  display:flex;
  align-items:center;
  justify-content:center;

  transform:translateY(-50%);

  border:1px solid #53657d;
  border-radius:2px;

  background:#111827;
  color:#91a4bd;

  font-family:Arial,sans-serif;
  font-size:10px;
  font-weight:700;
  line-height:9px;

  z-index:3;
}

.order-subnav
.order-tree-parent[aria-expanded="false"]::before{
  content:"+"!important;
}

.order-subnav
.order-tree-parent[aria-expanded="true"]::before{
  content:"−"!important;
  color:#fff;
  border-color:#8194ad;
}


/*
 * Top-level Неудачные node sits on the main status trunk.
 */
.order-subnav
> .order-tree-parent[data-order-tree-toggle="failed"]::before{
  left:-19px!important;
}


/* ==========================================================
   LEVEL 2
   Children of Неудачные

   EXACT attribute equality deliberately distinguishes these
   rows from third-level return-state children.
   ========================================================== */

.order-subnav
> .order-subitem[data-order-tree-ancestors="failed"]{
  position:relative;

  /*
   * All failed subtypes now use ONE alignment.
   *
   * This explicitly fixes the historical A21 collision where
   * refused/unclaimed/damaged were forced to 20px.
   */
  padding-left:30px!important;

  margin:2px 0!important;
  min-height:28px;
  font-size:13px!important;
}


/*
 * New nested trunk.
 *
 * Notice that this is at x=6 INSIDE the child level,
 * not on the old first-level line. Therefore visually:
 *
 *      − Неудачные
 *          │
 *          ├─ Отказ...
 *          ├─ Не забрали...
 *          ...
 */
.order-subnav
> .order-subitem[data-order-tree-ancestors="failed"]::after{
  content:"";
  position:absolute;

  left:6px;
  top:-3px;
  bottom:-3px;

  border-left:1px solid #40516b;
}


/*
 * Ordinary level-2 rows get a horizontal branch.
 * Expandable level-2 rows use their +/- box instead.
 */
.order-subnav
> .order-subitem[data-order-tree-ancestors="failed"]:not(
    .order-tree-parent
  )::before{
  content:"";
  position:absolute;

  left:6px;
  top:50%;

  width:10px;

  border-top:1px solid #40516b;
}


/*
 * All expandable level-2 nodes sit ON the nested trunk.
 *
 * Strong explicit selector intentionally beats any remaining
 * generic order-subitem declarations.
 */
.order-subnav
> .order-subitem.order-tree-parent[
    data-order-tree-ancestors="failed"
  ]::before{
  left:1px!important;
}


/*
 * LightReturn is currently the last level-2 row.
 * End the Неудачные child trunk at its centre, so the line
 * does NOT continue into empty space below the tree.
 */
.order-subnav
> .order-tree-parent[
    data-order-tree-toggle="light-return"
  ][data-order-tree-ancestors="failed"]::after{
  bottom:50%;
}


/* ==========================================================
   LEVEL 3
   Return transport states

   failed failure-refused
   failed failure-unclaimed
   failed failure-damaged
   failed light-return
   ========================================================== */

.order-subnav
> .order-subitem[
    data-order-tree-ancestors^="failed "
  ]{
  position:relative;

  margin:0 0 0 15px!important;
  padding:5px 8px 5px 20px!important;

  min-height:27px;

  font-size:11px!important;
  color:#8fa3bd!important;
}


/* Level-3 vertical trunk. */
.order-subnav
> .order-subitem[
    data-order-tree-ancestors^="failed "
  ]::after{
  content:"";
  position:absolute;

  left:6px;
  top:-1px;
  bottom:-1px;

  border-left:1px solid #40516b;
}


/* Level-3 horizontal branch. */
.order-subnav
> .order-subitem[
    data-order-tree-ancestors^="failed "
  ]::before{
  content:"";
  position:absolute;

  left:6px;
  top:50%;

  width:9px;

  border-top:1px solid #40516b;
}


/*
 * Each transport subtree ends at its "returned" row.
 */
.order-subnav
> .order-subitem[
    data-order-tree-ancestors^="failed "
  ][href*="return_state=returned"]::after,
.order-subnav
> .order-subitem[
    data-order-tree-ancestors~="light-return"
  ][href*="light_return_state=returned"]::after{
  bottom:50%;
}


/* Third-level counters are visually secondary. */
.order-subnav
> .order-subitem[
    data-order-tree-ancestors^="failed "
  ] b{
  opacity:.78;
}


/* Selected third-level state. */
.order-subnav
> .order-subitem.active[
    data-order-tree-ancestors^="failed "
  ]{
  color:#fff!important;
  background:#26374f!important;
}


/* ==========================================================
   Runtime collapse
   ========================================================== */

.order-subnav
[data-order-tree-ancestors][hidden]{
  display:none!important;
}


/* ==========================================================
   Hover / active node polish
   ========================================================== */

.order-subnav
.order-tree-parent:hover::before,
.order-subnav
.order-tree-parent.active::before{
  color:#fff;
  border-color:#8194ad;
}


/* /RETURNS-R17-A10-R4 canonical explicit order tree */

