
:root{
  --bg:#f4f7fb; --card:#fff; --text:#1b2430; --muted:#667085; --border:#dbe2ea;
  --primary:#1d4ed8; --primary-dark:#163ea9; --success:#128045; --danger:#c62828; --warning:#d97706;
  --shadow:0 10px 30px rgba(15,23,42,.08); --radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}
img{max-width:100%}
.container{max-width:1280px;margin:0 auto;padding:24px}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}
.brand{font-size:22px;font-weight:800}
.nav-links{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.nav-links a,.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:none;border-radius:12px;padding:12px 16px;font-weight:700;cursor:pointer;transition:.2s}
.btn{background:#e8eefb;color:var(--text)}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-success{background:var(--success);color:#fff}
.btn-danger{background:var(--danger);color:#fff}
.btn-warning{background:var(--warning);color:#fff}
.btn-outline{background:#fff;border:1px solid var(--border)}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}
.product-card{padding:16px;display:flex;flex-direction:column;gap:12px}
.product-image{height:180px;background:#fff;border:1px solid var(--border);border-radius:14px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.product-image img{width:100%;height:100%;object-fit:contain}
.badge{display:inline-flex;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700}
.badge-success{background:#e8f7ef;color:var(--success)}
.badge-danger{background:#fde8e8;color:var(--danger)}
.badge-info{background:#e8eefb;color:var(--primary)}
.price{font-size:22px;font-weight:800}
.price-old{text-decoration:line-through;color:var(--muted);margin-right:8px}
.price-low{color:var(--success);font-weight:800}
.price-up{color:var(--text);font-weight:800}
.field, .select, .textarea{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:#fff}
.field:focus,.select:focus,.textarea:focus{outline:none;border-color:#90b4ff;box-shadow:0 0 0 4px rgba(29,78,216,.12)}
.table-wrap{overflow:auto}
.table{width:100%;border-collapse:collapse;background:#fff}
.table th,.table td{padding:12px;border-bottom:1px solid var(--border);vertical-align:top;text-align:left}
.layout-admin{display:grid;grid-template-columns:260px 1fr;min-height:100vh}
.sidebar{background:#0f172a;color:#fff;padding:24px;position:sticky;top:0;height:100vh}
.sidebar .menu{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.sidebar a{padding:12px 14px;border-radius:12px;color:#dbe5ff}
.sidebar a.active,.sidebar a:hover{background:#1e293b;color:#fff}
.content{padding:24px}
.toolbar{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.kpi{padding:18px}
.drawer{position:fixed;right:18px;top:92px;width:360px;max-height:calc(100vh - 110px);display:flex;flex-direction:column;z-index:20}
.drawer.hidden .drawer-body{display:none}
.drawer .drawer-head{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.drawer .drawer-body{padding:16px;overflow:auto}
.drawer-item{display:grid;grid-template-columns:56px 1fr auto;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.drawer-thumb{width:56px;height:56px;border-radius:12px;border:1px solid var(--border);object-fit:contain;background:#fff}
.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:#111827;color:#fff;padding:12px 16px;border-radius:12px;opacity:0;pointer-events:none;transition:.2s}
.toast.show{opacity:1}
.auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-card{width:min(440px, 100%);padding:28px}
.muted{color:var(--muted)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.space-y > * + *{margin-top:12px}
.small{font-size:12px}
.strike{text-decoration:line-through;opacity:.7}
.line-through{text-decoration:line-through}
.substitutions{margin-top:8px;display:flex;flex-direction:column;gap:8px}
.sub-card{padding:10px;border:1px dashed var(--border);border-radius:12px;background:#fafcff}
.notice{padding:14px 16px;border-radius:12px;background:#eef4ff;border:1px solid #d5e3ff}
@media (max-width: 980px){
  .layout-admin{grid-template-columns:1fr}
  .sidebar{height:auto;position:static}
  .drawer{position:static;width:auto;max-height:none;margin-top:18px}
}

.sub-rejected{opacity:.72;background:#fff7f7;border-color:#f5c2c2}.quote-line{overflow:hidden}

.quote-line-sub td{background:#f8fbff}.sub-indent{width:18px;height:18px;border-left:2px solid #bfdbfe;margin-right:2px}.notice-success{background:#e8f7ef;border-color:#bbf7d0;color:#166534}.notice-error{background:#fde8e8;border-color:#fecaca;color:#991b1b}

.page-columns{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.summary-column{position:sticky;top:24px}
.summary-card{padding:18px}
.summary-title{font-size:18px;font-weight:800;margin-bottom:12px}
.summary-row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border)}
.summary-total{font-size:22px;font-weight:800;margin-top:16px;margin-bottom:8px}
.line-disabled{background:#f2f4f7;border-color:#d0d5dd}
.line-disabled .muted{color:#7a8495}
.quote-line-sub{background:#fbfdff}
@media (max-width: 980px){
  .page-columns{grid-template-columns:1fr}
  .summary-column{position:static}
}

.page-columns{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.summary-column{position:sticky;top:92px}
.summary-card{padding:20px}
.summary-title{font-size:20px;font-weight:800;margin-bottom:16px}
.summary-row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border)}
.summary-total{display:flex;justify-content:space-between;align-items:center;margin-top:16px;padding-top:16px;border-top:1px solid var(--border);font-size:22px;font-weight:800}
.quote-line .row-price-block{min-width:260px;text-align:left}
.unit-price{font-size:20px;font-weight:400}
.product-total-value,.line-total-emphasis{font-size:20px;font-weight:800}
.quote-line-sub{margin-left:24px;background:#f8fbff}
.line-disabled{opacity:.72;background:#f2f4f7}
.line-disabled .field,.line-disabled .btn{pointer-events:none}
@media (max-width: 980px){
  .page-columns{grid-template-columns:1fr}
  .summary-column{position:static}
  .drawer{position:static;width:auto;max-height:none;margin-top:18px}
}


/* cart preview and order lines refinements */
.drawer{width:460px;border-radius:24px;overflow:hidden}
.drawer .drawer-head{padding:22px 24px;background:#f7f8fb}
.drawer .drawer-head strong{font-size:18px;font-weight:800}
.drawer .drawer-body{padding:0 16px 16px}
.drawer-item{display:grid;grid-template-columns:76px minmax(0,1fr);gap:18px;padding:18px 0;border-bottom:1px solid var(--border)}
.drawer-thumb{width:76px;height:76px;border-radius:18px}
.drawer-item-main{min-width:0}
.drawer-item-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.drawer-item-title{font-size:18px;font-weight:800;line-height:1.1;margin:0 0 4px}
.drawer-item-desc{font-size:15px;line-height:1.2}
.drawer-item-price{font-size:22px;font-weight:800;white-space:nowrap}
.drawer-item-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:end;margin-top:12px}
.drawer-total-label{font-size:13px;color:var(--muted);margin-bottom:6px}
.drawer-total-value{font-size:20px;font-weight:800}
.drawer-actions{display:flex;align-items:end;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.drawer-qty-input{width:100px}
.drawer-footer{padding-top:16px;display:flex;flex-direction:column;gap:10px}
.drawer-footer-total{display:flex;justify-content:space-between;align-items:center;font-size:24px;font-weight:800}
.drawer-footer-note{font-size:13px;color:var(--muted)}
.page-columns{grid-template-columns:minmax(0,1fr) 380px}
.summary-column{top:92px}
.quote-line{padding:26px !important;border-radius:24px}
.quote-line-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.quote-main{display:flex;align-items:flex-start;gap:16px;min-width:0}
.quote-thumb{width:96px;height:96px;object-fit:contain;border:1px solid var(--border);border-radius:18px;background:#fff;flex:0 0 auto}
.quote-thumb-sm{width:84px;height:84px}
.quote-meta strong{display:block;font-size:20px;line-height:1.1;margin-bottom:6px}
.quote-meta .muted{font-size:16px;line-height:1.25}
.quote-status{margin-left:auto}
.quote-line-body{display:grid;grid-template-columns:minmax(260px,1fr) 220px 220px auto;gap:18px;align-items:end;margin-top:18px}
.quote-qty-block{min-width:0}
.quote-field-label{font-size:14px;color:var(--muted);margin-bottom:8px}
.quote-qty-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.quote-qty-input{width:124px;max-width:none !important}
.row-price-block,.row-total-block{text-align:left;justify-self:start}
.row-price-block .small,.row-total-block .small{display:block;margin-bottom:6px}
.unit-price{font-size:18px;font-weight:400}
.product-total-value,.line-total-emphasis{font-size:18px;font-weight:800}
.quote-remove-block{justify-self:end}
.quote-line-sub{margin-left:28px}
.line-disabled .quote-remove-block,.line-disabled .quote-qty-actions{display:none}
.line-disabled .quote-line-body{grid-template-columns:minmax(220px,1fr) 220px 220px}
@media (max-width:1180px){
  .page-columns{grid-template-columns:1fr}
  .summary-column{position:static}
  .drawer{position:static;width:auto;max-height:none;margin-top:18px}
}
@media (max-width:860px){
  .quote-line-body{grid-template-columns:1fr;gap:14px}
  .quote-remove-block{justify-self:start}
  .drawer-item-bottom{grid-template-columns:1fr}
  .drawer-actions{justify-content:flex-start}
}


/* ===== Final responsive fixes for order_view and cart preview ===== */
.client-order-page .container{max-width:1400px}
.client-order-page .topbar{align-items:flex-start}
.client-order-page .toolbar{align-items:flex-start}
.client-order-page .brand{line-height:1.1}
.client-order-page .space-y{display:flex;flex-direction:column;gap:18px}
.client-order-page .space-y > * + *{margin-top:0}
.client-order-page .quote-line,
.client-order-page .quote-line-sub,
.client-order-page .js-new-line{overflow:hidden}
.client-order-page .quote-line{padding:24px !important}
.client-order-page .quote-line-sub{padding:20px !important;margin-left:24px;background:#f8fbff}
.client-order-page .js-new-line{padding:20px !important}
.client-order-page .quote-line-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.client-order-page .quote-main{display:flex;align-items:flex-start;gap:18px;min-width:0;flex:1 1 auto}
.client-order-page .quote-thumb,
.client-order-page .quote-thumb-sm{display:block;flex:0 0 auto;min-width:88px;max-width:88px;min-height:88px;max-height:88px;width:88px !important;height:88px !important;object-fit:contain;border:1px solid var(--border);border-radius:18px;background:#fff;padding:8px;box-sizing:border-box}
.client-order-page .quote-thumb-sm{min-width:78px;max-width:78px;min-height:78px;max-height:78px;width:78px !important;height:78px !important}
.client-order-page .quote-meta{min-width:0;flex:1 1 auto}
.client-order-page .quote-meta strong{display:block;font-size:18px;line-height:1.15;margin:0 0 6px;word-break:break-word}
.client-order-page .quote-meta .muted{font-size:15px;line-height:1.25;word-break:break-word}
.client-order-page .quote-status{flex:0 0 auto;align-self:flex-start}
.client-order-page .quote-line-body{display:grid;grid-template-columns:minmax(240px,1.15fr) minmax(160px,.55fr) minmax(170px,.6fr) auto;gap:18px;align-items:end}
.client-order-page .quote-qty-block,
.client-order-page .row-price-block,
.client-order-page .row-total-block{min-width:0}
.client-order-page .quote-field-label,
.client-order-page .row-price-block .small,
.client-order-page .row-total-block .small{display:block;margin:0 0 8px;font-size:14px;color:var(--muted)}
.client-order-page .quote-qty-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.client-order-page .quote-qty-input{width:116px !important;min-width:116px}
.client-order-page .row-price-block,
.client-order-page .row-total-block{justify-self:start;text-align:left}
.client-order-page .unit-price{display:inline-block;font-size:17px;font-weight:400;color:var(--text);line-height:1.2}
.client-order-page .price-old{display:inline-block;margin-right:8px}
.client-order-page .product-total-value,
.client-order-page .line-total-emphasis{font-size:18px;font-weight:800;line-height:1.2;color:var(--text)}
.client-order-page .quote-remove-block{justify-self:end}
.client-order-page .line-disabled{background:#f1f3f6;border-color:#d6dae3;opacity:1}
.client-order-page .line-disabled .quote-thumb{filter:grayscale(20%);opacity:.82}
.client-order-page .line-disabled .quote-line-body{grid-template-columns:minmax(220px,1fr) minmax(160px,.55fr) minmax(170px,.6fr)}
.client-order-page .summary-column{position:sticky;top:24px}
.client-order-page .summary-card{padding:22px;border-radius:22px}
.client-order-page .summary-title{font-size:20px;font-weight:800;margin-bottom:18px}
.client-order-page .summary-row{font-size:15px}
.client-order-page .summary-total{font-size:24px}
.client-order-page .summary-total span{margin-left:12px;white-space:nowrap}

/* Cart preview / drawer */
.drawer{width:420px;max-width:100%;border-radius:24px;overflow:hidden}
.drawer .drawer-head{padding:20px 22px;background:#f7f8fb;display:flex;justify-content:space-between;gap:12px;align-items:center}
.drawer .drawer-head strong{font-size:17px;line-height:1.2}
.drawer .drawer-body{padding:0 16px 16px}
.drawer-item{display:grid;grid-template-columns:74px minmax(0,1fr);gap:16px;padding:18px 0;border-bottom:1px solid var(--border)}
.drawer-thumb{display:block;width:74px;height:74px;min-width:74px;max-width:74px;object-fit:contain;border-radius:16px;border:1px solid var(--border);background:#fff;padding:8px;box-sizing:border-box}
.drawer-item-main{min-width:0}
.drawer-item-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.drawer-item-title{font-size:17px;font-weight:800;line-height:1.12;margin:0 0 4px;word-break:break-word}
.drawer-item-desc{font-size:14px;line-height:1.2;word-break:break-word}
.drawer-item-price{font-size:18px;font-weight:800;white-space:nowrap;line-height:1.2}
.drawer-item-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:end;margin-top:12px}
.drawer-total-label{font-size:13px;color:var(--muted);margin-bottom:6px}
.drawer-total-value{font-size:18px;font-weight:800;line-height:1.2}
.drawer-actions{display:flex;align-items:flex-end;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.drawer-qty-input{width:96px !important;min-width:96px}
.drawer-footer{padding-top:16px;display:flex;flex-direction:column;gap:10px}
.drawer-footer-total{display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:22px;font-weight:800}
.drawer-footer-total span:last-child{white-space:nowrap}

/* Global responsive tweaks */
@media (max-width: 1180px){
  .page-columns{grid-template-columns:1fr !important}
  .summary-column{position:static !important}
}
@media (max-width: 980px){
  .container{padding:18px}
  .topbar,.toolbar{flex-direction:column;align-items:stretch}
  .nav-links{width:100%}
  .nav-links a,.nav-links .btn{flex:1 1 auto}
  .drawer{position:static;width:100%;max-height:none;margin-top:16px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
  .layout-admin{grid-template-columns:1fr}
  .sidebar{position:static;height:auto}
}
@media (max-width: 860px){
  .client-order-page .quote-line,
  .client-order-page .quote-line-sub,
  .client-order-page .js-new-line{padding:18px !important}
  .client-order-page .quote-line-head{flex-direction:column;align-items:flex-start}
  .client-order-page .quote-status{margin-left:0}
  .client-order-page .quote-line-body{grid-template-columns:1fr;gap:14px}
  .client-order-page .line-disabled .quote-line-body{grid-template-columns:1fr}
  .client-order-page .quote-remove-block{justify-self:start}
  .client-order-page .quote-line-sub{margin-left:0}
  .client-order-page .summary-total{font-size:22px;flex-direction:column;align-items:flex-start}
  .drawer-item-bottom{grid-template-columns:1fr}
  .drawer-actions{justify-content:flex-start}
}
@media (max-width: 640px){
  .container{padding:14px}
  .brand{font-size:18px}
  .btn,.nav-links a{padding:11px 14px}
  .field,.select,.textarea{padding:11px 12px}
  .client-order-page .quote-main{gap:12px}
  .client-order-page .quote-thumb,
  .client-order-page .quote-thumb-sm{width:72px !important;height:72px !important;min-width:72px;max-width:72px;min-height:72px;max-height:72px;border-radius:14px}
  .client-order-page .quote-meta strong{font-size:16px}
  .client-order-page .quote-meta .muted{font-size:14px}
  .client-order-page .quote-qty-actions{gap:10px}
  .client-order-page .quote-qty-input{width:100px !important;min-width:100px}
  .drawer .drawer-head{padding:16px 18px}
  .drawer .drawer-body{padding:0 12px 12px}
  .drawer-item{grid-template-columns:64px minmax(0,1fr);gap:12px;padding:14px 0}
  .drawer-thumb{width:64px;height:64px;min-width:64px;max-width:64px}
  .drawer-item-title{font-size:16px}
  .drawer-item-price,.drawer-total-value{font-size:17px}
  .drawer-footer-total{font-size:20px}
}



/* Admin order edit */
.admin-order-page .summary-column{position:sticky;top:24px}
.admin-order-page .summary-card{padding:22px;border-radius:22px}
.admin-order-page .quote-line{padding:24px !important}
.admin-order-page .quote-line-sub{padding:20px !important;margin-left:24px;background:#f8fbff}
.admin-order-page .quote-line-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.admin-order-page .quote-main{display:flex;align-items:flex-start;gap:18px;min-width:0;flex:1 1 auto}
.admin-order-page .quote-thumb,.admin-order-page .quote-thumb-sm{display:block;flex:0 0 auto;width:88px;height:88px;object-fit:contain;border:1px solid var(--border);border-radius:18px;background:#fff;padding:8px;box-sizing:border-box}
.admin-order-page .quote-thumb-sm{width:78px;height:78px}
.admin-order-page .quote-meta{min-width:0;flex:1 1 auto}
.admin-order-page .quote-meta strong{display:block;font-size:18px;line-height:1.15;margin:6px 0 6px;word-break:break-word}
.admin-order-page .quote-meta .muted{font-size:15px;line-height:1.25;word-break:break-word}
.admin-order-page .quote-line-body{display:grid;grid-template-columns:minmax(220px,1.1fr) minmax(160px,.6fr) minmax(170px,.65fr) auto;gap:18px;align-items:end}
.admin-order-page .admin-order-meta-row{grid-template-columns:minmax(180px,.9fr) minmax(170px,.8fr) minmax(240px,1.2fr) auto}
.admin-order-page .quote-field-label{font-size:14px;color:var(--muted);margin-bottom:8px}
.admin-order-page .quote-qty-input{width:116px !important;min-width:116px}
.admin-order-page .quote-remove-block{justify-self:end}
.admin-order-page .line-disabled .quote-line-body{opacity:.9}
.admin-order-page .admin-add-card{padding:22px}
@media (max-width: 980px){
  .admin-order-page .page-columns{grid-template-columns:1fr !important}
  .admin-order-page .summary-column{position:static !important}
  .admin-order-page .quote-line-body,
  .admin-order-page .admin-order-meta-row{grid-template-columns:1fr;gap:14px}
  .admin-order-page .quote-remove-block{justify-self:start}
  .admin-order-page .quote-line-sub{margin-left:0}
}


/* Admin order editor refinements */
.admin-order-page .content{padding:28px 32px 36px}
.admin-order-page .admin-order-columns{grid-template-columns:minmax(0,1fr) 360px;gap:28px}
.admin-order-page .admin-order-main{min-width:0}
.admin-order-page .admin-order-toolbar{margin-bottom:22px}
.admin-order-page .admin-order-toolbar-actions{gap:10px;flex-wrap:wrap;justify-content:flex-end}
.admin-order-page .summary-column{top:28px}
.admin-order-page .summary-card{padding:24px;border-radius:24px}
.admin-order-page .quote-line{padding:24px 24px 22px !important;border-radius:22px}
.admin-order-page .quote-line-sub{padding:20px 22px !important;margin-left:28px;background:#f8fbff;border-radius:22px}
.admin-order-page .quote-line-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.admin-order-page .quote-main{display:flex;align-items:flex-start;gap:18px;min-width:0;flex:1 1 auto}
.admin-order-page .quote-thumb,.admin-order-page .quote-thumb-sm{display:block;flex:0 0 auto;width:88px;height:88px;object-fit:contain;border:1px solid var(--border);border-radius:18px;background:#fff;padding:8px;box-sizing:border-box}
.admin-order-page .quote-thumb-sm{width:78px;height:78px}
.admin-order-page .quote-meta{min-width:0;flex:1 1 auto}
.admin-order-page .quote-meta strong{display:block;font-size:18px;line-height:1.15;margin:6px 0 6px;word-break:break-word}
.admin-order-page .quote-meta .muted{font-size:15px;line-height:1.25;word-break:break-word}
.admin-order-page .admin-line-core-grid{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(150px,.65fr) minmax(170px,.7fr) minmax(160px,.65fr);gap:18px;align-items:end}
.admin-order-page .admin-order-meta-row{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:18px;align-items:end;margin-top:16px}
.admin-order-page .admin-sub-line-grid{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(170px,.7fr) minmax(160px,.65fr) auto;gap:18px;align-items:end}
.admin-order-page .quote-field-label{font-size:14px;color:var(--muted);margin-bottom:8px}
.admin-order-page .quote-qty-input{width:116px !important;min-width:116px}
.admin-order-page .quote-remove-block{justify-self:end}
.admin-order-page .line-disabled .quote-line-body{opacity:.9}
.admin-order-page .admin-add-card{padding:24px;border-radius:24px}
.admin-order-page .admin-add-card-title{font-size:20px;margin-bottom:8px}
.admin-order-page .admin-new-line-grid{display:grid;grid-template-columns:160px auto;gap:16px;align-items:end;margin-top:18px}
.admin-order-page .admin-picker-actions{display:flex;justify-content:flex-start}
.admin-order-page .admin-picker-block{margin-top:18px;padding-top:18px;border-top:1px solid var(--border)}
.admin-order-page .admin-picker-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-end;margin-bottom:12px}
.admin-order-page .admin-picker-summary{margin-top:12px;padding:11px 13px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;font-size:14px;line-height:1.35}
.admin-order-page .admin-product-picker{margin-top:14px;padding:14px;border:1px solid var(--border);border-radius:18px;background:#fff}
.admin-order-page .admin-product-picker-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:14px}
.admin-order-page .admin-product-picker-toolbar .field{flex:1 1 auto}
.admin-order-page .admin-product-table-wrap{max-height:320px;overflow:auto;border:1px solid var(--border);border-radius:16px}
.admin-order-page .admin-product-table-compact{margin:0}
.admin-order-page .admin-product-table-compact th,.admin-order-page .admin-product-table-compact td{padding:12px 14px;vertical-align:middle}
.admin-order-page .admin-product-table-compact td:last-child{text-align:right}
.admin-order-page .admin-product-table-compact .btn{white-space:nowrap}
@media (max-width: 1280px){
  .admin-order-page .content{padding:24px}
  .admin-order-page .admin-order-columns{grid-template-columns:minmax(0,1fr) 330px;gap:22px}
}
@media (max-width: 1100px){
  .admin-order-page .admin-order-columns{grid-template-columns:1fr}
  .admin-order-page .summary-column{position:static !important}
  .admin-order-page .admin-line-core-grid,
  .admin-order-page .admin-order-meta-row,
  .admin-order-page .admin-sub-line-grid,
  .admin-order-page .admin-new-line-grid{grid-template-columns:1fr}
  .admin-order-page .quote-remove-block{justify-self:start}
}
@media (max-width: 860px){
  .admin-order-page .content{padding:18px}
  .admin-order-page .quote-line,
  .admin-order-page .quote-line-sub{padding:18px !important}
  .admin-order-page .quote-line-sub{margin-left:0}
  .admin-order-page .admin-picker-head,
  .admin-order-page .admin-product-picker-toolbar{flex-direction:column;align-items:stretch}
}


/* Admin order edit compact layout */
.admin-order-page .content{padding:24px 28px 34px}
.admin-order-page .admin-order-columns{grid-template-columns:minmax(0,1fr) 340px;gap:24px;align-items:start}
.admin-order-page .admin-order-main .space-y{gap:16px}
.admin-order-page .admin-order-toolbar{margin-bottom:18px}
.admin-order-page .admin-order-toolbar .brand{font-size:28px;line-height:1.1}
.admin-order-page .summary-column{top:24px}
.admin-order-page .summary-card{padding:22px;border-radius:22px}
.admin-order-page .quote-line{padding:18px 18px 16px !important;border-radius:22px}
.admin-order-page .quote-line-sub{padding:16px 18px !important;margin-left:24px}
.admin-order-page .quote-line-head{margin-bottom:12px;gap:12px}
.admin-order-page .quote-main{gap:14px;align-items:flex-start}
.admin-order-page .quote-thumb{width:78px;height:78px;border-radius:16px;padding:6px}
.admin-order-page .quote-thumb-sm{width:68px;height:68px;border-radius:14px;padding:6px}
.admin-order-page .quote-meta strong{font-size:18px;margin:2px 0 4px}
.admin-order-page .quote-meta .muted{font-size:14px;line-height:1.2}
.admin-order-page .quote-status .badge{font-size:13px;padding:10px 14px;border-radius:999px}
.admin-order-page .admin-line-core-grid{grid-template-columns:170px 150px 170px 170px auto;gap:16px;align-items:end}
.admin-order-page .admin-order-meta-row{grid-template-columns:minmax(0,1fr);gap:20px;align-items:start;margin-top:14px}
.admin-order-page .admin-sub-line-grid{grid-template-columns:170px 170px 170px auto;gap:16px}
.admin-order-page .quote-field-label{font-size:13px;margin-bottom:6px}
.admin-order-page .quote-qty-input{width:96px !important;min-width:96px;height:52px}
.admin-order-page .js-admin-price,.admin-order-page .select,.admin-order-page .admin-new-line-grid .field,.admin-order-page .admin-product-picker-toolbar .field{height:52px}
.admin-order-page .row-price-block .unit-price,.admin-order-page .product-total-value{font-size:21px;line-height:1.1}
.admin-order-page .product-total-value{font-weight:800}
.admin-order-page .quote-remove-block-top{align-self:center;justify-self:end}
.admin-order-page .quote-remove-block-top .btn{min-width:108px;height:56px;padding-inline:20px;border-radius:18px}
.admin-order-page .admin-picker-block-inline{width:100%;border:1px solid var(--border);border-radius:18px;background:#fafcff;padding:14px 16px}
.admin-order-page .admin-picker-head-inline{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:10px}
.admin-order-page .admin-picker-head-inline .quote-field-label{margin-bottom:4px}
.admin-order-page .admin-picker-head-inline .small{line-height:1.2}
.admin-order-page .admin-picker-summary{min-height:24px;font-size:15px;display:flex;align-items:center}
.admin-order-page .admin-product-picker{margin-top:12px;border-top:1px solid var(--border);padding-top:12px}
.admin-order-page .admin-product-picker-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;margin-bottom:12px}
.admin-order-page .admin-product-table-wrap{max-height:310px;overflow:auto;border:1px solid var(--border);border-radius:16px;background:#fff}
.admin-order-page .admin-product-table-compact th,.admin-order-page .admin-product-table-compact td{padding:10px 12px;vertical-align:middle}
.admin-order-page .admin-product-table-compact td:last-child,.admin-order-page .admin-product-table-compact th:last-child{text-align:right}
.admin-order-page .admin-add-card{padding:20px;border-radius:22px}
.admin-order-page .admin-add-card-title{font-size:22px;margin-bottom:4px}
.admin-order-page .admin-new-line-grid{display:grid;grid-template-columns:160px auto;gap:16px;align-items:end;margin-top:14px}
.admin-order-page .admin-picker-actions{display:flex;justify-content:flex-start}
@media (max-width: 1200px){
  .admin-order-page .admin-order-columns{grid-template-columns:minmax(0,1fr) 320px}
  .admin-order-page .admin-line-core-grid{grid-template-columns:150px 140px 160px 160px auto}
}
@media (max-width: 980px){
  .admin-order-page .content{padding:18px 16px 28px}
  .admin-order-page .admin-order-columns{grid-template-columns:1fr;gap:18px}
  .admin-order-page .summary-column{position:static}
  .admin-order-page .admin-line-core-grid,
  .admin-order-page .admin-order-meta-row,
  .admin-order-page .admin-sub-line-grid,
  .admin-order-page .admin-new-line-grid,
  .admin-order-page .admin-product-picker-toolbar{grid-template-columns:1fr}
  .admin-order-page .quote-remove-block-top,
  .admin-order-page .quote-remove-block{justify-self:start}
  .admin-order-page .admin-picker-head-inline{flex-direction:column;align-items:flex-start}
  .admin-order-page .quote-line-sub{margin-left:0}
}


.admin-order-page .quote-status .js-admin-stock-toggle{border:0;cursor:pointer;font-weight:800;font-size:14px;letter-spacing:.01em;padding:11px 16px;border-radius:999px;box-shadow:none;min-width:122px;text-align:center}
.admin-order-page .quote-status .js-admin-stock-toggle:disabled{cursor:default;opacity:1}
@media (max-width: 900px){
  .admin-order-page .quote-status .js-admin-stock-toggle{min-width:0;width:auto}
}


/* Admin order edit: keep substitute picker usable even when base line is SIN STOCK */
.admin-order-page .line-disabled{opacity:1;background:#f2f4f7;border-color:#d0d5dd}
.admin-order-page .line-disabled .field,
.admin-order-page .line-disabled .btn{pointer-events:auto}
.admin-order-page .line-disabled .quote-qty-actions{display:flex}
.admin-order-page .line-disabled .quote-remove-block{display:flex}
.admin-order-page .line-disabled .quote-thumb{filter:grayscale(18%);opacity:.9}

/* Admin order edit: align money blocks */
.admin-order-page .row-price-block,
.admin-order-page .row-total-block{display:flex;flex-direction:column;justify-content:flex-end;height:100%}
.admin-order-page .admin-money-value,
.admin-order-page .admin-money-input,
.admin-order-page .product-total-value{display:flex;align-items:center;height:52px;font-size:21px;line-height:1.1;font-weight:400;white-space:nowrap}
.admin-order-page .admin-money-input{padding:0 12px;text-align:left;font-variant-numeric:tabular-nums}
.admin-order-page .admin-quoted-price-input{width:108px;min-width:108px}
.admin-order-page .admin-money-value,
.admin-order-page .product-total-value{font-variant-numeric:tabular-nums}
.admin-order-page .admin-money-strong,
.admin-order-page .product-total-value{font-weight:800}

.admin-order-page .admin-picker-block.is-hidden{display:none !important}
.admin-order-page .field.is-readonly{background:#eef2f7;color:#475467;cursor:not-allowed}
.admin-order-page .line-disabled .js-admin-qty,.admin-order-page .line-disabled .js-admin-price{-webkit-text-fill-color:currentColor;opacity:1}
