/* X-Wireless Dealer Portal */
body.dealer-auth, body.dealer-shop { background: #eef1f6; }
.d-top { background: radial-gradient(800px 300px at 90% -40%, rgba(64,120,255,.5), transparent 60%), linear-gradient(160deg, #071737, #0d2a66); color: #fff; position: sticky; top: 0; z-index: 40; }
.d-top-row { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.d-top img { height: 40px; width: auto; display: block; }
.d-pill { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 4px 12px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--silver-light); }
.d-back { margin-left: auto; color: #dfe6f3; text-decoration: none; font-weight: 600; font-size: .92rem; }
.d-back:hover { color: #fff; text-decoration: underline; }
.d-search { flex: 1; min-width: 200px; max-width: 460px; font: inherit; font-size: 15px; padding: 10px 16px; border-radius: 999px; border: 0; }
.d-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: .92rem; }
.d-link { background: none; border: 0; color: #cfd8ea; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.d-link:hover { color: #fff; text-decoration: underline; }

/* login / apply */
.d-auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 48px; padding-bottom: 60px; align-items: start; }
.d-pitch h1 { color: var(--navy); }
.d-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.d-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-soft); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.d-tabs button { border: 0; background: none; font: inherit; font-weight: 700; padding: 10px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.d-tabs button.is-on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(11,31,75,.1); }
.d-msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fdecee; color: #a3121f; font-weight: 600; font-size: .92rem; }
.d-msg.ok { background: #e3f6eb; color: #0c7a3c; }
@media (max-width: 860px) { .d-auth-wrap { grid-template-columns: 1fr; padding-top: 24px; gap: 20px; } .d-back { margin-left: 0; } }

/* shop */
.d-main { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding-top: 24px; padding-bottom: 80px; align-items: start; }
.d-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--navy); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.d-tag { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; background: var(--navy); color: #fff; border-radius: 6px; padding: 4px 8px; }
.d-list { display: flex; flex-direction: column; gap: 8px; }
.d-row { display: grid; grid-template-columns: 56px 1fr auto auto auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 8px 8px; }
.d-row img { width: 56px; height: auto; border-radius: 6px; }
.d-row.out { opacity: .65; }
.d-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d-name b { font-size: .95rem; }
.d-incart { font-size: .78rem; font-weight: 700; color: var(--blue); }
.d-price { font-size: 1.25rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.d-call { font-size: .85rem; grid-column: span 2; }
.d-cart { position: sticky; top: 90px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.d-cart h2 { font-size: 1.2rem; margin-bottom: 10px; color: var(--navy); }
.d-lines { max-height: 38vh; overflow: auto; margin-bottom: 8px; }
.d-line { display: grid; grid-template-columns: 1fr auto auto 28px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.d-lname span { display: block; color: var(--muted); font-size: .8rem; }
.d-lt { font-variant-numeric: tabular-nums; }
.d-line .cart-remove { width: 26px; height: 26px; font-size: 1rem; }
.qty.sm { height: 32px; }
.qty.sm .qty-btn { width: 26px; }
.qty.sm .qty-in { width: 40px; font-size: 14px; }
.d-cartbar { display: none; }
.d-orders { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.d-order { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.d-order .num { text-align: right; white-space: nowrap; }
@media (max-width: 980px) {
  .d-main { grid-template-columns: 1fr; }
  .d-cart { position: static; }
  .d-cartbar.has { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; background: var(--blue); color: #fff; text-align: center; padding: 14px; border-radius: 14px; text-decoration: none; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  .d-search { order: 5; max-width: none; flex-basis: 100%; }
  .d-user { margin-left: auto; font-size: .85rem; gap: 10px; }
}
@media (max-width: 600px) {
  .d-row { grid-template-columns: 48px 1fr auto; }
  .d-row .qty { grid-column: 2; justify-self: start; }
  .d-row [data-add] { grid-column: 3; }
  .d-user #d-biz { display: none; }
}
/* shared bits also used by admin */
.empty-note { background: #fff; border: 1px dashed #cfd6e2; border-radius: 14px; padding: 30px; text-align: center; color: var(--muted); }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--ink); }
.badge.paid { background: #e3f6eb; color: #0c7a3c; }
.badge.pickup { background: #fff3db; color: #8a5a00; }
.modal { position: fixed; inset: 0; background: rgba(6,20,51,.55); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 980px) { body.dealer-shop .toast { bottom: 84px; } }

.req { color: #c62828; font-weight: 700; }
