:root{--bg:#f4f6fb;--panel:#fff;--text:#111827;--muted:#667085;--line:#e5e7eb;--blue:#2563eb;--green:#16a34a;--red:#dc2626;--orange:#ea580c;--dark:#0f172a}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,"Microsoft YaHei",sans-serif;font-size:14px}a{text-decoration:none;color:inherit}input,select,textarea{width:100%;padding:10px 11px;border:1px solid #cfd6e3;border-radius:8px;background:#fff;font:inherit}textarea{min-height:82px}.app-shell{display:flex;min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:210px;background:#111827;color:#e5e7eb;padding:18px 14px;overflow:auto}.brand{margin-bottom:18px}.brand strong{display:block;font-size:21px}.brand span{color:#93a4bb;font-size:12px}.sidebar a{display:block;padding:11px 12px;border-radius:8px;color:#d8dee9;margin-bottom:4px}.sidebar a.active,.sidebar a:hover{background:var(--blue);color:#fff}.main{margin-left:210px;padding:22px;flex:1}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:12px}.topbar h1{font-size:26px;margin:0 0 6px}.topbar span,.muted,.hint{color:var(--muted)}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 13px;border:1px solid #cfd6e3;border-radius:8px;background:#fff;color:var(--text);cursor:pointer;font:inherit}.btn.primary,button.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.green,button.green{background:var(--green);border-color:var(--green);color:#fff}.btn.red,button.red,.danger{background:var(--red);border-color:var(--red);color:#fff}.btn.small,button.small{padding:6px 10px;font-size:12px}.full{width:100%}.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:16px;box-shadow:0 1px 2px rgba(15,23,42,.03)}.card h3{margin:0 0 12px}.grid{display:grid;gap:14px}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px}.stat span{color:var(--muted)}.stat strong{display:block;font-size:30px;margin-top:8px}.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.form-grid .wide{grid-column:span 4}.form-grid .half{grid-column:span 2}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.table th{background:#f8fafc;color:#475467;font-weight:700}.table tr:last-child td{border-bottom:0}.badge{display:inline-block;padding:4px 9px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:12px;white-space:nowrap}.badge.green{background:#dcfce7;color:#166534}.badge.gray{background:#f3f4f6;color:#374151}.badge.blue{background:#dbeafe;color:#1d4ed8}.badge.red{background:#fee2e2;color:#991b1b}.badge.orange{background:#ffedd5;color:#9a3412}.alert{padding:11px 13px;border-radius:8px;margin-bottom:12px;background:#dcfce7;color:#166534}.alert.error{background:#fee2e2;color:#991b1b}.login-page{display:grid;place-items:center;min-height:100vh;padding:16px}.login-card{width:min(420px,100%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:26px;box-shadow:0 18px 48px rgba(15,23,42,.12)}.login-card h1{margin:0 0 8px;font-size:28px}.login-card label{display:block;margin-top:12px}.thumb{width:92px;height:62px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}.photo-lg{width:100%;max-height:240px;object-fit:cover;border-radius:12px;border:1px solid var(--line)}.item-row{display:grid;grid-template-columns:1fr 120px 1fr auto;gap:8px;margin-bottom:8px;align-items:center}.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:10px}.check-grid label{display:flex;gap:6px;align-items:center;margin:0}.check-grid input{width:auto}.bulk-box{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;padding:12px;margin:12px 0}.split-layout{display:grid;grid-template-columns:360px 1fr;gap:16px}.sticky-panel{position:sticky;top:16px}.drop-zone{border:1px dashed #b8c4d6;background:#f8fafc;border-radius:12px;padding:12px;text-align:center}.drop-zone input{border:0;padding:0}.progress-line{display:flex;gap:6px;flex-wrap:wrap}.progress-line span{padding:4px 8px;border-radius:999px;background:#eef2ff;color:#1d4ed8;font-size:12px}
.mobile-body{background:#f6f8fc}.mobile-header{position:sticky;top:0;z-index:5;background:#111827;color:#fff;padding:14px 16px;display:flex;justify-content:space-between;align-items:center}.mobile-header span{display:block;color:#cbd5e1;font-size:12px;margin-top:3px}.mobile-tabs{position:sticky;top:58px;z-index:4;background:#f6f8fc;border-bottom:1px solid var(--line);display:flex;gap:8px;overflow:auto;padding:10px 12px}.mobile-tabs a{flex:0 0 auto;background:#fff;border:1px solid var(--line);border-radius:999px;padding:9px 13px}.mobile-main{padding:14px}.mobile-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:12px}.mobile-actions{display:grid;gap:9px}.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}.mobile-stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}.mobile-stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px}.mobile-stat span{display:block;color:var(--muted);margin-bottom:8px}.mobile-stat strong{font-size:28px}.mobile-list-row{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.mobile-list-row:last-child{border-bottom:0}.mobile-list-row span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.mobile-list-row em{font-style:normal}.evidence-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.evidence-item{border:1px solid var(--line);border-radius:10px;padding:8px;background:#fff}.evidence-item span{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}.search-row{display:grid;grid-template-columns:1fr auto;gap:8px}.mobile-order-title{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.hint-box{background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:10px;color:#9a3412}
@media(max-width:1000px){.sidebar{display:none}.main{margin-left:0;padding:14px}.topbar{align-items:flex-start}.split-layout,.cols-2,.cols-3,.cols-4,.form-grid{grid-template-columns:1fr}.form-grid .wide,.form-grid .half{grid-column:auto}.item-row{grid-template-columns:1fr}.table{font-size:13px}.table th,.table td{padding:8px}.card{padding:14px}}@media(max-width:480px){.two-cols,.mobile-stat-grid{grid-template-columns:1fr}.mobile-header{top:0}.login-card{padding:20px}}


.main{min-width:0;max-width:100%}.delivery-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;gap:10px;align-items:center}.delivery-filter-buttons{display:flex;gap:8px;flex-wrap:wrap}.delivery-export{white-space:nowrap}.admin-mobile-list{display:none}.admin-order-card{border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px}.order-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}.order-no{font-weight:700;word-break:break-all}.order-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.order-card-grid div{background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:9px;min-width:0}.order-card-grid span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.order-card-grid strong{display:block;font-size:14px;word-break:break-word}.order-card-phone,.order-card-rules{margin:10px 0 0;color:var(--muted)}.order-card-actions{display:grid;gap:8px;margin-top:12px}.assign-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.empty-mobile-card{padding:16px;text-align:center;color:var(--muted);background:#fff;border:1px dashed var(--line);border-radius:12px}
@media(max-width:760px){body{overflow-x:hidden}.main{padding:10px;width:100%;overflow-x:hidden}.topbar{margin-bottom:10px}.topbar h1{font-size:22px}.topbar .actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.card{padding:12px;border-radius:12px;overflow:hidden}.delivery-list-card{padding:10px}.delivery-toolbar{grid-template-columns:1fr;gap:9px}.delivery-search{grid-template-columns:1fr auto;width:100%}.delivery-filter-buttons{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}.delivery-filter-buttons .btn{flex:0 0 auto}.delivery-export{width:100%}.desktop-table{display:none}.admin-mobile-list{display:grid;gap:10px}.form-grid button.primary{width:100%}.check-grid{grid-template-columns:1fr}.item-row{grid-template-columns:1fr}.form-grid select[multiple]{min-height:160px}.order-card-grid{grid-template-columns:1fr 1fr}.table-wrap{max-width:100%}}
@media(max-width:420px){.order-card-grid{grid-template-columns:1fr}.assign-form{grid-template-columns:1fr}.assign-form button{width:100%}.delivery-search{grid-template-columns:1fr}.delivery-search button{width:100%}}
.compact-orders{display:none}.compact-order{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden}.compact-order summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:10px;cursor:pointer}.compact-order summary::-webkit-details-marker{display:none}.compact-main{min-width:0}.compact-no{display:block;font-weight:700;font-size:14px;line-height:1.25;word-break:break-all}.compact-merchant{display:block;font-size:14px;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.compact-meta{display:block;color:var(--muted);font-size:12px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.compact-detail{border-top:1px solid var(--line);padding:10px;background:#fbfdff}.compact-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.compact-detail-grid div{background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px;min-width:0}.compact-detail-grid span{display:block;color:var(--muted);font-size:12px;margin-bottom:3px}.compact-detail-grid strong{display:block;word-break:break-word}.compact-actions{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;margin-top:9px}.compact-assign{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.compact-order[open]{box-shadow:0 8px 24px rgba(15,23,42,.08)}
.order-seq-badge,.compact-order-index{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:700;font-size:12px;line-height:1;padding:5px 9px;white-space:nowrap}.compact-order-index{margin-bottom:5px}
@media(max-width:760px){.admin-mobile-list.compact-orders{display:grid;gap:7px}.admin-order-card{display:none}.delivery-list-card{padding:9px}.compact-detail-grid{grid-template-columns:1fr}.compact-actions{grid-template-columns:1fr}.compact-assign{grid-template-columns:1fr}.compact-assign button{width:100%}.compact-order summary{padding:9px}.compact-no{font-size:13px}.compact-merchant{font-size:13px}.compact-order .badge{font-size:12px;padding:4px 8px}}
.delivery-pagination{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px;flex-wrap:wrap}.delivery-pagination span:first-child{color:var(--muted);margin-right:auto}.btn.disabled{opacity:.45;pointer-events:none;background:#f8fafc}@media(max-width:760px){.delivery-pagination{justify-content:space-between}.delivery-pagination span:first-child{width:100%;margin-right:0}.delivery-pagination .btn{flex:1}}
.user-mobile-list{display:none}.user-mini-card{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;padding:10px}.user-mini-card strong{display:block}.user-mini-card span:not(.badge){display:block;color:var(--muted);font-size:12px;margin-top:3px;word-break:break-all}@media(max-width:760px){.users-admin-page{display:block}.user-form-card{margin-bottom:12px}.user-list-card .desktop-table{display:none}.user-mobile-list{display:grid;gap:8px}.user-mini-card{grid-template-columns:minmax(0,1fr) auto}.user-mini-card>a{grid-column:1/-1;width:100%}}
.mobile-more-toggle{flex:0 0 auto;background:#fff;border:1px solid var(--line);border-radius:999px;padding:9px 13px;color:var(--text)}.mobile-more-menu{position:sticky;top:113px;z-index:3;background:#fff;border-bottom:1px solid var(--line);padding:10px 12px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.mobile-more-menu[hidden]{display:none}.mobile-more-menu a{display:flex;align-items:center;justify-content:center;min-height:40px;border:1px solid var(--line);border-radius:10px;background:#f8fafc;font-size:14px;text-align:center}@media(max-width:420px){.mobile-more-menu{grid-template-columns:repeat(2,minmax(0,1fr));top:113px}}
/* Delivery list: force phone/tablet layout to compact order cards. */
@media(max-width:900px){
  .delivery-list-card .desktop-table{display:none!important}
  .delivery-list-card .admin-mobile-list.compact-orders{display:grid!important;gap:7px}
  .delivery-list-card .admin-order-card{display:none!important}
}

/* Full-screen photo preview for delivery storefront/evidence photos. */
img.photo-lg{cursor:zoom-in}
.image-preview-overlay{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.92);display:flex;align-items:center;justify-content:center;padding:18px}
.image-preview-overlay img{max-width:100%;max-height:92vh;object-fit:contain;border-radius:10px;background:#fff}
.image-preview-close{position:fixed;top:14px;right:14px;width:42px;height:42px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.14);color:#fff;font-size:30px;line-height:1;padding:0}
body.preview-open{overflow:hidden}

.mobile-logout-link{display:inline-block;margin-top:5px;color:#cbd5e1;font-size:12px;text-decoration:underline;text-underline-offset:3px}.mobile-back-btn{flex:0 0 auto;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.28);color:#fff;border-radius:10px;padding:9px 13px}.mobile-header>div{min-width:0}.mobile-header strong{display:block}.mobile-header a{color:inherit}

/* Mobile readability upgrade: larger text and prominent delivery quantities. */
@media(max-width:900px){
  .mobile-body{font-size:16px;line-height:1.55}
  .mobile-header{padding:16px}.mobile-header strong{font-size:20px}.mobile-header span{font-size:14px}.mobile-logout-link{font-size:14px}.mobile-back-btn{font-size:16px;padding:10px 15px}
  .mobile-tabs a,.mobile-more-toggle{font-size:16px;padding:11px 15px}
  .mobile-main{padding:12px}.mobile-card{padding:16px;border-radius:16px;margin-bottom:14px}.mobile-card h3{font-size:22px;margin:0 0 12px}.mobile-card p{font-size:17px;line-height:1.6}
  .btn,button,input,select,textarea{font-size:16px}.btn,button{min-height:46px}.mobile-actions{gap:11px}
  .mobile-order-title strong{font-size:18px;line-height:1.35}.badge{font-size:14px;padding:6px 11px}.photo-lg{max-height:310px}
  .delivery-items-card h3,.complete-form h3{font-size:23px}
  .delivery-item-card,.complete-item-card{display:block;background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:14px;margin:10px 0}
  .delivery-item-name,.complete-product-name{display:block;font-size:20px;font-weight:800;margin-bottom:11px;line-height:1.35;color:#111827}
  .delivery-qty-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .delivery-qty-row>div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0}
  .delivery-qty-row span,.complete-input-label{display:block;color:#667085;font-size:14px;margin-bottom:5px}
  .delivery-qty-row strong{font-size:30px;line-height:1.05;color:#111827;margin-right:5px}
  .delivery-qty-row em{font-style:normal;font-size:16px;color:#475467}
  .complete-plan{display:block;font-size:17px;color:#475467;margin-bottom:9px}.complete-plan strong{font-size:24px;color:#111827}
  .qty-input{height:58px;font-size:24px!important;font-weight:800;text-align:center;border-width:2px;border-color:#93c5fd;background:#fff}
  .delivery-list-card .table{font-size:16px}.delivery-list-card .table th,.delivery-list-card .table td{padding:11px 10px}.delivery-list-card .table td:first-child,.delivery-list-card .table td:nth-child(3),.delivery-list-card .table td:nth-child(6){font-weight:800}
}
@media(max-width:420px){
  .delivery-qty-row{grid-template-columns:1fr}.delivery-qty-row strong{font-size:32px}.mobile-card h3{font-size:21px}
}


/* Mobile delivery status filters and full-width quantity rows. */
.mobile-status-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:14px}.mobile-status-filter{min-height:58px!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;padding:8px 6px!important;border-radius:13px!important;font-weight:700}.mobile-status-filter span{font-size:15px;line-height:1.2;color:#344054}.mobile-status-filter strong{font-size:22px;line-height:1.15;color:#111827;margin-top:3px}.mobile-status-filter.active{background:var(--blue)!important;border-color:var(--blue)!important;color:#fff!important}.mobile-status-filter.active span,.mobile-status-filter.active strong{color:#fff!important}.mobile-order-title>.badge{font-size:15px;padding:7px 12px}
@media(max-width:900px){.mobile-status-filters{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.mobile-status-filter{min-height:62px!important}.mobile-status-filter span{font-size:16px}.mobile-status-filter strong{font-size:24px}.delivery-qty-row{grid-template-columns:1fr!important;gap:12px}.delivery-qty-row>div{width:100%;display:grid;grid-template-columns:1fr auto auto;align-items:end;column-gap:8px;padding:14px 15px}.delivery-qty-row span{grid-column:1/-1;font-size:15px}.delivery-qty-row strong{font-size:34px}.complete-plan{display:block;width:100%;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:18px}.complete-plan strong{font-size:30px}.complete-input-label{font-size:16px;margin-top:10px}.qty-input{width:100%;height:64px;font-size:28px!important}}
@media(max-width:380px){.mobile-status-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.mobile-status-filter{min-height:60px!important}.mobile-status-filter span{font-size:15px}.mobile-status-filter strong{font-size:23px}}


/* Export field selector. */
.export-panel{position:relative}.export-panel>summary{list-style:none}.export-panel>summary::-webkit-details-marker{display:none}.export-field-form{margin-top:10px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;box-shadow:0 12px 32px rgba(15,23,42,.12);min-width:320px}.export-field-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));max-height:320px;overflow:auto}.export-default-box{border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff}.export-default-box h4{margin:0 0 10px}@media(max-width:760px){.export-field-form{min-width:0;width:100%;box-shadow:none}.export-field-grid{grid-template-columns:1fr;max-height:none}.delivery-toolbar .export-panel{width:100%}.delivery-toolbar .export-panel>summary{width:100%}}


/* Batch delivery create panel. */
.batch-delivery-card h4{margin:0 0 4px;font-size:16px}.batch-panel{border:1px solid var(--line);border-radius:12px;background:#fbfdff;padding:14px}.batch-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.batch-panel-head p{margin:0}.batch-counter{display:inline-flex;align-items:center;min-height:34px;border-radius:999px;background:#e0f2fe;color:#075985;padding:6px 12px;white-space:nowrap}.batch-toolbar{display:grid;grid-template-columns:minmax(240px,1fr) auto auto auto;gap:8px;margin-bottom:10px}.merchant-check-table{border:1px solid var(--line);border-radius:12px;background:#fff;max-height:360px;overflow:auto}.merchant-check-row{display:grid;grid-template-columns:42px minmax(150px,1.1fr) minmax(90px,.65fr) minmax(110px,.75fr) minmax(180px,1.2fr) minmax(220px,1.45fr);gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);margin:0}.merchant-check-row:last-child{border-bottom:0}.merchant-check-row:hover{background:#f8fafc}.merchant-check-row input{width:auto}.merchant-check-head{position:sticky;top:0;z-index:1;background:#f8fafc;color:#475467;font-weight:700}.batch-product-rows{display:grid;gap:8px}.batch-product-row{display:grid;grid-template-columns:minmax(260px,1fr) 160px auto;gap:8px;align-items:center}.bulk-qty-tools{display:grid;grid-template-columns:minmax(180px,1fr) 130px 140px auto;gap:8px;align-items:center;border:1px dashed #cbd5e1;border-radius:12px;background:#fff;padding:10px;margin-top:10px}.override-switch-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.inline-check{display:inline-flex;align-items:center;gap:8px;width:auto}.inline-check input{width:auto}.override-table-wrap{max-height:420px;overflow:auto}.override-table th:first-child,.override-table td:first-child{position:sticky;left:0;background:#fff;z-index:1;min-width:160px}.override-table th:first-child{background:#f8fafc}.override-table input{min-width:90px;padding:8px}.batch-delivery-form button[data-batch-submit]{min-height:46px;font-size:16px;font-weight:700}
@media(max-width:900px){.batch-toolbar{grid-template-columns:1fr 1fr}.batch-toolbar input{grid-column:1/-1}.merchant-check-table{overflow:auto}.merchant-check-row{grid-template-columns:36px minmax(150px,1.05fr) minmax(90px,.65fr) minmax(105px,.75fr) minmax(170px,1.1fr) minmax(220px,1.35fr);min-width:900px}.batch-product-row{grid-template-columns:1fr}.bulk-qty-tools{grid-template-columns:1fr 1fr}.bulk-qty-tools button{grid-column:1/-1}.batch-panel-head{display:block}.batch-counter{margin-top:8px}.override-switch-row{align-items:flex-start}.override-table{min-width:720px}}
@media(max-width:520px){.batch-toolbar{grid-template-columns:1fr}.bulk-qty-tools{grid-template-columns:1fr}.batch-panel{padding:12px}.batch-counter{width:100%;justify-content:center}.merchant-check-table{max-height:300px}}


/* Mobile driver account menu. */
.mobile-account-card{grid-column:1/-1;border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:11px 12px}.mobile-account-card strong{display:block;font-size:16px}.mobile-account-card span{display:block;color:var(--muted);font-size:13px;margin-top:3px}.mobile-tabs .mobile-more-toggle{font-weight:700}


/* Delivery order detail links and admin operations upgrade. */
.delivery-filter-form{display:grid;grid-template-columns:minmax(260px,1.2fr) 150px 150px 120px auto auto;gap:8px;align-items:end;width:100%}.delivery-filter-form label span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.delivery-filter-buttons .btn.active{background:var(--blue);border-color:var(--blue);color:#fff}.order-detail-link{display:inline-flex;flex-direction:column;align-items:flex-start;gap:3px;color:#0f172a;text-decoration:none;line-height:1.25}.order-detail-link strong{font-weight:800;word-break:break-all}.order-detail-link span{display:inline-flex;align-items:center;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:12px;font-weight:700;padding:3px 8px}.order-detail-link:hover strong{text-decoration:underline}.time-stack{display:grid;gap:4px;min-width:150px}.time-stack span{display:flex;gap:6px;align-items:baseline;white-space:nowrap}.time-stack em{font-style:normal;color:var(--muted);font-size:12px;min-width:28px}.time-stack strong{font-weight:600;color:#111827;font-size:12px}.mobile-order-detail-link{display:block;color:inherit}.mobile-order-detail-link strong{display:block;font-size:18px;line-height:1.35}.mobile-order-detail-link span{display:inline-flex;margin-top:6px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:14px;font-weight:800;padding:5px 10px}.image-preview-close{font-family:Arial,sans-serif;font-weight:700}.permission-groups{display:grid;gap:10px;margin:12px 0}.permission-group{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:10px}.permission-group strong{display:block;margin-bottom:8px}.permission-group label{display:flex;align-items:center;gap:7px;margin:7px 0}.permission-group input{width:auto}.permission-tags{display:flex;gap:5px;flex-wrap:wrap}.permission-tags span{display:inline-flex;border-radius:999px;background:#eef2ff;color:#1d4ed8;font-size:12px;padding:3px 7px}.merchant-list-head{display:grid;grid-template-columns:minmax(280px,1fr) auto;gap:10px;align-items:center;margin-bottom:10px}.merchant-bulk-actions{justify-content:flex-end}.merchant-import-textarea{min-height:220px}.merchant-table th:first-child,.merchant-table td:first-child{width:42px}.merchant-table input[type=checkbox]{width:auto}.map-mini-link{display:inline-flex;margin-top:5px;border-radius:999px;background:#eef2ff;color:#1d4ed8;font-size:12px;font-weight:700;padding:3px 8px}.merchant-table .thumb.photo-lg{cursor:zoom-in}
@media(max-width:1100px){.delivery-filter-form{grid-template-columns:1fr 1fr 1fr}.delivery-filter-form>input{grid-column:1/-1}.delivery-filter-form button,.delivery-filter-form .btn{width:100%}.merchant-list-head{grid-template-columns:1fr}.merchant-bulk-actions{justify-content:flex-start}}
@media(max-width:760px){.delivery-filter-form{grid-template-columns:1fr 1fr}.delivery-filter-form>input{grid-column:1/-1}.delivery-filter-form button,.delivery-filter-form .btn{width:100%}.time-stack{min-width:130px}.order-detail-link span{font-size:13px;padding:4px 9px}.merchant-bulk-actions{display:grid;grid-template-columns:1fr 1fr}.merchant-bulk-actions button{width:100%}.merchant-table{min-width:920px}}

.detail-link{display:inline-flex;flex-direction:column;gap:3px;color:#0f172a;font-weight:750;text-decoration:none}.detail-link small{color:var(--blue);font-size:12px;font-weight:700}.detail-link:hover{text-decoration:underline}.page-actions{display:flex;gap:8px;justify-content:flex-end;margin-bottom:12px}.product-flow-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0 14px}.product-flow-total{border:1px solid var(--line);border-left:4px solid #16a34a;background:#f8fafc;border-radius:8px;padding:11px 14px}.product-flow-total.outbound{border-left-color:#2563eb}.product-flow-total span{display:block;color:var(--muted);font-size:13px;margin-bottom:4px}.product-flow-total strong{font-size:20px}.detail-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:10px;margin-top:14px}.detail-summary-grid>div{border:1px solid var(--line);background:#f8fafc;border-radius:8px;padding:12px}.detail-summary-grid span{display:block;color:var(--muted);font-size:13px;margin-bottom:5px}.detail-summary-grid strong{font-size:18px}.purchase-status-large{font-size:14px;padding:7px 12px}.purchase-arrival-form{margin-top:10px}.arrival-quantity-input{min-width:120px;font-size:17px;font-weight:800;text-align:center}.purchase-receive-button{display:block;width:min(360px,100%);margin:14px 0 0 auto}.empty-cell{text-align:center;color:var(--muted);padding:24px!important}.success-text{color:#15803d;font-weight:700}.stat-link{position:relative;color:inherit;text-decoration:none;transition:border-color .15s,box-shadow .15s}.stat-link:hover{border-color:#93c5fd;box-shadow:0 5px 18px rgba(37,99,235,.10)}.stat-link small{position:absolute;right:14px;bottom:12px;color:var(--blue);font-weight:700}.product-log-filter{margin:14px 0}.pagination{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px}.pagination>div{display:flex;gap:8px}.btn.disabled{pointer-events:none;opacity:.45}
@media(max-width:900px){.detail-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-log-filter{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.product-flow-totals{grid-template-columns:1fr}.product-flow-total strong{font-size:18px}.detail-summary-grid{grid-template-columns:1fr 1fr}.detail-summary-grid>div{padding:10px}.detail-summary-grid strong{font-size:16px}.purchase-receive-button{width:100%}.pagination{align-items:flex-start;flex-direction:column}.pagination>div{width:100%}.pagination .btn{flex:1;text-align:center}.product-log-filter{grid-template-columns:1fr}.page-actions{justify-content:stretch}.page-actions .btn{width:100%;text-align:center}}

.page-quantity-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px 24px;margin-top:14px;padding:12px 14px;border:1px solid #dbe4f0;border-radius:6px;background:#f8fafc}.page-quantity-group{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.page-quantity-label{font-weight:700;color:#334155}.page-quantity-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:6px;background:#eaf2ff;color:#174ea6;font-weight:700}.page-quantity-chip.positive{background:#ecfdf3;color:#08783e}.page-quantity-chip.negative{background:#fff1f2;color:#be123c}.review-quantity-summary{margin-bottom:20px}@media(max-width:760px){.page-quantity-summary{align-items:stretch;gap:10px}.page-quantity-group{width:100%}.page-quantity-label{width:100%}}
@media(max-width:760px){.purchase-items-table{min-width:0;border:0}.purchase-items-table tbody{display:grid;gap:10px}.purchase-items-table tr:first-child{display:none}.purchase-items-table tr:not(:first-child){display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:10px;padding:10px;background:#f8fafc}.purchase-items-table td{display:flex;justify-content:space-between;align-items:center;gap:10px;border:0;padding:8px!important;text-align:right;min-width:0}.purchase-items-table td::before{content:attr(data-label);color:var(--muted);font-size:13px;font-weight:500;text-align:left}.purchase-items-table td[data-label="商品"],.purchase-items-table td[data-label="本次到货"]{grid-column:1/-1}.purchase-items-table td[data-label="商品"]{font-size:18px;font-weight:800;border-bottom:1px solid var(--line)}.purchase-items-table td[data-label="本次到货"]{display:grid;grid-template-columns:auto 1fr;align-items:center}.purchase-items-table .arrival-quantity-input{width:100%;height:54px;font-size:22px}}

/* Permanent deletion controls: clearly separate destructive cleanup from cancel/disable. */
.danger-outline{box-shadow:inset 0 0 0 2px rgba(127,29,29,.25);font-weight:700}
.mobile-tabs a.active{background:var(--blue);border-color:var(--blue);color:#fff;font-weight:700}
.mobile-driver-account .mobile-actions{margin-top:14px}
.delivery-bulk-delete-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0;padding:10px 12px;border:1px solid #fecaca;border-radius:10px;background:#fff7f7}
.delivery-bulk-delete-bar>span{color:#991b1b;font-weight:700;margin-left:auto}
.delivery-select-column{width:64px;text-align:center}.delivery-select-column input,.delivery-order-select input{width:auto}
.delivery-order-select{display:flex;align-items:center;gap:8px;margin-bottom:9px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;font-weight:700}
.merchant-row-actions{align-items:flex-start;flex-wrap:wrap}.merchant-row-actions form{margin:0}
@media(max-width:760px){.delivery-bulk-delete-bar{display:grid;grid-template-columns:1fr}.delivery-bulk-delete-bar .actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.delivery-bulk-delete-bar>span{margin-left:0}.delivery-bulk-delete-bar>button{width:100%}}


/* System submenu and product sorting controls. */
.sidebar .nav-group{margin:4px 0 6px}
.sidebar .nav-parent.active{background:rgba(37,99,235,.18);color:#fff}
.sidebar .nav-sub{margin:4px 0 8px 14px;padding-left:10px;border-left:1px solid rgba(229,231,235,.16)}
.sidebar .nav-sub a{padding:9px 10px;font-size:13px;background:rgba(255,255,255,.04)}
.sidebar .nav-sub a.active,.sidebar .nav-sub a:hover{background:var(--blue);color:#fff}
.section-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.section-title-row h3{margin:0}
.sort-form{display:flex;align-items:center;gap:8px}
.sort-form label{display:flex;align-items:center;gap:8px;color:var(--muted)}
.sort-form select{min-width:190px}
@media (max-width:700px){
  .section-title-row{display:block}
  .sort-form{margin-top:10px}
  .sort-form label{display:block}
  .sort-form select{width:100%;margin-top:6px}
}


/* Product manual sort editor. */
.product-sort-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px}
.sort-cell{width:90px}
.sort-cell input{width:76px;padding:7px 8px;text-align:center}
@media (max-width:700px){
  .product-sort-actions{align-items:stretch;flex-direction:column}
  .sort-cell{min-width:90px}
}


/* Delivery filter overlap fix and stable two-row toolbar. */
.advanced-delivery-toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:start}
.advanced-delivery-toolbar .delivery-filter-form{grid-column:1/-1;display:grid;grid-template-columns:minmax(240px,1.35fr) minmax(145px,.65fr) minmax(145px,.65fr) minmax(110px,.45fr) auto auto;gap:10px;align-items:end;width:100%;min-width:0}
.advanced-delivery-toolbar .delivery-filter-form>input[name=q]{min-width:0}
.advanced-delivery-toolbar .delivery-filter-form button,.advanced-delivery-toolbar .delivery-filter-form .btn{min-height:42px;white-space:nowrap}
.advanced-delivery-toolbar .delivery-filter-buttons{grid-column:1/2;display:flex;flex-wrap:wrap;gap:8px;row-gap:8px;align-items:center;min-width:0;margin:0}
.advanced-delivery-toolbar .delivery-filter-buttons .btn{flex:0 0 auto;white-space:nowrap}
.advanced-delivery-toolbar .delivery-export{grid-column:2/3;justify-self:end;align-self:start;white-space:nowrap}
.delivery-list-card .desktop-table{margin-top:0}
@media(max-width:1100px){
  .advanced-delivery-toolbar{grid-template-columns:1fr}
  .advanced-delivery-toolbar .delivery-filter-form{grid-template-columns:minmax(220px,1fr) minmax(140px,.7fr) minmax(140px,.7fr) minmax(100px,.45fr) auto auto}
  .advanced-delivery-toolbar .delivery-filter-buttons,.advanced-delivery-toolbar .delivery-export{grid-column:1/-1}
  .advanced-delivery-toolbar .delivery-export{justify-self:start}
}
@media(max-width:900px){
  .advanced-delivery-toolbar .delivery-filter-form{grid-template-columns:1fr 1fr 130px}
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{grid-column:1/-1}
  .advanced-delivery-toolbar .delivery-filter-form button,.advanced-delivery-toolbar .delivery-filter-form .btn{width:100%}
}
@media(max-width:760px){
  .advanced-delivery-toolbar{gap:10px}
  .advanced-delivery-toolbar .delivery-filter-form{grid-template-columns:1fr 1fr}
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{grid-column:1/-1}
  .advanced-delivery-toolbar .delivery-filter-buttons{flex-wrap:nowrap;overflow-x:auto;padding-bottom:6px;-webkit-overflow-scrolling:touch}
  .advanced-delivery-toolbar .delivery-export,.advanced-delivery-toolbar .delivery-export>summary{width:100%}
}
@media(max-width:480px){
  .advanced-delivery-toolbar .delivery-filter-form{grid-template-columns:1fr}
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{grid-column:auto}
}


/* System subnav moved into page content. */
.system-page-subnav{display:flex;gap:8px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px;margin:0 0 14px;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.system-page-subnav a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 14px;border:1px solid var(--line);border-radius:9px;background:#f8fafc;color:#344054;font-weight:700}
.system-page-subnav a.active,.system-page-subnav a:hover{background:var(--blue);border-color:var(--blue);color:#fff}
@media(max-width:760px){.system-page-subnav{display:grid;grid-template-columns:1fr 1fr}.system-page-subnav a{width:100%}}
@media(max-width:420px){.system-page-subnav{grid-template-columns:1fr}}


/* Sidebar collapsible purchase inventory group. */
.sidebar .nav-collapsible{margin:4px 0 6px}
.sidebar .nav-collapsible>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 12px;border-radius:8px;color:#d8dee9;cursor:pointer;list-style:none}
.sidebar .nav-collapsible>summary::-webkit-details-marker{display:none}
.sidebar .nav-collapsible>summary:after{content:'▾';font-size:11px;opacity:.75;transition:transform .16s ease}
.sidebar .nav-collapsible[open]>summary:after{transform:rotate(180deg)}
.sidebar .nav-collapsible>summary.active,.sidebar .nav-collapsible>summary:hover{background:rgba(37,99,235,.18);color:#fff}
.sidebar .nav-collapsible .nav-sub{margin:5px 0 8px 14px;padding-left:10px;border-left:1px solid rgba(229,231,235,.16)}
.sidebar .nav-collapsible .nav-sub a{padding:9px 10px;font-size:13px;background:rgba(255,255,255,.04)}
.sidebar .nav-collapsible .nav-sub a.active,.sidebar .nav-collapsible .nav-sub a:hover{background:var(--blue);color:#fff}


/* Merchant full data, map preview, and inline driver completion. */
.nowrap{white-space:nowrap}.merchant-full-table{min-width:1380px}.merchant-full-table td{vertical-align:top}.merchant-address-cell{min-width:310px}.merchant-address-cell small{display:block;max-width:360px;word-break:break-all;margin-top:5px}.map-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.merchant-photo-pair{display:flex;gap:8px;min-width:150px}.merchant-mobile-cards{display:none}.merchant-mobile-card{border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px;margin-top:10px}.merchant-mobile-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.merchant-mobile-card p{margin:8px 0;word-break:break-word}.merchant-mobile-photos{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.map-preview-overlay{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.76);display:grid;place-items:center;padding:18px}.map-preview-dialog{position:relative;width:min(920px,100%);background:#fff;border-radius:14px;padding:14px;box-shadow:0 20px 70px rgba(0,0,0,.3)}.map-preview-dialog h3{margin:0 44px 6px 0}.map-preview-dialog p{margin:0 44px 10px 0;color:var(--muted);word-break:break-word}.map-preview-dialog iframe{width:100%;height:min(62vh,520px);border:1px solid var(--line);border-radius:12px;background:#f8fafc}.map-preview-close{position:absolute;right:12px;top:12px;width:38px;height:38px;border-radius:999px;background:#111827;color:#fff;border:0;font-weight:800}
.delivery-items-card{display:grid;gap:12px}.delivery-item-card{border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:13px}.delivery-item-name{font-size:20px;font-weight:800;margin-bottom:10px}.exception-inline-panel summary{list-style:none}.exception-inline-panel summary::-webkit-details-marker{display:none}.exception-inline-panel form{margin-top:12px}
@media(max-width:760px){.merchant-full-table-wrap{display:none}.merchant-mobile-cards{display:block}.map-preview-overlay{padding:8px}.map-preview-dialog{padding:12px;border-radius:12px}.map-preview-dialog iframe{height:52vh}.map-actions .btn{flex:1 1 130px}.mobile-actions.two-cols{grid-template-columns:1fr 1fr}.delivery-item-name{font-size:22px}}
@media(max-width:420px){.mobile-actions.two-cols{grid-template-columns:1fr}.merchant-mobile-card .actions{display:grid;grid-template-columns:1fr 1fr}.merchant-mobile-card .actions .btn,.merchant-mobile-card .actions button{width:100%}}


/* Mobile delivery next-step workflow. */
.delivery-flow-card{scroll-margin-top:18px}
.delivery-list-card{scroll-margin-top:18px}
.delivery-next-banner{border:1px solid var(--line);border-radius:14px;padding:14px;background:#f8fafc;margin:10px 0 14px}
.delivery-next-banner span{display:block;color:var(--muted);font-size:15px;margin-bottom:4px}
.delivery-next-banner strong{display:block;font-size:24px;line-height:1.25;color:#111827}
.delivery-next-banner small{display:block;margin-top:6px;color:var(--muted)}
.delivery-next-banner.warn{border-color:#bfdbfe;background:#eff6ff}
.delivery-next-banner.ok{border-color:#bbf7d0;background:#f0fdf4}
.delivery-flow-list{display:grid;gap:10px;margin:12px 0}
.delivery-flow-step{display:grid;grid-template-columns:42px 1fr;align-items:center;gap:10px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:12px}
.delivery-flow-step b{display:grid;place-items:center;width:38px;height:38px;border-radius:999px;background:#e5e7eb;color:#374151;font-size:18px}
.delivery-flow-step strong{display:block;font-size:19px;color:#111827}
.delivery-flow-step span{display:block;color:var(--muted);font-size:14px;margin-top:3px}
.delivery-flow-step.current{border-color:#60a5fa;background:#eff6ff;box-shadow:0 0 0 2px rgba(37,99,235,.08)}
.delivery-flow-step.current b{background:#2563eb;color:#fff}
.delivery-flow-step.done{border-color:#bbf7d0;background:#f0fdf4}
.delivery-flow-step.done b{background:#16a34a;color:#fff}
.hint-box.ok{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
@media(max-width:760px){.delivery-next-banner strong{font-size:25px}.delivery-flow-step{padding:13px}.delivery-flow-step strong{font-size:20px}.delivery-flow-step span{font-size:15px}}


/* Merchant page refinements */
.merchants-list-only{display:block}
.merchant-form-panel{display:flex;flex-direction:column;gap:14px}
.merchant-list-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 130px auto;gap:10px;align-items:end}
.merchant-list-toolbar .search-row{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px}
.per-page-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted)}
.merchant-primary-actions,.merchant-bulk-actions{justify-content:flex-start}
.merchant-page-summary{margin:10px 0 12px;color:var(--muted)}
.pagination-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px;color:var(--muted)}
.btn.disabled{opacity:.45;pointer-events:none}
.upload-dropzone{display:block;border:1.5px dashed #b9c5d8;border-radius:12px;padding:14px;background:#f8fafc;cursor:pointer}
.upload-dropzone span{display:block;font-weight:700;margin-bottom:6px}
.upload-dropzone strong{display:block;color:#1d4ed8;margin-bottom:4px}
.upload-dropzone small{display:block;color:var(--muted)}
.upload-dropzone input[type=file]{margin-top:10px;background:#fff}
.upload-dropzone.is-drag{border-color:var(--blue);background:#eff6ff}
.upload-dropzone.has-file{border-style:solid}
.upload-preview{display:none;width:100%;max-height:190px;object-fit:cover;border-radius:10px;margin-top:10px;border:1px solid var(--line)}
@media (max-width:1100px){.merchant-list-toolbar{grid-template-columns:1fr 130px}.merchant-primary-actions,.merchant-bulk-actions{grid-column:1/-1}}
@media (max-width:760px){.merchant-list-toolbar{display:flex;flex-direction:column;align-items:stretch}.merchant-list-toolbar .search-row{grid-template-columns:1fr}.pagination-bar{align-items:stretch;flex-direction:column}.merchant-primary-actions .btn,.merchant-bulk-actions .btn,.merchant-bulk-actions button{flex:1}.upload-preview{max-height:240px}}


/* 2026-07-22: merchant pagination/copy/sidebar polish */
@media (min-width:761px){
  .sidebar{width:180px;padding:18px 10px}
  .main{margin-left:180px}
  .brand strong{font-size:20px}
  .sidebar a,.sidebar summary{padding:10px 10px}
  .nav-sub{padding-left:6px}
}
#merchant-bulk-form{display:none}
#merchant-sort-form,
#merchant-mobile-sort-form,
form[id^="merchant-inline-form-"],
form[id^="merchant-inline-mobile-form-"]{display:none}
.merchant-list-toolbar{grid-template-columns:minmax(320px,1fr) auto!important}
.merchant-bottom-pagination{display:grid;grid-template-columns:1fr 140px auto;align-items:center}
.pagination-per-page label{display:flex;flex-direction:column;gap:6px}
.pagination-per-page select{min-width:120px}
.pagination-per-page{display:flex;align-items:flex-end;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.pagination-per-page input[type="number"]{width:110px;min-width:0}
@media (max-width:900px){
  .merchant-bottom-pagination{grid-template-columns:1fr;align-items:stretch}
  .pagination-per-page{width:100%;max-width:none;justify-content:flex-start}
}


/* 2026-07-23: make merchant table fit one desktop page */
@media (min-width:1000px){
  .merchant-full-table-wrap{overflow-x:visible}
  .merchant-full-table{min-width:0!important;width:100%;table-layout:fixed;font-size:13px}
  .merchant-full-table th,.merchant-full-table td{padding:8px 6px;line-height:1.35;word-break:break-word}
  .merchant-full-table th:nth-child(1),.merchant-full-table td:nth-child(1){width:28px}
  .merchant-full-table th:nth-child(2),.merchant-full-table td:nth-child(2){width:38px}
  .merchant-full-table th:nth-child(3),.merchant-full-table td:nth-child(3){width:62px}
  .merchant-full-table th:nth-child(4),.merchant-full-table td:nth-child(4){width:150px}
  .merchant-full-table th:nth-child(5),.merchant-full-table td:nth-child(5){width:120px}
  .merchant-full-table th:nth-child(7),.merchant-full-table td:nth-child(7){width:72px}
  .merchant-full-table th:nth-child(8),.merchant-full-table td:nth-child(8){width:116px}
  .merchant-full-table th:nth-child(9),.merchant-full-table td:nth-child(9){width:104px}
  .merchant-full-table th:nth-child(10),.merchant-full-table td:nth-child(10){width:68px}
  .merchant-full-table th:nth-child(11),.merchant-full-table td:nth-child(11){width:92px}
  .merchant-time-cell span,.merchant-time-cell small{display:block;white-space:nowrap}
  .merchant-time-cell small{color:var(--muted);font-size:12px}
  .merchant-address-cell{min-width:0!important}
  .merchant-address-cell small{max-width:100%;font-size:12px;line-height:1.3}
  .merchant-full-table .map-actions{gap:4px;margin-top:6px}
  .merchant-full-table .btn.small,.merchant-full-table button.small{padding:5px 7px;font-size:12px}
  .merchant-photo-pair{min-width:0!important;gap:5px}
  .merchant-photo-pair .thumb.photo-lg{width:52px;height:52px;max-height:52px;border-radius:8px;object-fit:cover}
  .merchant-full-table td.actions{gap:5px;align-content:flex-start}
}
@media (min-width:1400px){
  .merchant-full-table th:nth-child(4),.merchant-full-table td:nth-child(4){width:170px}
  .merchant-full-table th:nth-child(5),.merchant-full-table td:nth-child(5){width:135px}
  .merchant-full-table th:nth-child(8),.merchant-full-table td:nth-child(8){width:130px}
  .merchant-photo-pair .thumb.photo-lg{width:62px;height:62px;max-height:62px}
}


/* 2026-07-23: merchant import preview */
.merchant-import-preview-card{border-color:#bfdbfe;background:#f8fbff}
.import-preview-wrap{max-height:420px}
.import-preview-table{min-width:960px}
.import-preview-table th,.import-preview-table td{font-size:13px}
.word-break{word-break:break-all}
.import-preview-actions{margin-top:12px}


/* 2026-07-23: keep merchant address/google readable */
@media (min-width:1000px){
  .merchant-full-table th:nth-child(4),.merchant-full-table td:nth-child(4){width:140px}
  .merchant-full-table th:nth-child(5),.merchant-full-table td:nth-child(5){width:112px}
  .merchant-full-table th:nth-child(6),.merchant-full-table td:nth-child(6){width:31%}
  .merchant-full-table th:nth-child(7),.merchant-full-table td:nth-child(7){width:70px}
  .merchant-full-table th:nth-child(8),.merchant-full-table td:nth-child(8){width:112px}
  .merchant-full-table th:nth-child(9),.merchant-full-table td:nth-child(9){width:96px}
  .merchant-full-table th:nth-child(10),.merchant-full-table td:nth-child(10){width:64px}
  .merchant-full-table th:nth-child(11),.merchant-full-table td:nth-child(11){width:76px}
  .merchant-address-cell{white-space:normal!important;word-break:normal!important;overflow-wrap:break-word}
  .merchant-address-cell strong{display:block;font-size:14px;line-height:1.35;margin-bottom:4px}
  .merchant-address-cell small{display:block;max-height:34px;overflow:hidden;word-break:break-all;line-height:1.35}
  .merchant-address-cell small:empty{display:none}
}
@media (min-width:1400px){
  .merchant-full-table th:nth-child(6),.merchant-full-table td:nth-child(6){width:34%}
}


/* 2026-07-23: merchant form-only page and robust image paste/drop */
.merchants-form-only{max-width:820px}
.merchants-form-only .merchant-form-panel{width:100%}
.upload-dropzone{position:relative}
.upload-dropzone input[type=hidden]{display:none}
.upload-status{display:inline-flex;margin-top:8px;color:#2563eb;font-style:normal;font-size:12px;font-weight:700}
.upload-dropzone.has-file .upload-status{color:#16a34a}
@media (max-width:760px){.merchants-form-only{max-width:none}}

/* 2026-07-26: batch delivery merchant filters */
.merchant-toolbar{grid-template-columns:minmax(260px,1.6fr) repeat(4,minmax(112px,.55fr)) repeat(4,auto)}
.merchant-toolbar select{min-width:112px}
@media(max-width:1200px){
  .merchant-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}
  .merchant-toolbar input{grid-column:1/-1}
}
@media(max-width:700px){
  .merchant-toolbar{grid-template-columns:1fr}
  .merchant-toolbar input,.merchant-toolbar select,.merchant-toolbar button{width:100%}
}


/* 2026-07-23: keep merchant address/google readable after compact table rules */
@media (min-width:1000px){
  .merchant-full-table th:nth-child(6),.merchant-full-table td:nth-child(6){width:34%}
  .merchant-address-cell{white-space:normal!important;word-break:normal!important;overflow-wrap:break-word}
  .merchant-address-cell strong{display:block;font-size:14px;line-height:1.35;margin-bottom:4px}
  .merchant-address-cell small{display:block;max-height:38px;overflow:hidden;word-break:break-all;line-height:1.35}
  .merchant-address-cell small:empty{display:none}
}


/* 2026-07-23: merchant import preview fit and removal */
.merchants-import-preview-page{max-width:none}
.merchants-import-preview-page .merchant-form-panel{display:grid;grid-template-columns:minmax(340px,420px) minmax(0,1fr);gap:16px;align-items:start}
.merchants-import-preview-page .merchant-edit-form{grid-column:1;grid-row:1}
.merchants-import-preview-page .merchant-import-card{grid-column:1;grid-row:2}
.merchants-import-preview-page .merchant-import-preview-card{grid-column:2;grid-row:1 / span 2;min-width:0}
.merchants-import-preview-page .import-preview-wrap{max-height:68vh;overflow:auto}
.merchants-import-preview-page .import-preview-table{width:100%;min-width:980px;table-layout:fixed}
.merchants-import-preview-page .import-preview-table th,.merchants-import-preview-page .import-preview-table td{padding:9px 10px;vertical-align:top;white-space:normal;word-break:break-word;line-height:1.35}
.merchants-import-preview-page .import-preview-table th:nth-child(1),.merchants-import-preview-page .import-preview-table td:nth-child(1){width:76px}
.merchants-import-preview-page .import-preview-table th:nth-child(2),.merchants-import-preview-page .import-preview-table td:nth-child(2){width:130px}
.merchants-import-preview-page .import-preview-table th:nth-child(3),.merchants-import-preview-page .import-preview-table td:nth-child(3){width:110px}
.merchants-import-preview-page .import-preview-table th:nth-child(4),.merchants-import-preview-page .import-preview-table td:nth-child(4){width:140px}
.merchants-import-preview-page .import-preview-table th:nth-child(5),.merchants-import-preview-page .import-preview-table td:nth-child(5){width:170px}
.merchants-import-preview-page .import-preview-table th:nth-child(6),.merchants-import-preview-page .import-preview-table td:nth-child(6){width:220px}
.import-preview-remove{display:block;margin-top:6px;width:100%}
.import-preview-empty{margin-top:12px}
@media (max-width:1100px){
  .merchants-import-preview-page .merchant-form-panel{display:block}
  .merchants-import-preview-page .merchant-import-preview-card{margin-top:16px}
}


/* 2026-07-23: merchant upload clear button */
.upload-clear{display:none;margin-top:8px}
.upload-dropzone.has-file .upload-clear{display:inline-flex}
.upload-preview:not([src]){display:none}
.existing-upload-photo{
  display:grid;
  grid-template-columns:96px minmax(0,1fr);
  gap:10px;
  align-items:center;
  margin:10px 0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
}
.existing-upload-photo[hidden]{display:none}
.existing-upload-photo img{width:96px;height:72px;object-fit:cover;border-radius:8px}
.existing-upload-photo div{display:grid;gap:8px;justify-items:start}


/* 2026-07-23: product unit and purchase product manager */
.inline-form{display:flex;gap:8px;align-items:center}
.inline-form input{flex:1}
.unit-chip-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.unit-chip-list form{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:6px 8px;background:#f8fafc}
.tiny{font-size:12px;padding:4px 8px;border-radius:8px}
.purchase-admin-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);gap:16px;align-items:start}
.purchase-list-table td{vertical-align:top}
.purchase-inline-items{display:grid;gap:6px;min-width:260px}
.purchase-inline-item{border:1px solid #dbeafe;background:#eff6ff;border-radius:8px;color:#1e3a8a;font-size:13px;line-height:1.45;padding:7px 9px}
.purchase-inline-item strong{color:#0f172a}
.purchase-inline-item small{display:block;color:#475569;margin-top:2px}
.purchase-list-table .actions{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}
.purchase-list-table .actions form{margin:0}
.purchase-edit-card h4{margin:16px 0 10px}
.purchase-edit-form .form-grid{margin-bottom:8px}
.purchase-edit-table{min-width:920px}
.purchase-edit-table input,
.purchase-edit-table select{min-width:120px}
.purchase-edit-table td:nth-child(1){min-width:230px}
.purchase-edit-table td:nth-child(5){min-width:210px}
.inline-check{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.inline-check input{width:auto}
.purchase-new-item-row{grid-template-columns:minmax(220px,1fr) 140px 140px minmax(180px,1fr)}
.purchase-save-button{width:min(360px,100%);margin-top:12px}
@media(max-width:760px){
  .purchase-edit-table{min-width:760px}
  .purchase-new-item-row{grid-template-columns:1fr}
  .purchase-edit-card .form-grid{grid-template-columns:1fr}
  .purchase-edit-card .form-grid .wide{grid-column:auto}
}
.compact-form{gap:10px}
.compact-table-wrap{max-height:420px;overflow:auto;margin-top:14px}
.compact-table th,.compact-table td{padding:8px;vertical-align:top}
@media(max-width:1100px){.purchase-admin-grid{grid-template-columns:1fr}.inline-form{flex-direction:column;align-items:stretch}}


/* 2026-07-23: merchant region manager */
.merchant-region-card .inline-form{display:flex;gap:8px;align-items:center}
.merchant-region-card .inline-form input{flex:1}
.region-chip-list form button[disabled]{opacity:.45;cursor:not-allowed}
.merchants-import-preview-page .merchant-region-card{grid-column:1;grid-row:2}
.merchants-import-preview-page .merchant-import-card{grid-column:1;grid-row:3}
.merchants-import-preview-page .merchant-import-preview-card{grid-column:2;grid-row:1 / span 3}
@media(max-width:760px){.merchant-region-card .inline-form{flex-direction:column;align-items:stretch}}


/* 2026-07-23: upload temporary warning behavior */
.upload-status{min-height:18px}
.upload-dropzone:not(.has-upload-message):not(.has-file) .upload-status{color:#64748b;font-weight:500}
.upload-dropzone.has-upload-message:not(.has-file) .upload-status{color:#2563eb;font-weight:700}


/* 2026-07-23: clipboard upload button */
.upload-clipboard{display:inline-flex;margin-top:8px;margin-left:8px}
@media (max-width:760px){.upload-clipboard{margin-left:0}}


/* 2026-07-23: upload paste target fallback */
.upload-paste-target{
  display:block;
  margin-top:8px;
  padding:10px 12px;
  border:1px dashed #93c5fd;
  border-radius:10px;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:700;
  outline:none;
  cursor:text;
}
.upload-paste-target:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.16);
  background:#fff;
}


/* Merchant manual ordering */
.merchant-sort-cell{width:88px;min-width:88px}
.merchant-sort-input{width:72px;min-width:72px;padding:7px 8px;text-align:center}
.merchant-sort-hint{color:var(--muted);font-size:13px;margin-left:auto}
@media(max-width:1100px){.merchant-sort-hint{margin-left:0;width:100%}}


/* Flexible export selectors */
.export-field-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:9px 0}
.merchant-export-panel{position:relative}
.merchant-export-panel .export-field-form{position:absolute;right:0;z-index:20;width:min(720px,80vw);max-width:720px}
.report-export-form{display:grid;gap:14px}
.report-export-fields{max-height:none;border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:12px}
.report-date-grid{max-width:560px}
@media(max-width:760px){.merchant-export-panel{width:100%}.merchant-export-panel>summary{width:100%}.merchant-export-panel .export-field-form{position:static;width:100%;max-width:none}.export-field-actions{display:grid;grid-template-columns:repeat(3,1fr)}.export-field-actions .btn{width:100%}.report-date-grid{grid-template-columns:1fr}}


/* Merchant PC/mobile feature parity */
.merchant-sort-save-mobile{display:none}
.merchant-mobile-name{margin:12px 0 8px;font-size:21px;line-height:1.3}
.merchant-mobile-select{display:inline-flex;align-items:center;gap:8px;font-weight:700;color:#1f2937}
.merchant-mobile-select input{width:22px;height:22px;margin:0}
.merchant-mobile-meta{display:grid;grid-template-columns:90px minmax(130px,1fr) 120px;gap:8px;margin:10px 0}
.merchant-mobile-meta>div,.merchant-mobile-meta>label{display:grid;gap:4px;padding:10px;border:1px solid var(--line);border-radius:8px;background:#f8fafc}
.merchant-mobile-meta small,.merchant-mobile-meta label span{color:var(--muted);font-size:12px}
.merchant-mobile-meta strong{font-size:16px}
.merchant-mobile-sort-input{width:100%;min-width:0;padding:8px;text-align:center;font-size:17px;font-weight:800;background:#fff}
@media(max-width:760px){
  .merchant-sort-save-desktop{display:none}
  .merchant-sort-save-mobile{display:inline-flex}
  .merchant-sort-hint{grid-column:1/-1}
  .merchant-mobile-meta{grid-template-columns:1fr 1fr}
  .merchant-mobile-meta>label{grid-column:1/-1}
}

/* Merchant storefront photo OCR and gallery */
.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.section-heading h3{margin:0 0 5px}.section-heading p{margin:0}
.merchant-ocr-page{display:grid;gap:18px}.merchant-ocr-upload,.merchant-ocr-results{margin:0}.merchant-ocr-dropzone{position:relative;display:flex;min-height:180px;border:2px dashed #9bbcf6;background:#f7faff;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:8px;padding:28px;cursor:pointer}.merchant-ocr-dropzone strong{font-size:24px;color:#1554c5}.merchant-ocr-dropzone span{color:#64748b}.merchant-ocr-dropzone input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.merchant-ocr-dropzone.dragging{border-color:#2563eb;background:#eaf2ff}
.merchant-ocr-progress{margin-top:18px}.merchant-ocr-progress>div{display:flex;justify-content:space-between;margin-bottom:8px}.merchant-ocr-progress progress{width:100%;height:18px}
.merchant-ocr-summary{display:flex;gap:10px;flex-wrap:wrap}.merchant-ocr-summary span{padding:8px 12px;background:#f1f5f9;border-radius:6px}.merchant-ocr-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:15px}.merchant-ocr-toolbar select{max-width:220px}.merchant-ocr-list{display:grid;gap:14px}.merchant-ocr-card{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;padding:16px;border:1px solid #dce3ee;border-radius:8px;background:#fff}.merchant-ocr-card[hidden]{display:none}.merchant-ocr-card.saving{opacity:.7}.merchant-ocr-image{padding:0;border:0;background:#eef2f7;border-radius:6px;overflow:hidden;cursor:zoom-in;aspect-ratio:4/3}.merchant-ocr-image img{width:100%;height:100%;object-fit:contain;display:block}.merchant-ocr-info{display:grid;gap:12px;min-width:0}.merchant-ocr-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.merchant-ocr-card-head>div{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.merchant-ocr-card-head strong{font-size:18px;overflow-wrap:anywhere}.merchant-ocr-primary{display:flex;align-items:center;gap:8px}.merchant-ocr-current{display:grid;grid-template-columns:76px 1fr;gap:12px;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;padding:10px;border-radius:6px}.merchant-ocr-current img{width:76px;height:60px;object-fit:cover;border-radius:5px}.merchant-ocr-current div{display:grid;gap:2px}.merchant-ocr-current span,.merchant-ocr-current small{color:#64748b}.merchant-ocr-info details{border-top:1px solid #e2e8f0;padding-top:10px}.merchant-ocr-info summary{cursor:pointer;color:#1d4ed8}.merchant-ocr-info pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:130px;overflow:auto;background:#f8fafc;padding:10px;border-radius:6px}.merchant-ocr-candidates{display:flex;gap:8px;flex-wrap:wrap}.merchant-ocr-confirmbar{position:sticky;bottom:0;z-index:5;margin:18px -20px -20px;padding:14px 20px;background:rgba(255,255,255,.96);border-top:1px solid #dce3ee;display:flex;justify-content:space-between;align-items:center;gap:15px}.merchant-ocr-confirmbar>div{display:grid;gap:3px}.merchant-ocr-confirmbar button{min-width:180px}.merchant-ocr-confirmbar button.needs-match{background:#64748b;border-color:#64748b;cursor:pointer}
.merchant-ocr-toolbar{flex-wrap:wrap}.merchant-ocr-select{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #bfdbfe;border-radius:6px;background:#eff6ff;color:#1d4ed8;font-weight:700;cursor:pointer}.merchant-ocr-select input{width:19px;height:19px;margin:0}.merchant-ocr-toolbar button{white-space:nowrap}
.merchant-gallery-page{margin:0}.merchant-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:15px}.merchant-gallery-card{border:1px solid #dce3ee;border-radius:8px;padding:12px;display:grid;gap:10px}.merchant-gallery-card .photo-button{padding:0;border:0;background:#eef2f7;aspect-ratio:4/3;overflow:hidden;cursor:zoom-in}.merchant-gallery-card img{width:100%;height:100%;object-fit:contain}.merchant-gallery-card>div{display:grid;gap:3px}.merchant-gallery-card small{color:#64748b;overflow-wrap:anywhere}.image-lightbox[hidden]{display:none}.image-lightbox{position:fixed;inset:0;z-index:1200;background:rgba(15,23,42,.9);display:flex;align-items:center;justify-content:center;padding:28px}.image-lightbox img{max-width:95vw;max-height:92vh;object-fit:contain}.image-lightbox>button{position:absolute;right:22px;top:18px;width:48px;height:48px;border-radius:50%;border:1px solid #fff;background:#111827;color:#fff;font-size:24px;cursor:pointer}
@media(max-width:760px){.section-heading{display:grid}.merchant-ocr-dropzone{min-height:145px;padding:20px}.merchant-ocr-dropzone strong{font-size:20px}.merchant-ocr-card{grid-template-columns:1fr;padding:12px}.merchant-ocr-image{aspect-ratio:16/10}.merchant-ocr-card-head strong{font-size:17px}.merchant-ocr-toolbar{display:grid;grid-template-columns:1fr 1fr}.merchant-ocr-toolbar select{max-width:none}.merchant-ocr-confirmbar{display:grid;margin-left:-12px;margin-right:-12px;padding:12px}.merchant-ocr-confirmbar button{width:100%;min-width:0}.merchant-ocr-summary{display:grid;grid-template-columns:repeat(3,1fr)}.merchant-ocr-summary span{text-align:center;padding:7px 4px}.merchant-gallery-grid{grid-template-columns:1fr 1fr}.image-lightbox{padding:10px}.image-lightbox>button{right:12px;top:12px}}
@media(max-width:460px){.merchant-gallery-grid{grid-template-columns:1fr}.merchant-ocr-toolbar{grid-template-columns:1fr}}

/* 2026-07-23: compact merchant list after removing the visible system ID */
@media (min-width:1000px){
  .merchant-full-table{table-layout:fixed}
  .merchant-full-table th:nth-child(1),.merchant-full-table td:nth-child(1){width:32px}
  .merchant-full-table th:nth-child(2),.merchant-full-table td:nth-child(2){width:84px}
  .merchant-full-table th:nth-child(3),.merchant-full-table td:nth-child(3){width:76px}
  .merchant-full-table th:nth-child(4),.merchant-full-table td:nth-child(4){width:150px}
  .merchant-full-table th:nth-child(5),.merchant-full-table td:nth-child(5){width:140px}
  .merchant-full-table th:nth-child(6),.merchant-full-table td:nth-child(6){width:auto}
  .merchant-full-table th:nth-child(7),.merchant-full-table td:nth-child(7){width:92px}
  .merchant-full-table th:nth-child(8),.merchant-full-table td:nth-child(8){width:132px}
  .merchant-full-table th:nth-child(9),.merchant-full-table td:nth-child(9){width:82px}
  .merchant-full-table th:nth-child(10),.merchant-full-table td:nth-child(10){width:70px}
  .merchant-full-table th:nth-child(11),.merchant-full-table td:nth-child(11){width:74px}
  .merchant-full-table th,.merchant-full-table td{height:auto;vertical-align:top}
  .merchant-address-cell small{display:-webkit-box;max-height:36px;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-break:break-all}
  .merchant-full-table .map-actions{flex-wrap:nowrap}
  .merchant-full-table .map-actions .btn{white-space:nowrap}
}
.merchant-mobile-meta{grid-template-columns:minmax(130px,1fr) 120px}
@media(max-width:760px){
  .merchant-mobile-meta{grid-template-columns:1fr}
  .merchant-mobile-meta>label{grid-column:auto}
}

/* Merchant quick edit */
.merchant-full-table tr[data-inline-row] td:nth-child(4),
.merchant-full-table tr[data-inline-row] td:nth-child(5),
.merchant-full-table tr[data-inline-row] td:nth-child(6),
.merchant-full-table tr[data-inline-row] td:nth-child(7){
  cursor:pointer;
}
.merchant-full-table tr[data-inline-row] td:nth-child(4):hover,
.merchant-full-table tr[data-inline-row] td:nth-child(5):hover,
.merchant-full-table tr[data-inline-row] td:nth-child(6):hover,
.merchant-full-table tr[data-inline-row] td:nth-child(7):hover{
  background:#f8fbff;
  box-shadow:inset 0 0 0 1px rgba(37,99,235,.16);
}
.merchant-full-table tr[data-inline-row] td:nth-child(4):hover::after,
.merchant-full-table tr[data-inline-row] td:nth-child(5):hover::after,
.merchant-full-table tr[data-inline-row] td:nth-child(6):hover::after,
.merchant-full-table tr[data-inline-row] td:nth-child(7):hover::after{
  content:"点击快速编辑";
  display:inline-block;
  margin-top:6px;
  padding:2px 7px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:12px;
  font-weight:700;
}
.merchant-mobile-card[data-inline-row]{cursor:pointer}
.merchant-mobile-card[data-inline-row]::after{
  content:"点商家资料可快速编辑";
  display:block;
  margin-top:10px;
  color:#1d4ed8;
  font-size:13px;
  font-weight:700;
}
.merchant-inline-modal[hidden]{display:none}
.merchant-inline-modal{
  position:fixed;
  inset:0;
  z-index:1500;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.merchant-inline-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.58);
}
.merchant-inline-panel{
  position:relative;
  width:min(760px,96vw);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 24px 80px rgba(15,23,42,.28);
  padding:18px;
}
.merchant-inline-head,
.merchant-inline-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.merchant-inline-head{margin-bottom:14px}
.merchant-inline-head strong{font-size:22px}
.merchant-inline-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.merchant-inline-grid label{
  display:grid;
  gap:6px;
  color:#475569;
  font-weight:700;
}
.merchant-inline-grid input,
.merchant-inline-grid select,
.merchant-inline-grid textarea{
  width:100%;
  min-width:0;
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px 11px;
  font:inherit;
  color:#0f172a;
  background:#fff;
}
.merchant-inline-grid .wide{grid-column:1/-1}
.merchant-inline-actions{
  justify-content:flex-end;
  margin-top:16px;
}
@media(max-width:760px){
  .merchant-inline-modal{align-items:flex-end;padding:0}
  .merchant-inline-panel{width:100%;max-height:88vh;border-radius:18px 18px 0 0;padding:16px}
  .merchant-inline-grid{grid-template-columns:1fr}
  .merchant-inline-actions{display:grid;grid-template-columns:1fr 1fr}
  .merchant-inline-actions button{width:100%}
}

/* 2026-07-26: quick edit is limited to merchant remarks only */
.merchant-full-table tr[data-inline-row] td:nth-child(5),
.merchant-full-table tr[data-inline-row] td:nth-child(6),
.merchant-full-table tr[data-inline-row] td:nth-child(7){
  cursor:default;
}
.merchant-full-table tr[data-inline-row] td:nth-child(5):hover,
.merchant-full-table tr[data-inline-row] td:nth-child(6):hover,
.merchant-full-table tr[data-inline-row] td:nth-child(7):hover{
  background:transparent;
  box-shadow:none;
}
.merchant-full-table tr[data-inline-row] td:nth-child(5):hover::after,
.merchant-full-table tr[data-inline-row] td:nth-child(6):hover::after,
.merchant-full-table tr[data-inline-row] td:nth-child(7):hover::after{
  content:none;
  display:none;
}
.merchant-full-table tr[data-inline-row] td:nth-child(4):hover::after{
  content:"点备注快速编辑";
}
.merchant-mobile-card[data-inline-row]::after{
  content:"点备注可快速编辑";
}
.merchant-remark-panel{
  width:min(560px,96vw);
}

/* Delivery quantity is now a single business value: 派送数量 */
.delivery-qty-row.single{
  grid-template-columns:1fr!important;
}
.delivery-submit-summary{
  display:grid;
  gap:10px;
  margin:8px 0 12px;
}
.delivery-submit-summary>div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc;
}
.delivery-submit-summary strong{
  font-size:18px;
}
.delivery-submit-summary span{
  flex:0 0 auto;
  font-size:24px;
  font-weight:800;
  color:#111827;
}
.delivery-flow-list.embedded{
  margin:8px 0 10px;
}
.embedded-upload-form{
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
  padding:12px;
}
.embedded-extra-upload{
  border:0;
  margin:0;
}
.embedded-extra-upload summary{
  cursor:pointer;
  list-style:none;
  text-align:center;
}
.embedded-extra-upload summary::-webkit-details-marker{
  display:none;
}
.submit-review-form{
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:4px;
}
@media(max-width:520px){
  .delivery-submit-summary>div{
    align-items:flex-start;
    flex-direction:column;
  }
  .delivery-submit-summary span{
    font-size:28px;
  }
}

/* 2026-07-26: richer merchant/order filters without overlapping */
.merchant-list-toolbar .merchant-filter-form{
  grid-template-columns:minmax(260px,1.5fr) repeat(4,minmax(118px,.55fr)) auto auto!important;
  gap:8px;
  align-items:center;
  min-width:0;
}
.merchant-filter-form input[name=q]{min-width:0}
.merchant-filter-form select{min-width:118px}
.advanced-delivery-toolbar .delivery-filter-form{
  grid-template-columns:minmax(260px,1.45fr) repeat(2,minmax(145px,.65fr)) minmax(110px,.45fr) repeat(5,minmax(116px,.55fr)) auto auto!important;
}
.advanced-delivery-toolbar .delivery-filter-form label,
.advanced-delivery-toolbar .delivery-filter-form select{
  min-width:0;
}
@media(max-width:1400px){
  .merchant-list-toolbar .merchant-filter-form,
  .advanced-delivery-toolbar .delivery-filter-form{
    grid-template-columns:repeat(4,minmax(150px,1fr))!important;
  }
  .merchant-filter-form input[name=q],
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{
    grid-column:1/-1;
  }
}
@media(max-width:900px){
  .merchant-list-toolbar .merchant-filter-form,
  .advanced-delivery-toolbar .delivery-filter-form{
    grid-template-columns:1fr 1fr!important;
  }
  .merchant-filter-form input[name=q],
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{
    grid-column:1/-1;
  }
  .merchant-filter-form button,
  .merchant-filter-form .btn,
  .advanced-delivery-toolbar .delivery-filter-form button,
  .advanced-delivery-toolbar .delivery-filter-form .btn{
    width:100%;
  }
}
@media(max-width:520px){
  .merchant-list-toolbar .merchant-filter-form,
  .advanced-delivery-toolbar .delivery-filter-form{
    grid-template-columns:1fr!important;
  }
  .merchant-filter-form input[name=q],
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{
    grid-column:auto;
  }
}

/* 2026-07-26: show delivery order remarks directly in the order list */
.delivery-order-main-cell{
  min-width:220px;
}
.delivery-merchant-info{
  display:grid;
  gap:6px;
  min-width:190px;
  line-height:1.35;
}
.delivery-merchant-name{
  display:block;
  color:#111827;
  font-weight:800;
  overflow-wrap:anywhere;
}
.delivery-merchant-lines{
  display:grid;
  gap:4px;
  color:#334155;
  font-size:13px;
}
.delivery-merchant-lines span{
  display:flex;
  gap:6px;
  min-width:0;
  overflow-wrap:anywhere;
}
.delivery-merchant-lines em,
.delivery-merchant-remark em{
  flex:0 0 auto;
  font-style:normal;
  color:#64748b;
  font-size:12px;
}
.delivery-merchant-remark{
  display:grid;
  gap:3px;
  padding:6px 8px;
  border-radius:8px;
  background:#fff7ed;
  color:#9a3412;
}
.delivery-merchant-remark strong{
  font-weight:700;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.compact-merchant-box{
  grid-column:1/-1;
}
.compact-merchant-box .delivery-merchant-info{
  margin-top:4px;
}
.delivery-order-remark,
.compact-order-remark{
  display:block;
  margin-top:6px;
  color:#9a3412;
  font-size:13px;
  line-height:1.45;
  white-space:pre-wrap;
}
.compact-order-remark{
  width:max-content;
  max-width:100%;
  padding:5px 8px;
  border-radius:10px;
  background:#fff7ed;
}
.compact-remark{
  grid-column:1/-1;
}
.compact-remark strong{
  white-space:pre-wrap;
  color:#9a3412;
}

/* 2026-07-27: compact mobile submit review hint */
.complete-form{gap:10px}
.complete-form .complete-summary{margin:0;padding:9px 11px;border-radius:10px;font-size:15px;line-height:1.45}
.complete-form .complete-summary.warn{border:1px solid #fed7aa;background:#fff7ed;color:#9a3412}
.complete-form .complete-summary.ok{border:1px solid #bbf7d0;background:#f0fdf4;color:#166534}
@media(max-width:900px){
  .complete-form{padding:12px!important;gap:9px!important}
  .complete-form h3{font-size:18px!important;margin:0!important;line-height:1.25}
  .complete-form .complete-summary{font-size:15px!important;line-height:1.45!important;padding:8px 10px!important}
  .complete-form label{display:grid;gap:6px;font-size:16px}
  .complete-form textarea{min-height:72px}
}

/* 2026-07-27: make delivery filters visible and auto-flow safely. */
@media(min-width:901px){
  .advanced-delivery-toolbar .delivery-filter-form{
    grid-template-columns:repeat(6,minmax(120px,1fr))!important;
    align-items:end;
  }
  .advanced-delivery-toolbar .delivery-filter-form>input[name=q]{
    grid-column:span 2!important;
  }
  .advanced-delivery-toolbar .delivery-filter-form button,
  .advanced-delivery-toolbar .delivery-filter-form .btn{
    width:100%;
    min-width:0;
  }
}
.mobile-tabs.has-extra{overflow:visible}
.mobile-tabs.has-extra a{
  padding-left:12px;
  padding-right:12px;
}
.mobile-tabs.has-extra .mobile-account-tab{
  margin-left:auto;
}
.mobile-date-picker{
  position:relative;
  flex:0 0 auto;
  margin:0 8px 0 0;
}
.mobile-date-picker>summary{
  list-style:none;
}
.mobile-date-picker>summary::-webkit-details-marker{
  display:none;
}
.mobile-date-button{
  width:auto;
  min-height:38px;
  padding:8px 12px!important;
  justify-content:center;
  font-weight:800;
  white-space:nowrap;
}
.mobile-date-menu{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:30;
  width:min(240px, calc(100vw - 24px));
  max-height:360px;
  overflow:auto;
  margin-top:0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 36px rgba(15,23,42,.18);
}
@media(max-width:420px){
  .mobile-tabs.has-extra{
    gap:6px;
    padding-left:8px;
    padding-right:8px;
  }
  .mobile-tabs.has-extra a,
  .mobile-date-button{
    padding-left:9px!important;
    padding-right:9px!important;
    font-size:13px;
  }
  .mobile-date-picker{
    margin-right:4px;
  }
}
.mobile-date-filter{
  min-height:42px!important;
  border-radius:12px!important;
  font-weight:800;
}
.mobile-date-filter.active{
  background:var(--blue)!important;
  border-color:var(--blue)!important;
  color:#fff!important;
}
.mobile-more-menu .mobile-date-picker{
  grid-column:1/-1;
  margin:0;
}
.mobile-more-menu .mobile-date-button{
  width:100%;
}
.mobile-more-menu .mobile-date-menu{
  position:static;
  width:100%;
  max-height:320px;
  margin-top:8px;
  box-shadow:none;
}
.mobile-list-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 12px;
  color:var(--muted);
}
.mobile-list-controls label{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}
.mobile-list-controls label span{
  color:var(--muted);
}
.mobile-list-controls select{
  width:auto;
  min-width:96px;
  padding:8px 10px;
}
.mobile-list-controls input[type="number"]{
  width:92px;
  min-width:0;
  padding:8px 10px;
}
.mobile-list-controls .btn.small{
  width:auto;
  min-height:40px;
  padding:8px 12px;
}
.mobile-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:12px 0 4px;
  color:var(--muted);
}
.mobile-pagination>div{
  display:flex;
  gap:8px;
}
@media(max-width:420px){
  .mobile-date-menu{
    left:0;
    right:auto;
    width:min(230px, calc(100vw - 18px));
    max-height:340px;
  }
  .mobile-list-controls,
  .mobile-pagination{
    align-items:stretch;
    flex-direction:column;
  }
  .mobile-pagination>div{
    width:100%;
  }
  .mobile-pagination .btn{
    flex:1;
  }
}

/* 2026-07-27: keep merchant filters/actions from crowding and make batch merchant search operable. */
.merchant-list-card{
  overflow:hidden;
}
.merchant-list-head.merchant-list-toolbar{
  display:grid;
  gap:12px;
}
.merchant-list-toolbar .merchant-filter-form{
  display:grid!important;
  grid-template-columns:minmax(320px,1fr) repeat(4,minmax(126px,160px)) auto auto!important;
  gap:10px!important;
  align-items:center!important;
  width:100%;
}
.merchant-list-toolbar .merchant-filter-form input[name=q]{
  min-width:0;
}
.merchant-list-toolbar .merchant-filter-form select{
  min-width:0;
}
.merchant-primary-actions,
.merchant-bulk-actions{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  min-width:0;
}
.merchant-primary-actions .btn,
.merchant-primary-actions summary,
.merchant-bulk-actions .btn,
.merchant-bulk-actions button{
  white-space:nowrap;
}
.merchant-toolbar{
  grid-template-columns:minmax(300px,1.5fr) repeat(4,minmax(116px,.62fr)) repeat(4,auto)!important;
  align-items:stretch;
}
.merchant-bulk-search{
  min-height:46px;
  resize:vertical;
  line-height:1.35;
}
.merchant-picker-summary{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 14px;
  margin:0 0 10px;
  color:#475467;
}
.merchant-picker-summary strong{
  color:#111827;
}
.merchant-picker-empty{
  margin:0 0 10px;
  padding:10px 12px;
  border:1px dashed #fca5a5;
  border-radius:10px;
  background:#fff1f2;
  color:#991b1b;
}
.merchant-check-row{
  cursor:pointer;
}
.merchant-check-row.is-selected{
  background:#eff6ff;
  box-shadow:inset 4px 0 0 var(--blue);
}
.merchant-check-row.is-selected:hover{
  background:#dbeafe;
}
@media(max-width:1500px){
  .merchant-list-toolbar .merchant-filter-form{
    grid-template-columns:minmax(280px,1fr) repeat(4,minmax(120px,1fr)) auto auto!important;
  }
}
@media(max-width:1280px){
  .merchant-list-toolbar .merchant-filter-form{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .merchant-list-toolbar .merchant-filter-form input[name=q]{
    grid-column:1/-1;
  }
}
@media(max-width:900px){
  .merchant-list-toolbar .merchant-filter-form{
    grid-template-columns:1fr 1fr!important;
  }
  .merchant-list-toolbar .merchant-filter-form input[name=q]{
    grid-column:1/-1;
  }
  .merchant-list-toolbar .merchant-filter-form button,
  .merchant-list-toolbar .merchant-filter-form .btn{
    width:100%;
  }
  .merchant-toolbar{
    grid-template-columns:1fr 1fr!important;
  }
  .merchant-toolbar .merchant-bulk-search{
    grid-column:1/-1;
  }
}
@media(max-width:560px){
  .merchant-list-toolbar .merchant-filter-form,
  .merchant-toolbar{
    grid-template-columns:1fr!important;
  }
  .merchant-list-toolbar .merchant-filter-form input[name=q],
  .merchant-toolbar .merchant-bulk-search{
    grid-column:auto;
  }
}

/* 2026-07-27: compact merchant management toolbar. */
@media(min-width:901px){
  .merchant-list-card{
    padding:12px 14px!important;
  }
  .merchant-list-head.merchant-list-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin-bottom:8px!important;
    align-items:stretch!important;
  }
  .merchant-list-toolbar #merchant-bulk-form,
  .merchant-list-toolbar #merchant-sort-form,
  .merchant-list-toolbar #merchant-mobile-sort-form,
  .merchant-list-toolbar form[id^="merchant-inline-form-"],
  .merchant-list-toolbar form[id^="merchant-inline-mobile-form-"]{
    display:none!important;
  }
  .merchant-list-toolbar .merchant-filter-form{
    grid-template-columns:minmax(280px,1fr) repeat(4,minmax(108px,140px)) 72px 72px!important;
    gap:8px!important;
  }
  .merchant-list-toolbar .merchant-filter-form input,
  .merchant-list-toolbar .merchant-filter-form select,
  .merchant-list-toolbar .merchant-filter-form button,
  .merchant-list-toolbar .merchant-filter-form .btn{
    min-height:38px!important;
    padding:7px 10px!important;
    font-size:13px!important;
  }
  .merchant-primary-actions,
  .merchant-bulk-actions{
    gap:7px!important;
    margin:0!important;
    min-height:0!important;
  }
  .merchant-primary-actions .btn,
  .merchant-primary-actions summary,
  .merchant-bulk-actions .btn,
  .merchant-bulk-actions button,
  .merchant-bulk-actions select{
    min-height:36px!important;
    padding:7px 10px!important;
    font-size:13px!important;
  }
  .merchant-bulk-actions{
    align-items:center!important;
  }
.merchant-bulk-region-select{
    max-width:260px;
  }
  .merchant-sort-hint{
    font-size:12px!important;
    margin-left:auto;
  }
  .merchant-full-table-wrap{
    margin-top:8px!important;
  }
}

/* 2026-07-27: editable delivery item details in order list. */
.delivery-items-empty{
  margin-top:8px;
  color:#64748b;
  font-size:13px;
}
.delivery-items-summary{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
  max-width:520px;
}
.delivery-items-summary span,
.delivery-items-summary em{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef5ff;
  color:#1d4ed8;
  font-size:12px;
  font-style:normal;
  line-height:1.3;
}
.delivery-items-summary em{
  background:#f8fafc;
  color:#475569;
}
.delivery-items-editor{
  margin-top:8px;
  max-width:560px;
}
.delivery-items-editor>summary{
  cursor:pointer;
  color:#2563eb;
  font-weight:700;
  font-size:13px;
  list-style-position:inside;
}

.delivery-existing-item-remove{
  align-self:end;
  border-color:#fecaca;
  color:#dc2626;
  background:#fff;
}

.delivery-existing-item-remove:hover{
  background:#fef2f2;
}

.delivery-items-edit-message{
  margin:8px 0 0;
  padding:9px 12px;
  border:1px solid #bfdbfe;
  border-radius:6px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:14px;
}

.delivery-items-edit-form{
  display:grid;
  gap:8px;
  margin-top:8px;
  padding:10px;
  border:1px solid #dbe3ef;
  border-radius:10px;
  background:#f8fbff;
}
.delivery-item-edit-row{
  display:grid;
  grid-template-columns:minmax(110px,1fr) 120px minmax(150px,1.4fr) auto;
  gap:8px;
  align-items:end;
}
.delivery-item-edit-row strong{
  align-self:center;
}
.delivery-item-edit-row label,
.delivery-new-item-row label,
.delivery-order-remark-edit{
  display:grid;
  gap:4px;
  color:#475569;
  font-size:12px;
}
.delivery-item-edit-row input,
.delivery-new-item-row input,
.delivery-new-item-row select,
.delivery-order-remark-edit textarea{
  width:100%;
  min-height:34px;
  padding:7px 9px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  font-size:13px;
  background:#fff;
}
.delivery-order-remark-edit textarea{
  resize:vertical;
}
.delivery-item-delete{
  display:flex!important;
  grid-template-columns:auto 1fr;
  align-items:center;
  min-height:34px;
  padding:7px 9px;
  border:1px solid #fecaca;
  border-radius:8px;
  color:#b91c1c!important;
  background:#fff;
  white-space:nowrap;
}
.delivery-item-delete input{
  width:16px;
  min-height:16px;
  margin:0;
}
.delivery-new-items{
  display:grid;
  gap:8px;
  margin-top:4px;
  padding-top:10px;
  border-top:1px solid #dbe3ef;
}
.delivery-new-item-row{
  display:grid;
  grid-template-columns:minmax(150px,1.3fr) 120px minmax(150px,1fr) auto;
  gap:8px;
  align-items:end;
}
.delivery-new-item-remove{
  min-height:34px;
}
.delivery-add-item-button{
  justify-self:start;
}
.compact-items-editor{
  max-width:none;
}
@media(max-width:760px){
  .delivery-items-summary{
    max-width:none;
  }
  .delivery-items-summary span,
  .delivery-items-summary em{
    width:100%;
    justify-content:space-between;
    border-radius:8px;
    font-size:14px;
  }
  .delivery-item-edit-row{
    grid-template-columns:1fr;
  }
  .delivery-new-item-row{
    grid-template-columns:1fr;
  }
  .delivery-item-delete{
    justify-self:start;
  }
  .delivery-items-edit-form{
    padding:12px;
  }
}

/* Merchant export selector: keep every field and action visible in a centered modal. */
.merchant-export-panel[open]::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:90;
  background:rgba(15,23,42,.55);
}
.merchant-export-panel[open] .export-field-form{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  top:50%!important;
  z-index:91!important;
  width:min(760px,calc(100vw - 32px))!important;
  max-width:760px!important;
  max-height:calc(100vh - 32px);
  margin:0!important;
  padding:18px!important;
  overflow-y:auto;
  transform:translate(-50%,-50%);
  box-shadow:0 24px 70px rgba(15,23,42,.28);
}
.merchant-export-panel .export-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:10px;
}
.merchant-export-panel .export-modal-head strong{
  display:block;
  font-size:20px;
}
.merchant-export-panel .export-modal-head p{
  margin:6px 0 0;
  line-height:1.5;
}
.merchant-export-panel .export-modal-close{
  flex:0 0 40px;
  width:40px;
  height:40px;
  padding:0;
  border-radius:50%;
  background:#111827;
  border-color:#111827;
  color:#fff;
  font:700 18px/1 Arial,sans-serif;
}
.merchant-export-panel .export-field-actions{
  position:sticky;
  top:-18px;
  z-index:2;
  margin:0 -18px 12px;
  padding:10px 18px;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.merchant-export-panel .export-field-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  max-height:none!important;
  overflow:visible!important;
  padding:14px;
}
.merchant-export-panel .export-field-grid label{
  min-height:38px;
  min-width:0;
  padding:7px 8px;
  border-radius:7px;
  overflow-wrap:anywhere;
}
.merchant-export-panel .export-field-grid label:hover{
  background:#eaf2ff;
}
.merchant-export-panel .export-field-form>.green.full{
  position:sticky;
  bottom:-18px;
  z-index:2;
  min-height:48px;
  margin:14px -18px -18px;
  width:calc(100% + 36px);
  border-radius:0 0 12px 12px;
  font-size:16px;
  font-weight:700;
}
@media(max-width:700px){
  .merchant-export-panel[open] .export-field-form{
    width:calc(100vw - 20px)!important;
    max-height:calc(100vh - 20px);
    padding:14px!important;
  }
  .merchant-export-panel .export-field-actions{
    top:-14px;
    margin:0 -14px 10px;
    padding:9px 14px;
  }
  .merchant-export-panel .export-field-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .merchant-export-panel .export-field-form>.green.full{
    bottom:-14px;
    margin:12px -14px -14px;
    width:calc(100% + 28px);
  }
}
@media(max-width:420px){
  .merchant-export-panel .export-field-grid{
    grid-template-columns:1fr!important;
  }
}
.status-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.btn.active .status-filter-count,
.btn.primary .status-filter-count {
  background: rgba(255, 255, 255, .24);
  color: #fff;
}

.review-toolbar-card {
  display: grid;
  gap: 14px;
}

.review-status-tabs {
  row-gap: 8px;
}

.review-search-form {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(110px, 140px) minmax(120px, 150px) auto auto;
  gap: 10px;
  align-items: end;
}

.review-search-form textarea {
  min-height: 58px;
  resize: vertical;
}

.review-search-form .btn,
.review-search-form button {
  min-width: 76px;
}

.review-per-page-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.review-per-page-field select,
.review-per-page-field input {
  width: 100%;
}

.review-pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.review-pagination-footer .disabled {
  pointer-events: none;
  opacity: .45;
}

@media(max-width:1100px) {
  .review-search-form {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 140px) minmax(120px, 150px);
  }
}

@media(max-width:760px) {
  .review-toolbar-card {
    gap: 10px;
  }

  .review-search-form {
    grid-template-columns: 1fr 1fr;
  }

  .review-search-form textarea {
    grid-column: 1 / -1;
    min-height: 76px;
  }

  .review-per-page-field {
    grid-column: auto;
  }

  .review-search-form .btn,
  .review-search-form button {
    width: 100%;
  }

  .review-pagination-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-list-controls {
    align-items:flex-end;
    justify-content:flex-start;
    flex-wrap:wrap;
  }

  .review-pagination-footer .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


/* Admin multi-page tabs. */
.admin-page-tabs{
  display:flex;
  align-items:stretch;
  min-width:0;
  min-height:44px;
  margin:-22px -22px 18px;
  padding:0 22px;
  border-bottom:1px solid #d8dee9;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.admin-page-tabs-back{
  flex:0 0 42px;
  width:42px;
  min-height:43px;
  padding:0;
  border:0;
  border-right:1px solid #d8dee9;
  border-radius:0;
  background:#fff;
  color:#475467;
  font-size:25px;
  line-height:1;
}
.admin-page-tabs-back:hover{background:#f8fafc;color:#111827}
.admin-page-tabs-scroll{
  display:flex;
  align-items:stretch;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
.admin-page-tab{
  display:flex;
  flex:0 0 auto;
  align-items:center;
  min-width:112px;
  max-width:220px;
  border-right:1px solid #d8dee9;
  background:#fff;
  color:#344054;
}
.admin-page-tab:hover{background:#f8fafc}
.admin-page-tab.active{background:var(--blue);color:#fff}
.admin-page-tab-link{
  min-width:0;
  flex:1;
  overflow:hidden;
  padding:12px 8px 12px 14px;
  color:inherit;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-page-tab-close{
  flex:0 0 28px;
  width:28px;
  min-width:28px;
  min-height:0!important;
  height:30px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
  color:inherit;
  font-size:18px;
  line-height:1;
  opacity:.7;
}
.admin-page-tab-close:hover{background:rgba(15,23,42,.08);opacity:1}
.admin-page-tab.active .admin-page-tab-close:hover{background:rgba(255,255,255,.22)}
@media(max-width:1000px){
  .admin-page-tabs{margin:-14px -14px 14px;padding:0 14px}
}
@media(max-width:760px){
  .admin-page-tabs{min-height:42px;margin:-10px -10px 10px;padding:0 10px}
  .admin-page-tabs-back{flex-basis:38px;width:38px;min-height:41px}
  .admin-page-tab{min-width:104px;max-width:180px}
  .admin-page-tab-link{padding:10px 7px 10px 12px;font-size:14px}
  .admin-page-tab-close{height:28px;font-size:17px}
}


/* Merchant selected export and quick dispatch. */
.merchant-full-table .merchant-row-actions{
  min-width:76px;
  flex-direction:column;
  align-items:stretch;
  flex-wrap:nowrap;
  gap:6px;
}
.merchant-full-table .merchant-row-actions>a,
.merchant-full-table .merchant-row-actions>form,
.merchant-full-table .merchant-row-actions>form>button{width:100%}
.delivery-export-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.delivery-export-head strong{font-size:16px}
.delivery-export-close{
  flex:0 0 34px;
  width:34px;
  height:34px;
  min-height:34px!important;
  padding:0;
  border-radius:50%;
  background:#111827;
  border-color:#111827;
  color:#fff;
  font:700 18px/1 Arial,sans-serif;
}
.delivery-create-prefill{
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid #bfdbfe;
  border-radius:10px;
  background:#eff6ff;
  color:#1d4ed8;
}
@media(max-width:760px){
  .merchant-mobile-card .merchant-row-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
  .merchant-mobile-card .merchant-row-actions>a,
  .merchant-mobile-card .merchant-row-actions>form,
  .merchant-mobile-card .merchant-row-actions>form>button{width:100%}
}


/* Merchant compact links, actions, and header. */
.main:has(.merchants-admin-page)>.topbar{margin-bottom:10px;gap:10px;min-height:0}
.main:has(.merchants-admin-page)>.topbar h1{font-size:24px;line-height:1.15;margin:0 0 2px}
.main:has(.merchants-admin-page)>.topbar>div:first-child>span{line-height:1.2}
.main:has(.merchants-admin-page)>.topbar>.actions .btn{padding:7px 11px}
.merchant-address-cell{min-width:0}
.merchant-copy-google{display:block!important;max-width:none!important;margin-top:4px;white-space:normal;overflow:visible}
.merchant-copy-google .merchant-copy-value{display:block;width:100%;max-width:none;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:break-all;line-height:1.45}
.merchant-table td.merchant-row-actions{vertical-align:top!important;align-self:flex-start;align-content:flex-start;justify-content:flex-start;padding-top:8px}
.merchant-row-actions>.btn,.merchant-row-actions>form,.merchant-row-actions>form>button{width:100%}
@media(max-width:760px){.main:has(.merchants-admin-page)>.topbar{margin-bottom:8px}.merchant-mobile-copy-row .merchant-copy-value{max-width:100%;overflow-wrap:anywhere;word-break:break-all}.merchant-row-actions>.btn,.merchant-row-actions>form,.merchant-row-actions>form>button{width:100%}}


/* Merchant action table-cell alignment fix. */
.merchant-table td.merchant-action-cell{vertical-align:top!important;padding-top:8px!important}
.merchant-action-cell>.merchant-row-actions{display:flex;flex-direction:column;align-items:stretch;align-content:flex-start;justify-content:flex-start;gap:6px}

/* Product inventory and purchasing: phone card tables. */
@media(max-width:760px){
  .product-list-wrap,
  .purchase-product-table-wrap,
  .purchase-list-wrap{
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
  }
  .product-list-table,
  .purchase-product-table,
  .purchase-list-table{
    display:block;
    width:100%;
    border:0;
  }
  .product-list-table thead,
  .purchase-product-table thead,
  .purchase-list-table thead{display:none}
  .product-list-table tbody,
  .purchase-product-table tbody,
  .purchase-list-table tbody{display:grid;gap:10px;width:100%}
  .product-list-table tbody tr,
  .purchase-product-table tbody tr,
  .purchase-list-table tbody tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 10px;
    width:100%;
    padding:10px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
  }
  .product-list-table tbody td,
  .purchase-product-table tbody td,
  .purchase-list-table tbody td{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-width:0;
    width:auto!important;
    max-width:none!important;
    padding:8px 2px!important;
    border:0!important;
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
  }
  .product-list-table tbody td::before,
  .purchase-product-table tbody td::before,
  .purchase-list-table tbody td::before{
    content:attr(data-label);
    flex:0 0 auto;
    color:#64748b;
    font-size:12px;
    font-weight:700;
    text-align:left;
  }
  .product-list-table td[data-label="商品"],
  .product-list-table td[data-label="操作"],
  .purchase-product-table td[data-label="商品"],
  .purchase-product-table td[data-label="操作"],
  .purchase-list-table td[data-label="单号"],
  .purchase-list-table td[data-label="厂家"],
  .purchase-list-table td[data-label="商品明细"],
  .purchase-list-table td[data-label="备注"],
  .purchase-list-table td[data-label="操作"]{grid-column:1/-1}
  .product-list-table td[data-label="商品"],
  .purchase-product-table td[data-label="商品"],
  .purchase-list-table td[data-label="单号"],
  .purchase-list-table td[data-label="厂家"],
  .purchase-list-table td[data-label="商品明细"],
  .purchase-list-table td[data-label="备注"]{
    display:grid;
    justify-content:stretch;
    text-align:left!important;
  }
  .product-list-table .product-stock-cell{display:grid;justify-content:stretch;text-align:left!important}
  .product-list-table .product-stock-pill{width:100%;min-width:0;justify-content:center}
  .product-list-table .sort-cell{min-width:0}
  .product-list-table .sort-cell input{width:82px}
  .product-list-table td[data-label="操作"],
  .purchase-product-table td[data-label="操作"],
  .purchase-list-table td[data-label="操作"]{
    display:grid!important;
    grid-template-columns:1fr;
    align-items:stretch;
    text-align:left!important;
  }
  .product-list-table td[data-label="操作"]::before,
  .purchase-product-table td[data-label="操作"]::before,
  .purchase-list-table td[data-label="操作"]::before{margin-bottom:2px}
  .product-list-table td[data-label="操作"]>* ,
  .purchase-product-table td[data-label="操作"]>* ,
  .purchase-list-table td[data-label="操作"]>* ,
  .product-list-table td[data-label="操作"] form button,
  .purchase-product-table td[data-label="操作"] form button,
  .purchase-list-table td[data-label="操作"] form button{width:100%;margin:0}
  .purchase-inline-items{min-width:0;width:100%}
  .purchase-inline-item{overflow-wrap:anywhere}
  .purchase-product-manager .compact-table-wrap{max-height:none}
  .purchase-admin-grid{gap:10px}
}
@media(max-width:420px){
  .product-list-table tbody tr,
  .purchase-product-table tbody tr,
  .purchase-list-table tbody tr{grid-template-columns:1fr}
  .product-list-table tbody td,
  .purchase-product-table tbody td,
  .purchase-list-table tbody td{grid-column:1/-1}
}

/* Purchase list filters. */
.purchase-filter-form{
  display:grid;
  grid-template-columns:minmax(220px,1.4fr) minmax(150px,.8fr) minmax(145px,.7fr) minmax(145px,.7fr) minmax(145px,.7fr) auto;
  gap:10px;
  align-items:end;
  margin:12px 0 8px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc;
}
.purchase-filter-form label{display:grid;gap:5px;min-width:0;color:#475569;font-size:13px}
.purchase-filter-form input,.purchase-filter-form select{width:100%;min-width:0;background:#fff}
.purchase-filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.purchase-filter-actions>*{width:100%;white-space:nowrap}
.purchase-filter-result{margin:0 0 10px;color:var(--muted)}
.purchase-filter-result strong{color:#0f172a;font-variant-numeric:tabular-nums}
@media(max-width:1200px){
  .purchase-filter-form{grid-template-columns:repeat(3,minmax(0,1fr))}
  .purchase-filter-actions{grid-column:1/-1}
}
@media(max-width:760px){
  .purchase-filter-form{grid-template-columns:1fr;padding:10px}
  .purchase-filter-actions{grid-column:auto;grid-template-columns:1fr 1fr}
}

/* Merchant table fit and delivery page phone layout. */
@media(min-width:1000px){
  .merchant-full-table-wrap{overflow-x:auto}
  .merchant-full-table{width:100%;min-width:1260px!important;table-layout:fixed}
  .merchant-full-table th:nth-child(1),.merchant-full-table td:nth-child(1){width:2%}
  .merchant-full-table th:nth-child(2),.merchant-full-table td:nth-child(2){width:7%}
  .merchant-full-table th:nth-child(3),.merchant-full-table td:nth-child(3){width:7%}
  .merchant-full-table th:nth-child(4),.merchant-full-table td:nth-child(4){width:10%}
  .merchant-full-table th:nth-child(5),.merchant-full-table td:nth-child(5){width:9%}
  .merchant-full-table th:nth-child(6),.merchant-full-table td:nth-child(6){width:27%}
  .merchant-full-table th:nth-child(7),.merchant-full-table td:nth-child(7){width:6%}
  .merchant-full-table th:nth-child(8),.merchant-full-table td:nth-child(8){width:8%}
  .merchant-full-table th:nth-child(9),.merchant-full-table td:nth-child(9){width:8%}
  .merchant-full-table th:nth-child(10),.merchant-full-table td:nth-child(10){width:5%}
  .merchant-full-table th:nth-child(11),.merchant-full-table td:nth-child(11){width:11%}
  .merchant-full-table .merchant-row-actions{min-width:0}
  .merchant-full-table .merchant-address-cell{min-width:0!important;white-space:normal!important}
  .merchant-full-table .merchant-copy-google{
    display:block!important;
    width:100%;
    min-width:0;
    max-width:100%!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    white-space:normal!important;
    -webkit-line-clamp:unset!important;
  }
  .merchant-full-table .merchant-copy-google .merchant-copy-value{
    display:block!important;
    width:100%!important;
    min-width:0;
    max-width:100%!important;
    max-height:none!important;
    overflow:visible!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-all!important;
  }
}
@media(max-width:900px){
  .batch-delivery-card,
  .delivery-list-card{max-width:100%;overflow:hidden}
  .batch-delivery-form,
  .batch-panel,
  .merchant-check-table,
  .override-panel,
  .override-table-wrap{min-width:0;max-width:100%}
  .merchant-check-table{overflow-y:auto;overflow-x:hidden}
  .merchant-check-head{display:none}
  .merchant-check-row:not(.merchant-check-head){
    min-width:0;
    grid-template-columns:30px minmax(0,1fr);
    gap:5px 10px;
    align-items:start;
    padding:11px 10px;
  }
  .merchant-check-row:not(.merchant-check-head)>span:first-child{grid-column:1;grid-row:1 / span 5;padding-top:2px}
  .merchant-check-row:not(.merchant-check-head)>strong{grid-column:2;font-size:15px;line-height:1.35;overflow-wrap:anywhere}
  .merchant-check-row:not(.merchant-check-head)>span[data-label]{grid-column:2;min-width:0;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}
  .merchant-check-row:not(.merchant-check-head)>span[data-label]::before{content:attr(data-label) "：";color:var(--muted);font-size:12px}
  .override-table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}
  .delivery-bulk-delete-bar{max-width:100%}
}
@media(max-width:520px){
  .batch-toolbar{grid-template-columns:1fr!important}
  .batch-toolbar>*{grid-column:auto!important;width:100%}
  .batch-product-row>*{width:100%}
  .batch-panel-head button{width:100%;margin-top:10px}
  .advanced-delivery-toolbar .delivery-filter-buttons{max-width:100%}
  .delivery-bulk-delete-bar .actions{grid-template-columns:1fr 1fr}
  .delivery-bulk-delete-bar .actions>*{width:100%}
}
