:root {
  --admin-primary: #25785d;
  --admin-primary-dark: #1b5a45;
}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;color:#10201a;background:#f6f8f4}
.submit-overlay{display:none;position:fixed;inset:0;z-index:100;background:rgba(246,248,244,.78);align-items:center;justify-content:center;padding:20px}
.submit-overlay.show{display:flex}
.submit-overlay div{background:#fff;border:1px solid #dfe7e2;border-radius:8px;box-shadow:0 18px 45px rgba(20,40,32,.18);padding:18px 22px;display:grid;gap:6px;text-align:center;color:#10201a}
.submit-overlay strong{font-size:20px}
.submit-overlay span{color:#52655d}
body.is-submitting{cursor:wait}
/* Old admin layout removed */
/* Old auth CSS removed */
/* Old aside nav removed */
.ghost,.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #dfe7e2;border-radius:8px;padding:10px 12px;text-decoration:none;color:#073f31;background:#fff;font-weight:700}
.btn{background:#28735a;color:#fff;border-color:#28735a;cursor:pointer}
.ghost{cursor:pointer}
.pwa-install{margin-top:14px;border:1px solid #dfe7e2;border-radius:8px;background:#f6f8f4;padding:10px;display:grid;gap:8px}
.pwa-install-button{width:100%;background:#eef6f1}
.pwa-install.ready .pwa-install-button{background:#28735a;color:#fff;border-color:#28735a}
.pwa-install-info{display:none;color:#52655d;font-size:12px;line-height:1.35}
.pwa-install-info.show{display:block}
.danger-button{color:#9b2d26;border-color:#f2c7c2;background:#fff7f6}
/* old main padding removed */
.box,.row,.card{background:#fff;border:1px solid #dfe7e2;border-radius:8px;box-shadow:0 14px 35px rgba(20,40,32,.07);padding:16px;margin-bottom:14px}
.toolbar{display:grid;grid-template-columns:minmax(180px,1fr)180px 150px;gap:10px;margin-bottom:14px}
.order-toolbar{grid-template-columns:minmax(180px,1fr)210px 150px 110px}
input,select,textarea{width:100%;border:1px solid #dfe7e2;border-radius:8px;padding:11px;font:inherit}
.filter-field{position:relative;display:block}
.filter-field span{position:absolute;top:-9px;left:10px;background:#fff;color:#52655d;font-size:11px;padding:0 5px;z-index:1}
.filter-field select{padding-top:13px;font-weight:700;color:#073f31}
.products{display:grid;gap:10px}
.product,.order-item{display:grid;grid-template-columns:74px minmax(0,1fr)100px 130px;gap:12px;align-items:center;border:1px solid #dfe7e2;border-radius:8px;padding:10px;background:#fff}
.product img,.order-item img{width:74px;height:74px;object-fit:cover;border-radius:8px;border:1px solid #dfe7e2}
.preview-thumb{cursor:zoom-in}
.image-preview{display:none;position:fixed;inset:0;z-index:9999;background:rgba(16,32,26,.35);align-items:center;justify-content:center;padding:24px}
.image-preview.show{display:flex}
.image-preview img{max-width:min(720px,90vw);max-height:86vh;object-fit:contain;background:#fff;border-radius:8px;border:1px solid #dfe7e2;box-shadow:0 24px 60px rgba(0,0,0,.25);padding:8px}
.meta{color:#52655d;font-size:13px;line-height:1.4}
.price{font-weight:800;color:#063d30;text-align:right}
.price-stack{display:grid;gap:3px}
.price-stack span{font-size:12px;color:#52655d;font-weight:700}
.price-stack strong{color:#063d30}
.min-warning,.special-price-note{color:#885b18}
.closed-sale{font-weight:800;color:#9b2d26;background:#fff7f6;border:1px solid #f2c7c2;border-radius:8px;padding:10px;text-align:center}
.paint-select{grid-column:4;grid-row:2;padding:9px;font-size:13px;align-self:start}
.paint-default-note{display:none}
.paint-badge{display:inline-flex;margin-top:7px;border-radius:6px;padding:8px 14px;font-size:14px;font-weight:900;color:#fff;text-transform:uppercase;letter-spacing:.02em}
.paint-yes{background:#1f7a4f}
.paint-no{background:#b42318}
.paint-admin-widget{display:flex;align-items:center;gap:12px;background:linear-gradient(135deg,#f0f7f3,#e8f2ec);border:1px solid #c5ddd0;border-radius:10px;padding:10px 14px}
.paint-admin-icon{font-size:18px;flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:8px;border:1px solid #c5ddd0}
.paint-admin-fields{display:flex;gap:10px;flex:1;min-width:0}
.paint-admin-field{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.paint-admin-field-label{font-size:11px;font-weight:700;color:#3a6b55;text-transform:uppercase;letter-spacing:.03em}
.paint-admin-field select{padding:7px 10px;border-radius:8px;border:1px solid #c5ddd0;background:#fff;font-size:13px;font-weight:600;color:#10201a;width:100%}
.paint-toggle-group{display:flex;border-radius:10px;overflow:hidden;border:2px solid #d7e2dc;align-self:start;grid-column:4;grid-row:2}
.paint-toggle-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;padding:10px 14px;border:none;background:#f6f8f4;cursor:pointer;font-size:13px;font-weight:700;color:#708078;transition:all .2s ease;white-space:nowrap;line-height:1}
.paint-toggle-btn:not(:last-child){border-right:2px solid #d7e2dc}
.paint-toggle-btn:hover{background:#eaf3ec;color:#3a6b55}
.paint-toggle-btn.active.paint-toggle-yok{background:linear-gradient(135deg,#d4380d,#b42318);color:#fff;border-color:transparent}
.paint-toggle-btn.active.paint-toggle-var{background:linear-gradient(135deg,#22925c,#1f7a4f);color:#fff;border-color:transparent}
.paint-toggle-dot{width:8px;height:8px;border-radius:50%;border:2px solid currentColor;display:inline-block;transition:all .2s ease}
.paint-toggle-btn.active .paint-toggle-dot{background:currentColor}
@media(max-width:480px){.paint-admin-fields{flex-direction:column}.paint-admin-widget{padding:8px 10px;gap:8px}}
.product-name-edit{display:flex;flex-direction:column;gap:4px;min-width:0}
.product-name-input{font-weight:700;font-size:14px;padding:6px 8px;border:1px solid transparent;border-radius:6px;background:transparent;transition:all .15s ease}
.product-name-input:hover,.product-name-input:focus{border-color:#c5ddd0;background:#fff}
.product-name-sub{display:flex;gap:6px;align-items:center}
.product-sku-input{font-size:12px;color:#52655d;padding:4px 8px;border:1px solid transparent;border-radius:6px;background:transparent;flex:0 0 100px;transition:all .15s ease}
.product-sku-input:hover,.product-sku-input:focus{border-color:#c5ddd0;background:#fff}
.product-cat-select{font-size:12px;color:#3a6b55;font-weight:600;padding:4px 8px;border:1px solid #e0ebe5;border-radius:6px;background:#f0f7f3;flex:1;min-width:0;cursor:pointer;transition:all .15s ease}
.product-cat-select:hover,.product-cat-select:focus{border-color:#28735a;background:#fff}
/* ===== adminHMD Compact Table Styles ===== */
.pc-bar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #fff; border: 1px solid #d7e2dc; border-radius: 8px; box-shadow: 0 10px 24px rgba(20,40,32,.06); margin-bottom: 16px; position: sticky; top: 88px; z-index: 80; }
.pc-count { font-size: 13px; color: #708078; font-weight: 600; background: #f8faf9; padding: 4px 12px; border-radius: 8px; margin-left: auto; border: 1px solid #d7e2dc; }
.pc-thead { display: grid; grid-template-columns: 32px 42px 2fr 1fr 1.5fr 100px 80px 80px 80px 100px; gap: 12px; padding: 0 20px 12px; color: #708078; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; align-items: center; }
.pc-row { display: flex; flex-direction: column; background: #fff; border: 1px solid #d7e2dc; border-radius: 8px; margin-bottom: 8px; transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; box-shadow: 0 2px 4px rgba(20,40,32,.02); }
.pc-row:hover { background: #f8faf9; border-color: #b8d0c2; box-shadow: 0 8px 18px rgba(20,40,32,.05); }
.pc-main { display: grid; grid-template-columns: 32px 42px 2fr 1fr 1.5fr 100px 80px 80px 80px 100px; gap: 12px; padding: 12px 20px; align-items: center; }
.pc-chk { display: flex; align-items: center; justify-content: center; }
.pc-chk input[type="checkbox"] { width: 18px; height: 18px; accent-color: #28735a; cursor: pointer; border-radius: 4px; }
.pc-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid #d7e2dc; cursor: zoom-in; }
.pc-inp, .pc-sel, .pc-sm { width: 100%; padding: 7px 10px; border: 1px solid #d7e2dc; border-radius: 8px; font-size: 13px; font-weight: 600; color: #10201a; background: #fff; transition: all 0.16s ease; }
.pc-inp:focus, .pc-sel:focus, .pc-sm:focus { border-color: #28735a; box-shadow: 0 0 0 3px rgba(40,115,90,.12); outline: none; }
.pc-name { font-weight: 700; font-size: 14px; }
.pc-num { text-align: right; }
.pc-st { font-size: 12px; font-weight: 700; padding: 6px 10px; cursor: pointer; }
.st-on { background: #e7f6f3; color: #0f766e; border-color: #b8e0c9; }
.st-off { background: #ffecec; color: #dc2626; border-color: #f2c7c2; }
.pc-sub { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: #fdfdfd; border-top: 1px solid #eef3ef; border-radius: 0 0 8px 8px; font-size: 12px; }
.pc-g { display: flex; align-items: center; gap: 8px; color: #708078; }
.pc-sm { padding: 5px 8px; font-size: 12px; background: #fafcfb; }
.pc-file { font-size: 11px; }
.pc-file::file-selector-button { background: #eef6f1; color: #28735a; border: 1px solid #d7e2dc; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; margin-right: 8px; transition: all 0.15s ease; }
.pc-file::file-selector-button:hover { background: #28735a; color: #fff; }

@media (max-width: 1200px) {
  .pc-thead { display: none; }
  .pc-main { grid-template-columns: 32px 42px 1fr 1fr; grid-template-areas: "chk img name name" "chk img sku cat" "chk img p1 p2" "chk img p3 st"; }
  .pc-chk { grid-area: chk; } .pc-thumb { grid-area: img; }
  .pc-name { grid-area: name; } .pc-sku { grid-area: sku; } .pc-sel[name$="[category_id]"] { grid-area: cat; }
  .pc-num[name$="[dealer_price]"] { grid-area: p1; } .pc-num[name$="[stock]"] { grid-area: p2; }
  .pc-num[name$="[min_qty]"] { grid-area: p3; } .pc-st { grid-area: st; }
  .pc-num[name$="[max_qty]"] { display: none; }
  .pc-sub { flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 768px) {
  .pc-main { grid-template-columns: 32px 1fr; grid-template-areas: "chk img" "chk name" "chk sku" "chk cat" "chk p1" "chk p2" "chk p3" "chk st"; }
  .pc-thumb { width: 100%; height: auto; aspect-ratio: 1; max-width: 120px; }
}
input:disabled{background:#eef3ef;color:#7b8c84}
.qty{display:grid;grid-template-columns:38px 1fr 38px;gap:6px}
.qty button{border:1px solid #dfe7e2;border-radius:8px;background:#f6f8f4;font-weight:800}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.admin-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.status{display:inline-flex;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:800;background:#eaf3ec;color:#174a3a}
.status.warn{background:#fff0d7;color:#885b18}
.status.danger{background:#fbe7e4;color:#a33a31}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.table{width:100%;border-collapse:collapse;background:#fff}
.table th,.table td{border:1px solid #dfe7e2;padding:9px;text-align:left;vertical-align:middle}
.table img{width:58px;height:58px;object-fit:cover;border-radius:6px}
.summary{position:sticky;top:88px;padding:14px;align-self:start;z-index:40;max-height:calc(100vh - 100px);overflow-y:auto;}
.summary h2{margin-top:0}
.order-layout{grid-template-columns:minmax(0,1fr) 300px}
.cart-layout{grid-template-columns:minmax(0,1fr) 300px}
.cart-items{display:grid;gap:10px}
.cart-item{grid-template-columns:74px minmax(0,1fr)120px 130px 70px}
.cart-item img,.cart-thumb{width:74px!important;height:74px!important;max-width:74px!important;max-height:74px!important;object-fit:cover;border-radius:8px;border:1px solid #dfe7e2}
.cart-qty{min-width:0}
.empty-cart{box-shadow:none}
.cart-count{font-size:13px;color:#52655d;margin:-4px 0 10px}
.order-totals{display:grid;gap:8px;margin-bottom:14px}
.order-totals div,.order-detail-total div{display:grid;gap:4px;border:1px solid #dfe7e2;border-radius:8px;background:#f6f8f4;padding:10px}
.order-totals span,.order-detail-total span{color:#52655d}
.order-totals strong,.order-detail-total strong{color:#063d30;font-size:18px}
.order-mini-totals{display:grid;gap:4px;color:#52655d;font-size:13px}
.order-mini-totals strong{color:#10201a}
.bank-box{box-shadow:none;margin-top:10px}
.bank-warning{font-weight:700;color:#885b18}
.order-detail-total{display:grid;gap:8px}
.order-edit-item{display:grid;grid-template-columns:74px minmax(0,1fr)90px 110px 90px 70px 120px;gap:10px;align-items:center;border:1px solid #dfe7e2;border-radius:8px;padding:10px;background:#fff}
.order-edit-item img{width:74px;height:74px;object-fit:cover;border-radius:8px;border:1px solid #dfe7e2}
.order-edit-item label{font-size:13px}
.checkline{display:flex;gap:6px;align-items:center;font-weight:700}
.checkline input{width:auto}
.product-admin-row{display:grid;grid-template-columns:64px 58px minmax(0,1fr)105px 90px 80px 80px 90px;gap:8px;align-items:center}
.bulk-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;position:sticky;top:88px;z-index:80}
.product-check{justify-content:flex-start}
.products-admin-layout{display:grid;grid-template-columns:minmax(0,1fr)330px;gap:16px;align-items:start}
.products-admin-layout section{min-width:0}
.category-page-layout{display:grid;grid-template-columns:minmax(0,1fr)340px;gap:16px;align-items:start}
.category-panel{position:sticky;top:18px;height:auto;background:transparent;border:0;padding:0}
.category-panel .box{margin-bottom:0}
.category-add-form{display:grid;grid-template-columns:minmax(0,1fr)86px;gap:8px;margin-bottom:12px}
.category-bulk-form{display:grid;gap:8px}
.category-list{display:grid;gap:8px;max-height:calc(100vh - 190px);overflow:auto;padding-right:3px}
.category-row{display:grid;grid-template-columns:minmax(0,1fr)74px 58px;gap:6px;align-items:center;border:1px solid #dfe7e2;border-radius:8px;padding:8px;background:#fff}
.category-row-wide{grid-template-columns:minmax(0,1fr)82px 74px 58px}
.category-row input{padding:9px}
.category-row button{padding:9px 8px}
.product-filter-toolbar{grid-template-columns:minmax(180px,1fr)210px 150px 110px}
.order-search-toolbar{grid-template-columns:minmax(180px,1fr)210px 170px 110px}
.special-price-row{display:grid;grid-template-columns:58px minmax(0,1fr)130px 90px 70px;gap:8px;align-items:center}
.special-price-row img{width:58px;height:58px;object-fit:cover;border-radius:8px;border:1px solid #dfe7e2}
.dealer-row{display:grid;grid-template-columns:minmax(0,1fr)130px 330px 80px;gap:12px;align-items:center}
.total{display:flex;justify-content:space-between;border-top:1px solid #dfe7e2;margin-top:12px;padding-top:12px;font-weight:800;font-size:18px}
.mobile-ad-card{display:none}
@media(max-width:900px){
  .app{grid-template-columns:1fr}
  .logo{width:150px;margin-bottom:10px}
  main{padding:12px}
  h1{font-size:26px}
  .toolbar,.grid,.product,.order-item,.order-edit-item,.order-layout,.cart-layout,.product-admin-row,.dealer-row,.products-admin-layout,.category-page-layout,.category-row,.category-row-wide,.category-add-form,.category-bulk-form,.special-price-row,.admin-cards{grid-template-columns:1fr!important}
  .category-panel{position:static}
  .category-list{max-height:none}
  .toolbar{gap:8px}
  .summary{position:static}
  .price{text-align:left}
}
@media(max-width:640px){
  .auth-page{padding:10px}
  .auth-card{display:block;margin:0;padding:10px}
  .auth-brand{padding:18px}
  .auth-brand h1{font-size:30px}
  .auth-brand p{font-size:16px}
  .auth-forms{padding-top:14px}
  .grid{grid-template-columns:1fr}
  .product{grid-template-columns:64px minmax(0,1fr)!important;gap:8px}
  .product img{width:64px;height:64px}
  .product .price{grid-column:1/2}
  .product .qty-input{grid-column:2/3}
  .order-item{grid-template-columns:64px minmax(0,1fr)!important}
  .order-item img{width:64px;height:64px}
  .cart-item{grid-template-columns:58px minmax(0,1fr)!important}
  .cart-item img,.cart-thumb{width:58px!important;height:58px!important;max-width:58px!important;max-height:58px!important}
  .cart-item .cart-qty,.cart-item .price,.cart-item .cart-remove{grid-column:2/3}
  nav{grid-template-columns:1fr}
}

@media(max-width:900px){
  body.admin-body main{padding:14px}
  body.admin-body h1{font-size:28px;margin-bottom:14px}
  body.admin-body .logo{width:150px;margin:0 auto 12px;display:block}
  body.admin-body .admin-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.admin-body .toolbar,body.admin-body .bulk-actions{position:static}
  body.admin-body .product-admin-row{display:grid;grid-template-columns:52px 1fr!important;gap:10px}
  body.admin-body .product-admin-row img{grid-column:1;grid-row:1/3;width:52px;height:52px}
  body.admin-body .product-admin-row>label,body.admin-body .product-admin-row>div{min-width:0}
  body.admin-body .order-edit-item{grid-template-columns:58px minmax(0,1fr)!important}
  body.admin-body .order-edit-item img{width:58px;height:58px}
  body.admin-body .dealer-row{grid-template-columns:1fr!important}
}

@media(max-width:560px){
  body.admin-body main{padding:10px}
  body.admin-body .admin-cards{grid-template-columns:1fr!important}
  body.admin-body .box,body.admin-body .row,body.admin-body .card{padding:12px;border-radius:10px}
  body.admin-body .toolbar{grid-template-columns:1fr!important}
  body.admin-body .actions{display:grid;grid-template-columns:1fr 1fr}
  body.admin-body .actions .btn,body.admin-body .actions .ghost{width:100%}
  body.admin-body .table{display:block;overflow-x:auto}
}

@media(max-width:760px){
  .auth-page{padding:10px;background:#eef3ef}
  .auth-card{display:block;margin:0 auto;max-width:460px;padding:10px;border-radius:14px}
  .auth-brand{min-height:auto;padding:18px;border-radius:12px}
  .auth-brand img{display:block;width:210px;margin:0 auto 18px}
  .auth-brand h1{font-size:30px;line-height:1.15;margin:0 0 14px}
  .auth-brand p{font-size:16px;line-height:1.45;margin:0}
  .auth-forms{padding:14px 4px 4px}
  .auth-forms .grid{grid-template-columns:1fr!important;gap:8px}
  body.dealer-body{background:#eef3ef}
  .dealer-body .app{display:block;min-height:100vh}
  .dealer-body main{padding:14px 10px 98px}
  .dealer-body h1{font-size:26px;line-height:1.15;margin:8px 0 14px}
  /* dealer bottom nav removed */
  .dealer-body .mobile-ad-card{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:14px;border-radius:16px;background:linear-gradient(135deg,#28735a,#1f674f);color:#fff;text-decoration:none;box-shadow:0 16px 35px rgba(20,40,32,.16);overflow:hidden}
  .dealer-body .mobile-ad-card strong{display:block;font-size:19px;line-height:1.15;margin-bottom:5px}
  .dealer-body .mobile-ad-card span{display:block;font-size:13px;line-height:1.35;opacity:.94}
  .dealer-body .mobile-ad-card img{width:112px;height:78px;border-radius:12px;object-fit:cover;background:#fff;flex:0 0 auto}
  .dealer-body .order-toolbar{grid-template-columns:1fr 1fr!important;gap:8px;background:#fff;border:1px solid #dfe7e2;border-radius:12px;padding:10px;margin-bottom:10px;box-shadow:0 8px 22px rgba(20,40,32,.06)}
  .dealer-body .order-toolbar>input{grid-column:1/-1}
  .dealer-body .order-toolbar .ghost{grid-column:1/-1}
  .dealer-body .filter-field span{background:#fff}
  .dealer-body .order-layout,.dealer-body .cart-layout{display:flex;flex-direction:column;gap:10px}
  .dealer-body .order-layout .summary{position:fixed;bottom:0;left:0;right:0;z-index:100;margin:0;border-radius:24px 24px 0 0;box-shadow:0 -10px 30px rgba(20,40,32,.12);padding:15px;background:#fff}
  .dealer-body.qty-focus aside{transform:translateY(120%);pointer-events:none}
  .dealer-body.qty-focus .order-layout .summary{display:none !important}
  .dealer-body .order-layout{padding-bottom:140px}
  .dealer-body .summary h2{font-size:24px;margin:0 0 8px}
  .dealer-body .order-layout .summary h2{display:none}
  .dealer-body .order-layout .summary .cart-count{margin:0 0 7px;text-align:center}
  .dealer-body .summary .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .dealer-body .summary .actions .btn,.dealer-body .summary .actions .ghost{width:100%;padding:12px 8px}
  .dealer-body .order-totals{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .dealer-body .order-layout .order-totals{grid-template-columns:1fr 1fr;margin-bottom:8px}
  .dealer-body .order-layout .order-totals div:nth-child(3){display:none}
  .dealer-body .order-totals div{padding:9px;border-radius:10px}
  .dealer-body .order-totals strong{font-size:16px;white-space:nowrap}
  .dealer-body .products{gap:9px}
  .dealer-body .product{grid-template-columns:64px minmax(0,1fr)108px!important;gap:9px;align-items:center;border-radius:13px;padding:9px;box-shadow:0 7px 18px rgba(20,40,32,.05)}
  .dealer-body .product img{width:64px;height:64px;grid-column:1;grid-row:1/3;border-radius:10px}
  .dealer-body .product>div:nth-child(2){grid-column:2;grid-row:1/3;min-width:0}
  .dealer-body .product strong{display:block;font-size:14px;line-height:1.22}
  .dealer-body .product .meta{font-size:12px;line-height:1.25}
  .dealer-body .product .price{grid-column:3;grid-row:1;text-align:right;font-size:15px}
  .dealer-body .product .price-stack span{display:none}
  .dealer-body .product .qty-input{grid-column:3;grid-row:2;padding:10px 9px;text-align:center}
  .dealer-body .paint-select,.dealer-body .paint-default-note,.dealer-body .paint-toggle-group{grid-column:3;grid-row:3;text-align:center}
  .dealer-body .closed-sale{grid-column:3;grid-row:1/3;padding:9px;font-size:12px}
  .dealer-body .cart-item.product{grid-template-columns:64px minmax(0,1fr)96px!important}
  .dealer-body .cart-item.product img,.dealer-body .cart-thumb{width:64px!important;height:64px!important;max-width:64px!important;max-height:64px!important;grid-column:1;grid-row:1/3}
  .dealer-body .cart-item.product .price{grid-column:3;grid-row:1;text-align:right}
  .dealer-body .cart-item.product .cart-qty{grid-column:3;grid-row:2;padding:10px 9px}
  .dealer-body .cart-item.product .cart-remove{grid-column:1/-1}
  .dealer-body .bank-box{font-size:13px;line-height:1.35}
}

@media(max-width:760px){
  body.admin-body{background:#eef3ef}
  body.admin-body .app{display:block;min-height:100vh}
  body.admin-body main{padding:14px 10px 98px}
  body.admin-body h1{font-size:26px;line-height:1.15;margin:8px 0 14px}
  /* admin bottom nav removed */
  body.admin-body .admin-cards{display:grid;grid-template-columns:1fr 1fr!important;gap:10px}
  body.admin-body .admin-cards .card{min-height:104px;border-radius:14px;padding:14px}
  body.admin-body .admin-cards .card strong{font-size:16px}
  body.admin-body .toolbar,body.admin-body .bulk-actions{border-radius:14px;padding:10px;box-shadow:0 8px 22px rgba(20,40,32,.06)}
  body.admin-body .box,body.admin-body .row,body.admin-body .card{border-radius:14px}
  body.admin-body .product-admin-row,body.admin-body .order-edit-item,body.admin-body .dealer-row{border-radius:13px}
}

@media(max-width:430px){
  .dealer-body main{padding-left:8px;padding-right:8px}
  .dealer-body .order-totals{grid-template-columns:1fr}
  .dealer-body .order-layout .order-totals{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dealer-body .order-layout .order-totals div{padding:7px}
  .dealer-body .order-layout .order-totals strong{font-size:14px}
  .dealer-body .order-layout .summary{left:8px;right:8px}
  .dealer-body .mobile-ad-card img{width:92px;height:66px}
  .dealer-body .product,.dealer-body .cart-item.product{grid-template-columns:58px minmax(0,1fr)!important}
  .dealer-body .product img,.dealer-body .cart-item.product img,.dealer-body .cart-thumb{width:58px!important;height:58px!important;max-width:58px!important;max-height:58px!important}
  .dealer-body .product .price,.dealer-body .product .qty-input,.dealer-body .closed-sale,.dealer-body .paint-select,.dealer-body .paint-default-note,.dealer-body .paint-toggle-group,.dealer-body .cart-item.product .price,.dealer-body .cart-item.product .cart-qty{grid-column:2;grid-row:auto;text-align:left}
  .dealer-body .product>div:nth-child(2),.dealer-body .cart-item.product>div:nth-child(2){grid-column:2;grid-row:auto}
}
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.payment-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 16px;
  border: 2px solid #d7e2dc;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
}
.payment-card:hover {
  border-color: #28735a;
  background: #f8faf9;
}
.payment-card input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0 16px 0 0;
  accent-color: #28735a;
}
.payment-card input[type="radio"]:checked + .card-content .title {
  color: #28735a;
}
.payment-card input[type="radio"]:checked ~ * {
  /* For styling active card */
}

/* Modern Cart Styles */
.cart-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.cart-items-box {
  padding: 20px;
  margin-bottom: 20px;
}
.payment-box {
  padding: 20px;
}
.cart-item-modern {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #dfe7e2;
  gap: 16px;
}
.cart-item-modern:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.cart-item-modern img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #dfe7e2;
  flex-shrink: 0;
}
.cart-item-modern .item-info {
  flex-grow: 1;
  min-width: 0;
}
.cart-item-modern .item-info strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: #1b3829;
}
.cart-item-modern .item-price {
  text-align: right;
  min-width: 100px;
}
.cart-item-modern .item-price .price {
  font-weight: 700;
  font-size: 16px;
  color: #28735a;
}
.cart-item-modern .unit-price {
  font-size: 12px;
  color: #8fa097;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid #dfe7e2;
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
  background: #fff;
}
.stepper-btn {
  background: #f6f8f4;
  border: none;
  width: 32px;
  height: 100%;
  font-size: 18px;
  color: #28735a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.stepper-btn:hover {
  background: #e9ece6;
}
.stepper-input {
  width: 44px;
  height: 100%;
  border: none !important;
  text-align: center;
  font-weight: 600;
  color: #1b3829;
  padding: 0;
  background: transparent;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-remove {
  color: #c14949;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cart-remove:hover {
  background: #fdf2f2;
  color: #a03c3c;
}
.modern-summary {
  position: sticky;
  top: 88px;
  padding: 20px;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #52655d;
}
.summary-line strong {
  color: #1b3829;
}
.summary-divider {
  height: 1px;
  background: #dfe7e2;
  margin: 16px 0;
}
.summary-total {
  font-size: 18px;
  font-weight: 700;
  color: #1b3829;
  margin-bottom: 0;
}
.summary-total strong {
  color: #28735a;
}
.ghost-link {
  color: #52655d;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.ghost-link:hover {
  color: #1b3829;
}

@media (max-width: 900px) {
  .cart-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  .cart-layout .summary-wrapper {
    order: 2 !important; /* Force summary to bottom */
  }
  .cart-item-modern {
    flex-wrap: wrap;
    position: relative;
    padding-bottom: 20px;
  }
  .cart-item-modern .item-info {
    width: calc(100% - 90px);
  }
  .cart-item-modern .item-price {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
  }
  .cart-item-modern .stepper {
    position: absolute;
    bottom: 16px;
    right: 0;
  }
  .cart-item-modern .cart-remove {
    position: absolute;
    top: 16px;
    right: 0;
  }
}
.payment-card:has(input[type="radio"]:checked) {
  border-color: #28735a;
  background: #f0f7f3;
  box-shadow: 0 4px 12px rgba(40,115,90,0.1);
}
.payment-card .card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.payment-card .title {
  font-weight: 700;
  color: #10201a;
  font-size: 15px;
}
.payment-card .desc {
  font-size: 13px;
  color: #61736a;
}
/ *   M o d e r n   C a r t   S t y l e s   * /  
 
/* UI Pill Select & Stepper */
.blue-pill-select { appearance: none; background: #0056b3; color: #fff; border: none; border-radius: 20px; padding: 8px 10px; font-weight: 700; text-align: center; text-align-last: center; width: 100%; font-size: 14px; cursor: pointer; height: 36px; }
.panel-qty-stepper { display: flex; align-items: center; background: #0056b3; border-radius: 20px; padding: 2px 4px; width: 100%; height: 36px; box-sizing: border-box; }
.panel-qty-stepper .qty-input { flex: 1; background: transparent !important; border: none !important; color: #fff !important; text-align: center; font-weight: 700; font-size: 15px; width: 0; padding: 0; margin: 0; outline: none !important; }
.panel-qty-stepper .qty-input::placeholder { color: rgba(255,255,255,0.7); font-size: 13px; }
.panel-qty-stepper .panel-step-btn { background: transparent; border: none; color: #fff; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; cursor: pointer; padding: 0; }
.panel-qty-stepper.disabled { opacity: 0.5; pointer-events: none; }


@media(max-width: 640px) {
  .dealer-body .product .product-actions-wrapper { grid-column: 1 / -1 !important; margin-top: 5px; width: 100%; justify-content: center; }
  .dealer-body .product-actions-wrapper .blue-pill-select, .dealer-body .product-actions-wrapper .panel-qty-stepper { flex: 1; min-width: 130px; }
}
