/* Unified order and payment detail */
.order-detail-list{display:grid;gap:16px}
.order-detail-card{border:1px solid #dfe9e1;border-radius:18px;background:#fff;box-shadow:0 7px 22px #1635220d;overflow:hidden;color:#183126}
.order-detail-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:18px 20px;border-bottom:1px solid #edf1ed;background:linear-gradient(105deg,#fff,#f3fbf5)}
.order-detail-header small{display:block;color:#5a8970;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.order-detail-header h3{margin:5px 0 0;font-size:19px;overflow-wrap:anywhere}
.order-detail-badge,.order-detail-inline-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#fff0d7;color:#c57400;padding:7px 11px;font-size:12px;font-weight:800;text-transform:capitalize;white-space:nowrap}
.order-detail-badge.status-confirmed,.order-detail-badge.status-completed,.order-detail-inline-badge:has(+ *){background:#e4f7e8;color:#16743a}.status-processing,.status-shipped{background:#e9f1ff;color:#2e67b9}.status-cancelled{background:#ffe6e6;color:#ba3434}
.order-detail-customer{display:grid;grid-template-columns:minmax(220px,.85fr) minmax(340px,1.15fr);gap:16px;padding:18px 20px;border-bottom:1px solid #edf1ed}
.order-detail-customer>div{display:flex;align-items:center;gap:11px;font-size:15px}.order-detail-customer>div span{width:25px;color:#177744;font-weight:900;text-align:center}.order-detail-customer>div b{font-size:18px}.order-detail-customer>div p{margin:0}.order-detail-customer a{color:inherit;text-decoration:none}
.order-detail-customer>dl{grid-column:2;grid-row:1 / span 3;margin:0;padding-left:18px;border-left:1px solid #e4ece6;display:grid;align-content:start;gap:7px}.order-detail-customer dl div,.order-detail-payment dl div{display:grid;grid-template-columns:118px 1fr;gap:8px}.order-detail-customer dt,.order-detail-payment dt{color:#718176;font-size:13px}.order-detail-customer dd,.order-detail-payment dd{margin:0;font-weight:650;overflow-wrap:anywhere}
.order-detail-items{padding:18px 20px;border-bottom:1px solid #edf1ed}.order-detail-section-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.order-detail-section-title h4,.order-detail-payment h4,.order-detail-update h4{margin:0;font-size:17px}.order-detail-section-title h4 span{color:#69796e;font-weight:600}.order-detail-section-title>span{padding:7px 11px;border-radius:9px;background:#eef5f0;color:#1a4a31;font-weight:750}
.order-detail-items ol{display:grid;gap:10px;margin:0;padding:0;list-style:none}.order-detail-item{display:grid;grid-template-columns:78px minmax(160px,1.5fr) minmax(100px,.7fr) minmax(115px,.75fr);gap:12px;align-items:center;padding:11px;border:1px solid #e8efea;border-radius:13px}.order-detail-item-icon{display:grid;place-items:center;width:66px;height:66px;border-radius:10px;background:#f0f5f0;color:#398452;font-size:28px}.order-detail-item-copy{display:grid;gap:4px;min-width:0}.order-detail-item-copy b{font-size:15px;overflow-wrap:anywhere}.order-detail-item-copy small,.order-detail-quantity small,.order-detail-line-total small{color:#6f7c72;font-size:12px}.order-detail-quantity,.order-detail-line-total{display:grid;gap:3px;align-content:center;padding-left:12px;border-left:1px solid #e8eeea}.order-detail-line-total b{font-size:16px;overflow-wrap:anywhere}.order-detail-total{display:flex;align-items:center;justify-content:flex-end;gap:24px;margin-top:12px;padding:14px;border-radius:12px;background:#f4f8f5}.order-detail-total span{color:#5f6c62}.order-detail-total span b{margin-left:18px;color:#172b20}.order-detail-total strong{display:grid;gap:2px;padding:8px 15px;border:1px solid #6bb486;border-radius:9px;color:#315c42;font-weight:600}.order-detail-total strong b{color:#10271b;font-size:18px}
.order-detail-payment{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.75fr);gap:16px;align-items:start;padding:18px 20px;border-bottom:1px solid #edf1ed}.order-detail-payment h4{grid-column:1/-1}.order-detail-payment dl{display:grid;gap:8px;margin:0}.order-detail-receipt{display:flex;align-items:center;justify-content:center;min-height:70px;padding:10px;border-radius:12px;background:#eaf7ee;color:#16733b;text-decoration:none;font-weight:800;text-align:center}.order-detail-no-receipt{display:grid;place-items:center;min-height:70px;padding:10px;border-radius:12px;background:#f5f7f5;color:#718176;text-align:center;font-size:13px}
.order-detail-update{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:18px 20px;background:#fbfdfb}.order-detail-update h4{grid-column:1/-1}.order-detail-update label{display:grid;gap:6px;color:#5c6c60;font-size:12px;font-weight:750}.order-detail-update :is(input,select){min-width:0;box-sizing:border-box;width:100%;min-height:42px;border:1px solid #d7e3da;border-radius:9px;padding:0 11px;background:#fff;color:#1a3022;font:inherit}.order-detail-update .order-detail-note{grid-column:1/-1}.order-detail-update button{grid-column:1/-1;min-height:44px;border-radius:10px}.order-detail-message{grid-column:1/-1;min-height:1.2em;margin:0;color:#16733b;font-weight:700}.order-detail-empty{padding:18px;border-radius:12px;background:#f4f8f5;color:#65756a;text-align:center}
@media(max-width:720px){.order-detail-header,.order-detail-customer,.order-detail-items,.order-detail-payment,.order-detail-update{padding:15px}.order-detail-customer{grid-template-columns:1fr}.order-detail-customer>dl{grid-column:auto;grid-row:auto;padding:14px 0 0;border-left:0;border-top:1px solid #e4ece6}.order-detail-item{grid-template-columns:55px minmax(0,1fr) auto;gap:9px;padding:9px}.order-detail-item-icon{width:50px;height:50px;font-size:22px}.order-detail-item-copy{grid-column:2}.order-detail-quantity{grid-column:3;grid-row:1 / span 2;padding-left:8px;border-left:0;text-align:right}.order-detail-line-total{grid-column:2/-1;grid-row:2;padding:7px 0 0;border-left:0;border-top:1px solid #eef2ef;display:flex;align-items:center;justify-content:space-between}.order-detail-total{align-items:stretch;flex-direction:column;gap:10px}.order-detail-total span b{float:right}.order-detail-total strong{display:flex;align-items:center;justify-content:space-between}.order-detail-payment{grid-template-columns:1fr}.order-detail-update{grid-template-columns:1fr}.order-detail-update .order-detail-note{grid-column:auto}}

/* ---- Order detail (owner's design): header, customer|facts, item cards, actions, payment ---- */
.od{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;width:100%;max-width:100%;box-sizing:border-box;color:#14231b;font-size:14px;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
.od>*,.od-card>*,.od-items ol>*{min-width:0;box-sizing:border-box}
.od .od-icon{width:22px;height:22px;flex:0 0 auto;display:block}
.od p{margin:0}
.od-head{display:flex;align-items:center;gap:8px}
.od-back{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;background:none;color:#14231b;cursor:pointer}
.od-back .od-icon{width:24px;height:24px}
.od-head h2{flex:0 0 auto;margin:0;font-size:26px;line-height:1.1;font-weight:800;letter-spacing:-.4px;color:#122319}
.od-code{flex:1 1 0;min-width:0;padding:7px 10px;border-radius:9px;background:#e4f3e8;color:#14231b;font-size:12px;font-weight:700}
.od-pill{display:inline-flex;white-space:nowrap;justify-self:start;align-items:center;padding:4px 11px;border-radius:9px;background:#ffe6c7;color:#e2750e;font-size:14px;font-weight:700;line-height:1.3;text-transform:lowercase}
.od-head>.od-pill{font-size:18px;padding:6px 14px}
.od-pill.od-confirmed,.od-pill.od-paid,.od-pill.od-completed{background:#dcf4e3;color:#13803b}
.od-pill.od-processing,.od-pill.od-shipped{background:#e3edff;color:#2d62c4}
.od-pill.od-cancelled,.od-pill.od-rejected{background:#ffe1e1;color:#c63434}
.od-card{background:#fff;border-radius:16px;padding:14px;box-shadow:0 2px 10px #12301f12;border:1px solid #edf1ee}
.od-rule{display:block;align-self:stretch;width:1px;background:#e2e8e4}
.od-customer{display:grid;grid-template-columns:minmax(0,.95fr) 1px minmax(0,1.25fr);gap:12px;align-items:start}
.od-person{display:grid;gap:12px;min-width:0}
.od-person p{display:flex;align-items:center;gap:9px;min-width:0;font-size:15px;color:#14231b;overflow-wrap:anywhere}
.od-person .od-icon{color:#24323f;width:22px;height:22px}
.od-who strong{font-size:19px;font-weight:800;line-height:1.2}
.od-facts{display:grid;gap:9px;min-width:0}
.od-facts p,.od-info p,.od-qty p,.od-pay-facts p{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;column-gap:6px;min-width:0}
.od-facts p{grid-template-columns:auto 8px minmax(0,1fr);font-size:13px}
.od-facts span,.od-info span,.od-qty span,.od-pay-facts span{color:#5f6b78}
.od-facts i,.od-info i,.od-qty i,.od-pay-facts i{font-style:normal;color:#5f6b78}
.od-facts b{font-weight:600;color:#1d2a35;overflow-wrap:anywhere}
.od-items{display:grid;gap:10px}
.od-items-head{display:flex;align-items:center;justify-content:space-between}
.od-items-head h3,.od-pay-facts h3{margin:0;font-size:20px;font-weight:800;color:#122319}
.od-count{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:9px;background:#eef3f9;font-size:18px}
.od-count .od-icon{width:22px;height:22px;color:#14231b}
.od-items ol{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.od-item{display:grid;grid-template-columns:62px minmax(0,1fr) 1px 92px 96px;align-items:center;gap:8px;padding:8px;border:1px solid #e3e8e5;border-radius:12px;background:#fff}
.od-photo{display:grid;place-items:center;width:62px;height:62px;border:1px solid #e8ece9;border-radius:9px;background:#fff;overflow:hidden;font-size:30px}
.od-photo img{width:100%;height:100%;object-fit:contain}
.od-info{display:grid;gap:3px;min-width:0}
.od-name{font-size:13px;font-weight:800;line-height:1.2;color:#122319;text-transform:uppercase;overflow-wrap:anywhere;margin-bottom:2px}
.od-info p,.od-qty p{font-size:11.5px;grid-template-columns:auto 6px minmax(0,1fr)}
.od-info b,.od-qty b{font-weight:500;color:#1d2a35;overflow-wrap:anywhere}
.od-qty{display:grid;gap:3px;min-width:0}
.od-qty .od-unit-price{display:grid;grid-template-columns:1fr;row-gap:1px}
.od-qty .od-unit-price b{font-weight:800;color:#122319;white-space:nowrap}
.od-amount{display:grid;gap:3px;align-self:center;padding:9px 10px;border-radius:9px;background:#eef3f9;min-width:0}
.od-amount small{font-size:11.5px;color:#4b5866}
.od-amount b{font-size:14px;font-weight:800;color:#122319;white-space:nowrap}
.od-total{display:grid;grid-template-columns:minmax(0,1fr) 1px auto;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;background:#eef3f9}
.od-total p{display:flex;gap:8px;font-size:17px;font-weight:700;color:#3b4652;white-space:nowrap}
.od-total p i{font-style:normal}.od-total p b{color:#122319}
.od-total-amount{display:grid;gap:2px;padding:8px 14px;border:1px solid #a8dbb7;border-radius:10px;background:#e4f5e9}
.od-total-amount small{font-size:13px;color:#2f3a35}
.od-total-amount b{font-size:22px;font-weight:800;color:#122319;white-space:nowrap}
.od-form .order-page-form-fields{display:none}
.od-form.is-editing .order-page-form-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 10px}
.od-actions{display:grid;grid-template-columns:minmax(0,1.35fr) repeat(3,minmax(0,1fr));gap:8px}
.od-btn{display:flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 6px;border-radius:9px;border:1.5px solid #14231b;background:#fff;color:#14231b;font:inherit;font-size:clamp(12px,3.3vw,16px);font-weight:700;text-decoration:none;cursor:pointer;white-space:nowrap}
.od-btn .od-icon{width:20px;height:20px}
.od-received{background:#11893a;border-color:#11893a;color:#fff;--od-doc-line:#11893a}
.od-received[aria-disabled="true"]{opacity:.5;pointer-events:none}
.od-save{background:#e6f0fc;border-color:#9cc3ee;color:#1d63c8}
.od-delete{border-color:#e14444;color:#e02020}
.od .order-page-message{margin:8px 0 0;font-size:13px;color:#47524c}
.od .order-page-message:empty{display:none}
.od-form{margin:0!important;padding:0!important;border:0!important;background:none!important}
.od-payment{display:grid;grid-template-columns:minmax(0,1fr) 1px minmax(0,auto);gap:12px;align-items:center}
.od-pay-facts{display:grid;gap:9px;min-width:0}
.od-pay-facts h3{font-size:18px;margin-bottom:2px}
.od-pay-facts p{grid-template-columns:minmax(96px,auto) 8px minmax(0,1fr);font-size:13px}
.od-pay-facts b{font-weight:500;color:#1d2a35;overflow-wrap:anywhere}
.od-receipt{display:flex;align-items:center;gap:10px;padding:12px;border-radius:12px;background:#f2f6f3;color:#11893a;text-decoration:none;min-width:0}
.od-receipt .od-icon{width:34px;height:34px;padding:7px;border-radius:9px;background:#dff1e4;box-sizing:content-box;color:#11893a}
.od-receipt span{display:grid;gap:3px;min-width:0}
.od-receipt b{font-size:14px;font-weight:800;color:#11893a}
.od-receipt small{font-size:12px;color:#5f6b78}
.od-receipt.is-empty{color:#7b8780}.od-receipt.is-empty b{color:#7b8780}.od-receipt.is-empty .od-icon{color:#9aa59f;background:#eaeeeb}
/* Wider screens: code sits in the header row like the design, more room for photos. */
@media(min-width:560px){
 .od-code{flex:0 1 auto;font-size:13px}
 .od-head h2{margin-right:4px}.od-head>.od-pill{margin-left:auto}
 .od-card{padding:18px}
 .od-item{grid-template-columns:120px minmax(0,1fr) 1px 120px 150px;gap:14px;padding:10px}
 .od-photo{width:120px;height:110px}
 .od-name{font-size:15px}.od-info p,.od-qty p{font-size:13px}
 .od-amount{padding:12px 14px}.od-amount small{font-size:13px}.od-amount b{font-size:18px}
 .od-facts p,.od-pay-facts p{font-size:14px}
 .od-receipt b{font-size:16px}.od-receipt small{font-size:14px}
}
/* One line per value everywhere: a long value ends with … and opens in full when tapped. */
.od-clip{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.od{position:relative}
.od-pop{position:absolute;z-index:30;max-width:min(320px,90%);padding:7px 11px;border-radius:9px;background:#14231b;color:#fff;font-size:13px;font-weight:600;line-height:1.35;box-shadow:0 8px 22px #0b1f1440;overflow-wrap:anywhere;pointer-events:auto}
.od-facts .od-clip,.od-info .od-clip,.od-qty .od-clip{font-weight:500;color:#1d2a35}
.od-facts .od-clip:has(.od-pill){overflow:visible}
.od-name.od-clip{font-weight:800;color:#122319}
.od-person p>.od-clip{flex:1 1 auto}
.od-who .od-clip{font-size:19px;font-weight:800;line-height:1.2;color:#14231b}
.od-amount .od-clip,.od-qty .od-unit-price .od-clip{font-weight:800;color:#122319}
.od-amount .od-clip{overflow:visible;text-overflow:clip}
.od-qty .od-unit-price{display:grid;grid-template-columns:minmax(0,1fr)}
/* Edit: a panel at the top of the invoice — Confirm or Cancel the order, adjust, then Save. */
.od-edit{display:none;gap:12px;border-color:#9fd3ae;background:#f6fbf7}
.od.is-editing .od-edit{display:grid}
.od-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.od-quick button{min-height:46px;border-radius:10px;border:1.5px solid #11893a;background:#fff;color:#11893a;font:inherit;font-size:15px;font-weight:800;cursor:pointer}
.od-quick .od-quick-cancel{border-color:#e14444;color:#d42424}
.od-quick .od-quick-confirm.is-picked{background:#11893a;color:#fff}
.od-quick .od-quick-cancel.is-picked{background:#e14444;color:#fff}
.od-edit-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.od-edit-fields label{display:grid;gap:4px;font-size:12px;color:#5f6b78;min-width:0}
.od-edit-fields select,.od-edit-fields input{width:100%;min-height:40px;box-sizing:border-box;border:1px solid #cfdad3;border-radius:8px;padding:0 10px;font:inherit;font-size:14px;color:#14231b;background:#fff}
.od-edit-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:8px}
.od-edit .order-page-message{margin:0}
/* Phones: the same layout as the design, just smaller. */
@media(max-width:559px){
 .od{gap:10px;font-size:12px}
 .od .od-icon{width:18px;height:18px}
 .od-head{gap:6px}.od-back{width:26px;height:30px}.od-back .od-icon{width:20px;height:20px}
 .od-head h2{font-size:19px}
 .od-code{font-size:10.5px;padding:6px 8px}
 .od-head>.od-pill{font-size:13px;padding:5px 9px}
 .od-card{padding:10px;border-radius:13px}
 .od-customer{grid-template-columns:minmax(0,1fr) 1px minmax(0,1.25fr);gap:9px}
 .od-person{gap:9px}.od-person p{font-size:12.5px;gap:6px}.od-who .od-clip{font-size:15px}
 .od-facts{gap:6px}.od-facts p{grid-template-columns:auto 6px minmax(0,1fr);font-size:11px;column-gap:4px}
 .od-pill{font-size:11px;padding:2px 7px;border-radius:7px}
 .od-items-head h3{font-size:16px}.od-count{font-size:14px;padding:4px 9px;gap:5px}.od-count .od-icon{width:17px;height:17px}
 .od-items{gap:8px}.od-items ol{gap:7px}
 .od-item{grid-template-columns:50px minmax(0,1.4fr) 1px minmax(0,1fr) auto;gap:5px;padding:5px;border-radius:10px}
 .od-photo{width:50px;height:50px;font-size:22px;border-radius:7px}
 .od-info,.od-qty{gap:2px}
 .od-name.od-clip{font-size:11px;margin-bottom:1px}
 .od-info p,.od-qty p{font-size:10px;grid-template-columns:auto 4px minmax(0,1fr);column-gap:2px}
 .od-amount{padding:5px 6px;border-radius:7px;gap:1px}.od-amount small{font-size:9.5px}.od-amount .od-clip{font-size:11px}
 .od-total{gap:8px;padding:8px 10px}.od-total p{font-size:13px;gap:4px}
 .od-total-amount{padding:6px 10px}.od-total-amount small{font-size:11px}.od-total-amount b{font-size:17px}
 .od-actions{grid-template-columns:auto repeat(3,minmax(0,1fr));gap:5px}
 .od-btn{min-height:42px;gap:2px;padding:0 3px;font-size:10.5px;overflow:hidden}
 .od-btn span{min-width:0;overflow:hidden;text-overflow:ellipsis}
 .od-received{padding:0 6px}.od-received span{overflow:visible}
 .od-btn .od-icon{width:14px;height:14px}
 .od-edit-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .od-quick button{font-size:13px;min-height:42px}
}
/* Phones: the order detail uses the full screen width (6px edge) instead of sitting
   inside the orders box's padding and the page padding. */
@media(max-width:559px){
 .panel:has(.od),.admin-grid:has(.od),#orders-content:has(.od),#orders-table:has(.od){overflow:visible!important}
 #orders-content:has(.od){padding-left:0!important;padding-right:0!important;border-left:0!important;border-right:0!important;background:none!important;box-shadow:none!important}
 .od{width:calc(100% + 12px)!important;max-width:none!important;margin-left:-6px!important;margin-right:-6px!important}
}
