/* ============================================================
   Dkay marketplace application layer
   ============================================================ */

/* --- alerts + pills --- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--paper-2); font-size: 12.5px; margin-bottom: 14px;
}
.alert-success { border-color: #bfe0c9; background: #eef8f1; color: #14532d; }
.alert-error { border-color: #f0c4bd; background: #fdf1ef; color: var(--danger); }
.alert-info { border-color: var(--line); background: var(--peach-soft); color: var(--ink-2); }
.flash-stack { position: fixed; top: 88px; right: 20px; z-index: 1100; width: min(360px, calc(100vw - 32px)); }
.flash-stack .alert { box-shadow: var(--shadow); margin-bottom: 8px; }

.pill {
  display: inline-block; padding: 3px 8px; border-radius: 20px;
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: var(--line-soft); color: var(--ink-2); white-space: nowrap;
}
.pill-pending { background: #fff2d8; color: #8a5a00; }
.pill-confirmed, .pill-paid, .pill-active, .pill-delivered { background: #e5f4e9; color: #12613a; }
.pill-packed { background: #e7eefb; color: #234a91; }
.pill-shipped { background: #e3f0f4; color: #0b5a70; }
.pill-cancelled, .pill-suspended, .pill-blocked, .pill-archived { background: #f9e4e1; color: #a02a1d; }
.pill-requested, .pill-draft, .pill-unpaid { background: var(--peach); color: var(--accent-deep); }
.pill-refunded { background: #eee7f8; color: #5b3a91; }

/* --- wishlist form in cards --- */
.wish-form { position: absolute; top: 8px; right: 8px; z-index: 3; }
.wish-form .wish { position: static; opacity: 0; transform: translateY(-4px); }
.p-card:hover .wish-form .wish, .wish-form .wish.on { opacity: 1; transform: none; }
button.wish { cursor: pointer; }

/* --- header account --- */
.acct { position: relative; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px; box-shadow: var(--shadow); display: none;
}
.acct.open .acct-menu { display: block; }
.acct-menu a, .acct-menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 9px 10px; border: 0; background: transparent; text-align: left;
  font-size: 12.5px; font-weight: 600; border-radius: 4px;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--paper); }
.acct-menu .who { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-menu .who b { display: block; font-size: 12.5px; }
.acct-menu .who span { font-size: 10.5px; color: var(--muted); }

/* --- auth --- */
.auth-wrap { display: grid; grid-template-columns: 1.05fr .95fr; min-height: calc(100vh - 74px); }
.auth-art {
  position: relative; overflow: hidden; background: var(--forest);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 5vw, 64px); color: #f4efe4;
}
.auth-art::before {
  content: ''; position: absolute; inset: 0; opacity: .28;
  background: url('../images/final/banner_fashion.jpg') center/cover no-repeat;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { font-family: Manrope; font-size: clamp(34px, 4.4vw, 62px); line-height: .92; letter-spacing: -.05em; margin-top: 26px; max-width: 12ch; }
.auth-art h1 em { color: var(--accent); font-style: normal; }
.auth-art p { margin-top: 18px; color: #d8d2c6; font-size: 13.5px; max-width: 42ch; }
.auth-art .auth-quote { border-top: 1px solid rgba(255,255,255,.2); padding-top: 18px; font-size: 12px; color: #cfc9bd; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(30px, 6vw, 80px) var(--gutter); }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { font-family: Manrope; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.05em; line-height: .95; }
.auth-card .lede { margin-top: 12px; color: var(--muted); font-size: 13px; }
.auth-card form { margin-top: 26px; display: flex; flex-direction: column; gap: 15px; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.auth-foot a { font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--ink); }
.demo-accounts {
  margin-top: 24px; border: 1px dashed var(--line); border-radius: 5px; padding: 12px 14px;
  font-size: 11px; color: var(--muted); line-height: 1.7; background: var(--paper-2);
}

/* --- account + dashboard shells --- */
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: clamp(24px, 3.4vw, 52px); padding: 28px 0 80px; align-items: start; }
.side { position: sticky; top: 24px; border: 1px solid #d8d4cb; border-radius: 4px; background: #fdfcf8; overflow: hidden; box-shadow: 0 8px 24px rgba(35,31,24,.035); }
.side-head { padding: 16px; border-bottom: 1px solid #e3e0d8; display: flex; gap: 10px; align-items: center; }
.side-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #17130f; color: #fdfcf8; font-family: Manrope; font-size: 12px; flex: none; }
.side-head b { display: block; font-size: 12.5px; line-height: 1.2; color: #17130f; }
.side-head span { font-size: 10px; color: #8f8a81; }
.side-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 36px; padding: 9px 10px; border-radius: 3px; border: 0; background: transparent;
  font-size: 12px; font-weight: 600; color: #4f4a43; text-align: left; width: 100%;
}
.side-nav a:hover, .side-nav button:hover { background: #f2efe8; color: #17130f; }
.side-nav a.on { background: #17130f; color: #fdfcf8; font-weight: 700; }
.side-nav .count { font-size: 9.5px; font-weight: 800; background: #f27628; color: #fff; border-radius: 10px; padding: 2px 6px; }
.side-nav a.on .count { background: #f27628; }
.side-foot { border-top: 1px solid #e3e0d8; padding: 12px 16px; font-size: 10.5px; color: #8f8a81; }
.app-main { min-width: 0; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.app-head h1 { font-family: Manrope; font-size: clamp(26px, 3.2vw, 40px); letter-spacing: -.045em; line-height: .95; }
.app-head p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { border: 1px solid var(--line); background: var(--paper-2); border-radius: 6px; padding: 15px 16px; }
.stat span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font-family: Manrope; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.04em; margin-top: 8px; line-height: 1; }
.stat small { display: block; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.stat.accent { background: var(--forest); color: var(--paper-2); border-color: var(--forest); }
.stat.accent span, .stat.accent small { color: #b9c4ba; }

/* --- panels + tables --- */
.panel { border: 1px solid var(--line); background: var(--paper-2); border-radius: 6px; margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.panel-head .link-arrow { font-size: 10px; }
.panel-body { padding: 16px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
  background: var(--paper);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .tiny { font-size: 10.5px; color: var(--muted); }
.table img.thumb-sm { width: 38px; height: 48px; object-fit: contain; padding: 2px; background: #fff; border: 1px solid var(--line-soft); border-radius: 3px; }
.table .cell-product { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.table .cell-product b { display: block; font-size: 11.5px; font-weight: 700; }
.table .cell-product span { font-size: 10px; color: var(--muted); }
.table .actions { display: flex; gap: 5px; flex-wrap: wrap; }
.table-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* --- small buttons + inline forms --- */
.btn-xs { min-height: 30px; padding: 0 10px; font-size: 10px; letter-spacing: .04em; border-radius: 4px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d13; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #0e5c2e; }
.inline-form { display: inline-flex; gap: 5px; align-items: center; }
.actions form { margin: 0; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* --- forms --- */
.form-card { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); padding: clamp(16px, 2.6vw, 26px); }
.form-card + .form-card { margin-top: 16px; }
.form-card h2 { font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.checkline input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.field input[type=file] { padding: 9px; background: var(--paper); }
.field textarea { min-height: 110px; resize: vertical; }
.form-error { background: #fdf1ef; border: 1px solid #f0c4bd; color: var(--danger); padding: 10px 12px; border-radius: 4px; font-size: 12px; margin-bottom: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* --- pagination --- */
.pager { display: flex; gap: 5px; justify-content: center; align-items: center; margin-top: 38px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 3px; font-size: 12px; font-weight: 700; background: var(--paper-2);
}
.pager a:hover { border-color: var(--ink); }
.pager .on { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.pager .gap { border-color: transparent; background: transparent; }

/* --- PDP extras --- */
.qty input {
  width: 48px; height: 100%; border: 0; background: transparent; text-align: center;
  font-family: Manrope; font-size: 13px; font-weight: 700; color: var(--ink); -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; background: var(--paper); }
.pdp-wish { margin-top: 8px; }
.pdp-wish .btn { width: auto; }
.review-form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.review-form-inline select, .review-form-inline input {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper-2); font-family: Manrope; font-size: 12px;
}
.review-form-inline input[name=body] { flex: 1; min-width: 200px; }
.review-form-inline input:focus, .review-form-inline select:focus { outline: none; border-color: var(--ink); }
@media (max-width: 640px) {
  .review-form-inline { margin-left: 0; width: 100%; }
}
.pdp-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.pdp-actions .btn { flex: 1; min-width: 150px; }
.opt-row { margin-top: 16px; }
.opt-row .opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.opt-row .opt-head b { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.opt-row .opt-head span { font-size: 11px; color: var(--muted); }
.size-picker, .color-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.size-picker label input { position: absolute; opacity: 0; pointer-events: none; }
.size-picker label span {
  min-width: 42px; height: 36px; padding: 0 10px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 3px; font-size: 11px; font-weight: 700; cursor: pointer; background: var(--paper-2);
}
.size-picker label input:checked + span { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.color-picker label input { position: absolute; opacity: 0; pointer-events: none; }
.color-picker label span {
  width: 26px; height: 26px; border-radius: 50%; display: block; border: 2px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer;
}
.color-picker label input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.stock-low { color: var(--accent-deep); font-weight: 800; font-size: 11px; }
.review-summary { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-summary .score { font-family: Manrope; font-size: 32px; letter-spacing: -.04em; line-height: 1; }
.review-summary .stars { color: var(--gold); letter-spacing: 2px; font-size: 13px; }
.review-list { border-top: 1px solid var(--line); }
.review { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.review-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.review-head b { font-size: 12.5px; }
.review-head span { font-size: 10.5px; color: var(--muted); }
.review .stars { color: var(--gold); font-size: 11px; letter-spacing: 1.5px; margin: 4px 0 6px; }
.review p { font-size: 12.5px; color: var(--ink-2); max-width: 75ch; }
.verified { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.no-reviews { padding: 24px 0; color: var(--muted); font-size: 12.5px; }

/* --- ship / addresses --- */
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.address-card { border: 1px solid var(--line); border-radius: 5px; padding: 15px; font-size: 12px; background: var(--paper-2); position: relative; }
.address-card.default { border-color: var(--ink); }
.address-card b { display: block; font-size: 12px; margin-bottom: 3px; }
.address-card p { color: var(--ink-2); font-size: 11.5px; line-height: 1.65; }
.address-card .badge-default { position: absolute; top: 12px; right: 12px; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: var(--paper-2); padding: 2px 6px; border-radius: 2px; }
.address-card .actions { margin-top: 10px; display: flex; gap: 5px; flex-wrap: wrap; }
.checkout-addresses { display: flex; flex-direction: column; gap: 8px; }
.checkout-addresses label { display: flex; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 12px; background: var(--paper-2); }
.checkout-addresses label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.checkout-addresses input { margin-top: 3px; accent-color: var(--accent); }
.checkout-addresses b { display: block; font-size: 11.5px; }
.checkout-addresses span { color: var(--muted); font-size: 11px; }

/* --- seller/public --- */
.vendor-banner { position: relative; border-radius: 6px; overflow: hidden; background: var(--forest); color: #f4efe4; }
.vendor-banner img { width: 100%; height: clamp(160px, 26vw, 300px); object-fit: cover; opacity: .55; }
.vendor-banner .vb-copy { position: absolute; inset: auto 0 0 0; padding: clamp(18px, 3vw, 34px); background: linear-gradient(0deg, rgba(18,36,27,.92), transparent); }
.vendor-banner h1 { font-family: Manrope; font-size: clamp(28px, 4vw, 52px); letter-spacing: -.05em; line-height: .95; }
.vendor-banner p { margin-top: 8px; font-size: 12.5px; color: #ddd7ca; max-width: 60ch; }
.vendor-banner .vb-mark { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: Manrope; font-size: 17px; margin-bottom: 12px; }
.vendor-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 11px; color: #cfc9bd; }
.vendor-meta b { color: var(--paper-2); }
.approval-note { border: 1px solid var(--line); background: var(--peach-soft); padding: 18px; border-radius: 6px; font-size: 13px; }

/* --- misc --- */
.muted { color: var(--muted); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.hr { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.split-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.order-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.order-line:last-child { border-bottom: 0; }
.order-line .who { color: var(--muted); font-size: 11px; }
.progress-steps { display: flex; gap: 0; margin: 18px 0; }
.progress-steps div { flex: 1; border-top: 2px solid var(--line); padding-top: 8px; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.progress-steps div.done { border-color: var(--ok); color: var(--ok); }
.progress-steps div.current { border-color: var(--accent); color: var(--accent-deep); }
.mini-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-card { border: 1px solid var(--line); background: var(--paper-2); border-radius: 5px; padding: 14px; font-size: 12px; }
.mini-card b { display: block; font-family: Manrope; font-size: 18px; letter-spacing: -.03em; }
.mini-card span { color: var(--muted); font-size: 10.5px; }
.upload-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.upload-strip img { width: 62px; height: 78px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; }
.upload-remove { position: relative; }
.upload-remove form { position: absolute; top: 3px; right: 3px; }
.upload-remove button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; line-height: 1; }

/* --- product photo manager --- */
.photo-lead { margin: 0 0 14px; max-width: 60ch; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.photo-grid[hidden] { display: none; }
.photo-tile { position: relative; width: 108px; margin: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.photo-tile img { display: block; width: 100%; height: 128px; object-fit: contain; padding: 5px; background: #fff; }
.photo-tile.is-cover { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.photo-flag { position: absolute; top: 6px; left: 6px; display: none; padding: 2px 6px; border-radius: 2px; background: var(--ink); color: var(--paper-2); font-size: 8.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.photo-tile.is-cover .photo-flag { display: inline-block; }
.photo-drop { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(23,19,15,.72); color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; }
.photo-drop:hover { background: var(--danger); }
.photo-cover { display: block; width: 100%; padding: 7px 4px; border: 0; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-family: Manrope; font-size: 9px; font-weight: 800; letter-spacing: .1em; line-height: 1.1; text-transform: uppercase; cursor: pointer; }
.photo-cover:hover { background: var(--peach-soft); }
.photo-tile.is-cover .photo-cover { background: var(--ink); color: var(--paper-2); cursor: default; }
.photo-tile.is-cover .photo-cover:hover { background: var(--ink); }
.photo-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-input:focus-visible + .photo-dropzone { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-dropzone { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 6px; background: var(--paper-2); cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease; }
.photo-dropzone b { font-family: Manrope; font-size: 12px; font-weight: 400; letter-spacing: .02em; }
.photo-dropzone span { color: var(--muted); font-size: 11px; }
.photo-dropzone:hover, .photo-dropzone.is-over { border-color: var(--ink); background: var(--peach-soft); }
.qty-inline { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.qty-inline button { width: 30px; height: 34px; border: 0; background: var(--paper); font-size: 15px; }
.qty-inline input { width: 40px; border: 0; text-align: center; font-size: 12px; background: transparent; }
.search-result-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.vendor-mini { display: flex; align-items: center; gap: 8px; }
.vendor-mini .vm-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper-2); display: grid; place-items: center; font-family: Manrope; font-size: 9px; }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .side-nav a, .side-nav button { white-space: nowrap; width: auto; }
  .side-head, .side-foot { display: none; }
  .auth-wrap { grid-template-columns: 1fr; min-height: 0; }
  .auth-art { min-height: 300px; }
  .mini-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-grid, .form-grid.three, .address-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pdp-actions .btn { min-width: 100%; }
  .table th, .table td { padding: 9px 10px; }
  .flash-stack { top: 76px; }
}
.pill-due { background: #fff2d8; color: #8a5a00; }
.pill-completed { background: #e5f4e9; color: #12613a; }

/* --- auth card layout (2026 11 11 v2) --- */
@media (min-width: 901px) {
  body.screen-auth { background: #f3f0ea; }
  body.screen-auth .mk-top,
  body.screen-auth .mk-nav,
  body.screen-auth .mk-appbar,
  body.screen-auth .mk-foot { display: none; }
  .screen-auth .flash-stack { display: none; }
  .auth-wrap { min-height: 100vh; }
}
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(18px, 2.6vw, 32px);
  background:
    radial-gradient(900px 420px at 78% 0%, #fbf7f0 0%, rgba(251, 247, 240, 0) 70%),
    #f2efe9;
}
.auth-sheet {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  width: min(1180px, 100%);
  min-height: min(740px, calc(100vh - 120px));
  background: #fff; border: 1px solid #ece5d9; border-radius: 26px;
  box-shadow: 0 36px 80px -46px rgba(23, 19, 15, .5), 0 1px 0 #fff inset;
  overflow: hidden;
}
.auth-media { position: relative; margin: 0; padding: 0; min-height: 0; }
.auth-media img {
  position: absolute; inset: 14px;
  width: calc(100% - 28px); height: calc(100% - 28px);
  object-fit: cover; object-position: 50% 18%; border-radius: 18px; background: #e9e2d6;
}
.auth-media .auth-slide { opacity: 0; transition: opacity .8s ease; }
.auth-media .auth-slide.is-on { opacity: 1; }
.auth-dots { position: absolute; left: 32px; bottom: 30px; z-index: 2; display: flex; gap: 7px; }
.auth-dots button {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 4px rgba(20, 17, 15, .35);
  cursor: pointer; transition: width .25s ease, background .25s ease;
}
.auth-dots button.is-on { width: 22px; border-radius: 999px; background: #fff; }
.auth-panel {
  position: relative; display: flex; flex-direction: column;
  justify-content: center; align-items: stretch;
  padding: clamp(40px, 4.4vw, 64px) clamp(38px, 4.6vw, 70px) clamp(26px, 3vw, 38px);
}
.auth-close {
  position: absolute; top: 22px; right: 22px;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid #ebe4d8; border-radius: 10px; background: #fff; color: #8d8273;
  text-decoration: none; transition: color .15s ease, border-color .15s ease;
}
.auth-close:hover { color: var(--ink); border-color: var(--ink); }
.auth-close svg { width: 17px; height: 17px; }
.auth-inner { width: 100%; max-width: 402px; margin: 0 auto; }
.auth-head h1 {
  margin: 0; font-family: Manrope; font-size: clamp(27px, 2.3vw, 34px);
  font-weight: 800; line-height: 1.12; letter-spacing: -.03em; color: var(--ink);
}
.auth-head p { margin: 10px 0 0; max-width: 40ch; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.auth-alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 18px; padding: 12px 14px;
  border: 1px solid #efcec0; border-radius: 10px;
  background: #fdf1eb; color: #8f2f0c; font-size: 12.5px; line-height: 1.5;
}
.auth-alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.auth-form { margin-top: clamp(22px, 3.2vh, 34px); display: flex; flex-direction: column; gap: 15px; }
.auth-field label { display: flex; align-items: baseline; gap: 3px; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.auth-field label > span { color: var(--accent); }
.auth-field .auth-opt { font-style: normal; font-weight: 600; font-size: 10.5px; letter-spacing: .02em; color: #a89d8d; }
.auth-control {
  position: relative; display: flex; align-items: center;
  border: 1px solid #e2d8c8; border-radius: 11px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-control:focus-within { border-color: #b9a88f; box-shadow: 0 0 0 3px rgba(247, 101, 2, .12); }
.auth-icon { width: 18px; height: 18px; margin-left: 15px; flex: none; color: #a99c89; }
.auth-control input {
  width: 100%; height: 52px; padding: 0 14px 0 11px;
  border: 0 !important; border-radius: 11px; background: transparent !important;
  box-shadow: none !important; font: inherit; font-size: 14px; color: var(--ink);
}
.auth-control input:focus { outline: none; }
.auth-control input::placeholder { color: #a89d8d; }
.auth-control input[id="password"],
.auth-control input[id="password_confirmation"] { padding-right: 50px; }
.auth-eye {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #a99c89; cursor: pointer;
}
.auth-eye:hover { color: var(--ink); background: #f7f2ea; }
.auth-eye svg { width: 19px; height: 19px; }
.auth-eye .auth-eye-slash { opacity: 0; transition: opacity .15s ease; }
.auth-eye.on .auth-eye-slash { opacity: 1; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -1px; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.auth-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.auth-forgot { font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-submit {
  margin-top: 3px; height: 54px; border: 0; border-radius: 11px;
  background: #14110f; color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  letter-spacing: .01em; cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.auth-submit:hover { background: #262019; transform: translateY(-1px); }
.auth-submit:active { transform: none; }
.auth-alt { margin: 15px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-alt a { font-weight: 800; color: var(--ink); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 18px 0 14px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px dashed #ddd3c3; }
.auth-or span { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #a29684; }
.auth-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px;
  border: 1px solid #e2d8c8; border-radius: 11px; background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 700; text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.auth-google:hover { border-color: #cbbda8; background: #fbf8f2; }
.auth-google svg { width: 18px; height: 18px; flex: none; }
.auth-legal { margin: clamp(18px, 3vh, 30px) 0 0; text-align: center; font-size: 11px; line-height: 1.7; color: var(--muted); }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.auth-sheet-register { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.auth-sheet-register .auth-panel { padding-top: clamp(30px, 3.4vw, 46px); padding-bottom: clamp(24px, 2.6vw, 32px); }
.auth-sheet-register .auth-form { margin-top: clamp(18px, 2.6vh, 26px); gap: 12px; }
.auth-sheet-register .auth-control input { height: 49px; }
.auth-sheet-register .auth-submit { height: 52px; }
@media (min-width: 901px) and (max-height: 860px) {
  .auth-sheet { min-height: calc(100vh - 64px); }
  .auth-panel { padding-top: 42px; padding-bottom: 26px; }
  .auth-form { margin-top: 22px; gap: 13px; }
  .auth-control input { height: 48px; }
  .auth-submit { height: 50px; }
  .auth-or { margin: 15px 0 12px; }
  .auth-alt { margin-top: 12px; }
  .auth-legal { margin-top: 16px; }
  .auth-sheet-register .auth-form { margin-top: 18px; gap: 11px; }
  .auth-sheet-register .auth-control input { height: 46px; }
}

/* --- forced SMS phone gate (2026 11 11) --- */
.phone-gate {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 150px);
  padding: clamp(28px, 5vw, 64px) 18px;
  background:
    radial-gradient(700px 340px at 82% 0%, #fbf7f0 0%, rgba(251, 247, 240, 0) 70%),
    #f2efe9;
}
.phone-card {
  width: min(470px, 100%);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid #ece5d9; border-radius: 20px; background: #fff;
  box-shadow: 0 30px 60px -42px rgba(23, 19, 15, .45);
}
.phone-badge {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 12px; background: #fdf1e6; color: var(--accent);
}
.phone-badge svg { width: 21px; height: 21px; }
.phone-card .micro { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.phone-card h1 { margin: 8px 0 0; font-size: clamp(26px, 3.4vw, 32px); font-weight: 800; line-height: 1.12; letter-spacing: -.03em; color: var(--ink); }
.phone-card > p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.phone-card .auth-alert { margin-top: 16px; }
.phone-card form { margin-top: 22px; }
.phone-card form > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.phone-control { display: flex; align-items: center; border: 1px solid #e2d8c8; border-radius: 11px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.phone-control:focus-within { border-color: #b9a88f; box-shadow: 0 0 0 3px rgba(247, 101, 2, .12); }
.phone-control input { width: 100%; height: 52px; padding: 0 14px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.phone-submit {
  width: 100%; height: 52px; margin-top: 16px; border: 0; border-radius: 11px;
  background: #14110f; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s ease;
}
.phone-submit:hover { background: #2b241d; }
.phone-foot { margin-top: 18px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.phone-foot a { color: var(--ink-2); }
@media (max-width: 640px) {
  .phone-gate { min-height: 0; padding: 22px 16px 44px; }
  .phone-card { padding: 24px 20px; border-radius: 16px; }
}

/* --- sign up code step and SMS desk (2026 11 12) --- */
.auth-alert-ok { border-color: #dbe3cf; background: #f6f8f1; color: #43552f; }
.auth-otp input { letter-spacing: .38em; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.auth-otp input::placeholder { letter-spacing: .3em; font-weight: 600; color: #c9bfae; }
.auth-resend { margin-top: 14px; text-align: center; }
.auth-resend button {
  padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 800;
  color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.auth-resend button:hover { color: var(--ink); }
.sms-meta { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 0 0 14px; }
.sms-meta div { display: flex; flex-direction: column; gap: 3px; }
.sms-meta span { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sms-meta b { font-size: 13.5px; font-weight: 700; color: var(--ink); }

/* --- administrator viewport layout --- */
body.admin-layout {
  --admin-sidebar-width: 232px;
  --admin-header-height: 140px;
  height: 100dvh;
  overflow: hidden;
}

body.admin-layout .mk-top,
body.admin-layout .mk-searchbar-nav {
  position: fixed;
  left: var(--admin-sidebar-width);
  right: 0;
  z-index: 2000;
}

body.admin-layout .mk-top {
  top: 0;
}

body.admin-layout .mk-searchbar-nav {
  top: 78px;
}

body.admin-layout .app-shell {
  display: block;
  height: calc(100dvh - var(--admin-header-height));
  margin-left: var(--admin-sidebar-width);
  margin-top: var(--admin-header-height);
  min-height: 0;
  overflow: hidden;
  padding: 0 10px 0 0;
}

body.admin-layout .side {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--admin-sidebar-width);
  height: 100dvh;
  max-height: none;
  overflow-y: auto;
  z-index: 1999;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.admin-layout .app-main {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px 60px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.admin-layout .side::-webkit-scrollbar,
body.admin-layout .app-main::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 760px) {
  body.admin-layout {
    --admin-sidebar-width: 176px;
    --admin-header-height: 78px;
  }

  body.admin-layout .mk-top,
  body.admin-layout .mk-searchbar-nav {
    display: none !important;
  }

  body.admin-layout .mk-appbar {
    display: block;
    position: fixed;
    top: 0;
    left: var(--admin-sidebar-width);
    right: 0;
    z-index: 2000;
  }

  body.admin-layout .app-shell {
    margin-top: var(--admin-header-height);
  }

  body.admin-layout .side {
    top: 0;
    height: 100dvh;
  }

  body.admin-layout .app-main {
    padding-right: 8px;
  }
}

@media (max-width: 480px) {
  body.admin-layout {
    --admin-sidebar-width: 160px;
  }
}

/* --- admin layout refinement --- */
body.admin-layout {
  --admin-sidebar-width: 244px;
  height: 100dvh;
  overflow: hidden;
  background: #f7f8fa;
}
body.admin-layout .mk-top,
body.admin-layout .mk-searchbar-nav,
body.admin-layout .mk-appbar,
body.admin-layout .mk-drawer,
body.admin-layout .mk-tabbar {
  display: none !important;
}
body.admin-layout .app-shell {
  display: block;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body.admin-layout .side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--admin-sidebar-width);
  height: 100dvh;
  border: 0;
  border-right: 1px solid #e3e6ea;
  border-radius: 0;
  box-shadow: 4px 0 20px rgba(35,43,54,.04);
  z-index: 20;
}
body.admin-layout .app-main {
  width: auto;
  height: 100dvh;
  min-height: 0;
  margin-left: var(--admin-sidebar-width);
  padding: 36px 40px 64px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f7f8fa;
}
body.admin-layout .app-main > * {
  width: min(1440px, 100%);
  margin-left: auto;
  margin-right: auto;
}
body.admin-layout .app-main .reference-dashboard {
  width: auto;
  min-height: calc(100dvh - 100px);
  margin: -36px -40px -64px;
  padding: 36px 40px 64px;
}
body.admin-layout .admin-list-react,
body.admin-layout .content-react,
body.admin-layout .sms-react,
body.admin-layout .installments-react,
body.admin-layout .quotes-react,
body.admin-layout .user-new-react,
body.admin-layout .categories-react,
body.admin-layout .coupons-react,
body.admin-layout .hero-react {
  max-width: 1440px;
}
@media (max-width: 900px) {
  body.admin-layout { --admin-sidebar-width: 204px; }
  body.admin-layout .app-main { padding: 28px 24px 48px; }
  body.admin-layout .app-main .reference-dashboard { margin: -28px -24px -48px; padding: 28px 24px 48px; }
}
@media (max-width: 640px) {
  body.admin-layout {
    --admin-sidebar-width: 0px;
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.admin-layout .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.admin-layout .side {
    position: sticky;
    inset: 0 0 auto;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #e3e6ea;
    box-shadow: 0 3px 14px rgba(35,43,54,.06);
    z-index: 30;
    background: #fff;
  }
  body.admin-layout .side-head {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 10px 14px;
  }
  body.admin-layout .side-head > div { min-width: 0; }
  body.admin-layout .side-head > div span {
    display: block;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.admin-layout .side-nav {
    display: flex;
    gap: 6px;
    width: 100%;
    padding: 0 12px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  body.admin-layout .side-nav::-webkit-scrollbar { display: none; }
  body.admin-layout .side-nav a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 13px;
    border: 1px solid #e3e6ea;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 13px;
  }
  body.admin-layout .side-nav a.on {
    border-color: #18251e;
    background: #18251e;
    color: #fff;
  }
  body.admin-layout .side-nav .count { margin-left: 5px; }
  body.admin-layout .side-foot { display: none; }
  body.admin-layout .app-main {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 108px);
    margin-left: 0;
    padding: 18px 12px 36px;
    overflow: visible;
  }
  body.admin-layout .app-main > * { width: 100%; }
  body.admin-layout .app-main .reference-dashboard {
    min-height: 0;
    margin: -18px -12px -36px;
    padding: 18px 12px 36px;
  }
  body.admin-layout .app-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }
  body.admin-layout .app-head h1 { font-size: 26px; line-height: 1.08; }
  body.admin-layout .app-head .btn { width: 100%; }
  body.admin-layout .stats-grid,
  body.admin-layout .form-grid,
  body.admin-layout .form-grid.three { grid-template-columns: 1fr; }
  body.admin-layout .form-card,
  body.admin-layout .panel { margin-bottom: 14px; }
  body.admin-layout .table-wrap {
    width: calc(100vw - 24px);
    max-width: none;
    margin-left: -1px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.admin-layout .table { min-width: 720px; }
  body.admin-layout input,
  body.admin-layout select,
  body.admin-layout textarea,
  body.admin-layout button,
  body.admin-layout .btn { min-height: 42px; }
  body.admin-layout .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  body.admin-layout .form-actions .btn { width: 100%; }
  body.admin-layout .row-actions { flex-wrap: wrap; gap: 7px; }
}

/* --- professional mobile admin drawer --- */
.admin-nav-toggle,
.admin-nav-backdrop,
.admin-nav-close { display: none; }
@media (max-width: 640px) {
  body.admin-layout .admin-nav-toggle {
    position: fixed;
    top: 12px;
    right: 14px;
    display: flex;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid #dfe3e7;
    border-radius: 4px;
    background: #fff;
    color: #18251e;
    box-shadow: 0 4px 14px rgba(35,43,54,.10);
    z-index: 50;
  }
  body.admin-layout .admin-nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; }
  body.admin-layout .admin-nav-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(11,16,13,.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 39;
  }
  body.admin-layout .admin-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  body.admin-layout .side {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    width: min(86vw, 304px);
    height: 100dvh;
    max-height: none;
    flex-direction: column;
    transform: translateX(-105%);
    transition: transform .22s ease;
    border: 0;
    box-shadow: 10px 0 28px rgba(18,25,21,.18);
    z-index: 40;
  }
  body.admin-layout .side.is-open { transform: translateX(0); }
  body.admin-layout .side-head {
    flex: 0 0 auto;
    min-height: 70px;
    padding: 14px 16px;
    border-bottom: 1px solid #e3e6ea;
  }
  body.admin-layout .admin-nav-close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 1px solid #dfe3e7;
    border-radius: 3px;
    background: #fff;
    color: #18251e;
    font-size: 24px;
    line-height: 1;
  }
  body.admin-layout .side-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    width: 100%;
    padding: 14px 12px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.admin-layout .side-nav a {
    flex: 0 0 auto;
    min-height: 44px;
    justify-content: space-between;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 3px;
    white-space: normal;
  }
  body.admin-layout .side-nav a:hover { background: #f0f3f1; }
  body.admin-layout .side-nav a.on { background: #18251e; color: #fff; }
  body.admin-layout .side-foot { display: block; flex: 0 0 auto; padding: 14px 16px; border-top: 1px solid #e3e6ea; font-size: 11px; }
  body.admin-layout .app-main { padding-top: 74px; }
  body.admin-layout.admin-nav-open .app-main { pointer-events: none; }
}

/* --- desktop dashboard reference layout --- */
body.admin-layout {
  --admin-sidebar-width: 236px;
  background: #eef2f8;
}
@media (min-width: 641px) {
  body.admin-layout .side {
    background: #40546a;
    border: 0;
    border-radius: 12px;
    margin: 16px 0 16px 16px;
    height: calc(100dvh - 32px);
    color: #f8fbff;
    box-shadow: 0 12px 28px rgba(49,65,82,.16);
  }
  body.admin-layout .side-head { min-height: 82px; padding: 18px; border-bottom: 1px solid rgba(255,255,255,.13); }
  body.admin-layout .side-avatar { background: #f1c75b; color: #40546a; width: 40px; height: 40px; }
  body.admin-layout .side-head b { color: #fff; font-size: 14px; }
  body.admin-layout .side-head span { color: #cbd6e2; }
  body.admin-layout .side-nav { padding: 14px 10px; gap: 5px; }
  body.admin-layout .side-nav a { min-height: 42px; color: #e5edf5; padding: 11px 13px; font-size: 12.5px; }
  body.admin-layout .side-nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
  body.admin-layout .side-nav a.on { background: #fff; color: #34475b; box-shadow: 0 4px 10px rgba(22,34,48,.10); }
  body.admin-layout .side-nav .count { background: #f1c75b; color: #34475b; }
  body.admin-layout .side-foot { border-color: rgba(255,255,255,.13); color: #cbd6e2; }
  body.admin-layout .app-main { margin-left: var(--admin-sidebar-width); padding: 22px 30px 44px; background: #eef2f8; }
  body.admin-layout .app-main .reference-dashboard { margin: -22px -30px -44px; padding: 22px 30px 44px; background: #eef2f8; }
  .reference-dashboard .dash-topbar { display: grid; grid-template-columns: 165px minmax(280px, 1fr) auto; align-items: center; gap: 26px; min-height: 66px; padding: 0 18px; margin-bottom: 22px; background: #fff; border-radius: 10px; box-shadow: 0 5px 18px rgba(57,75,95,.07); }
  .dash-topbar-title { color: #405064; font-size: 20px; font-weight: 700; }
  .dash-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px; border: 1px solid #e1e6ec; border-radius: 5px; color: #9ba8b5; background: #fff; }
  .dash-search input { width: 100%; min-height: 0; border: 0; outline: 0; color: #405064; background: transparent; font-size: 11px; }
  .dash-topbar-actions { display: flex; align-items: center; gap: 14px; }
  .dash-icon-btn { border: 0; background: transparent; color: #69798a; font-size: 20px; cursor: pointer; }
  .dash-profile-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #40546a; color: #fff; font-size: 10px; font-weight: 700; }
  .reference-dashboard .dash-page-head { display: none; }
  .reference-dashboard .dash-tabs { margin-bottom: 16px; border: 0; gap: 7px; }
  .reference-dashboard .dash-tab { border: 1px solid #dfe5ec; border-radius: 5px; padding: 8px 13px; background: #fff; color: #718095; }
  .reference-dashboard .dash-tab.active { border-color: #40546a; background: #40546a; color: #fff; }
  .reference-dashboard .dash-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .reference-dashboard .dash-stat-grid.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reference-dashboard .dash-stat { min-height: 78px; padding: 15px 17px; border: 0; border-radius: 9px; box-shadow: 0 6px 18px rgba(57,75,95,.06); }
  .reference-dashboard .dash-stat.dark { background: #40546a; }
  .reference-dashboard .dash-stat b { font-size: 20px; color: #34475b; }
  .reference-dashboard .dash-stat.dark b { color: #fff; }
  .reference-dashboard .dash-two-col { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 14px; }
  .reference-dashboard .dash-card { border: 0; border-radius: 10px; box-shadow: 0 6px 18px rgba(57,75,95,.06); padding: 18px; }
  .reference-dashboard .dash-card-head h2 { color: #405064; font-size: 14px; }
  .reference-dashboard .dash-chart { height: 205px; }
  .reference-dashboard .dash-bar i { background: linear-gradient(180deg, #40546a, #93a6b8); border-radius: 3px 3px 0 0; }
  .reference-dashboard .dash-progress i b { background: #f1c75b; }
  .reference-dashboard .dash-stat.warning { background: #fffaf0; border: 1px solid #f3dfae; }
  .reference-dashboard .dash-table th { background: #f8fafc; }
}

/* --- unified admin card system --- */
body.admin-layout {
  --admin-card-bg: #fff;
  --admin-card-border: #dfe5ec;
  --admin-card-radius: 10px;
  --admin-card-shadow: 0 6px 18px rgba(57,75,95,.06);
  --admin-card-padding: 18px;
}
body.admin-layout .panel,
body.admin-layout .form-card,
body.admin-layout .stat,
body.admin-layout .adm-stat,
body.admin-layout .dash-card,
body.admin-layout .dash-stat,
body.admin-layout .dk-manager-card,
body.admin-layout .address-card,
body.admin-layout .approval-note,
body.admin-layout .table-empty,
body.admin-layout .product-form-card,
body.admin-layout .admin-card {
  box-sizing: border-box;
  border: 1px solid var(--admin-card-border);
  border-radius: var(--admin-card-radius);
  background: var(--admin-card-bg);
  box-shadow: var(--admin-card-shadow);
}
body.admin-layout .panel,
body.admin-layout .form-card,
body.admin-layout .adm-stat,
body.admin-layout .dk-manager-card,
body.admin-layout .table-empty,
body.admin-layout .product-form-card,
body.admin-layout .admin-card { margin-bottom: 18px; }
body.admin-layout .panel-head,
body.admin-layout .form-card,
body.admin-layout .dk-manager-card,
body.admin-layout .product-form-card,
body.admin-layout .admin-card { padding: var(--admin-card-padding); }
body.admin-layout .panel-head { border-bottom-color: var(--admin-card-border); }
body.admin-layout .stat,
body.admin-layout .adm-stat,
body.admin-layout .dash-stat { padding: 16px 18px; }
body.admin-layout .dash-card { padding: var(--admin-card-padding); }
body.admin-layout .table-empty { padding: 32px var(--admin-card-padding); color: #718095; }
body.admin-layout .dash-card + .dash-card { margin-top: 0; }
body.admin-layout .panel .table th { background: #f7f9fc; border-bottom-color: var(--admin-card-border); }
body.admin-layout .panel .table td { border-bottom-color: #edf0f4; }
body.admin-layout .form-card h2,
body.admin-layout .panel-head h2,
body.admin-layout .panel-head h3,
body.admin-layout .dash-card-head h2 { color: #405064; }
body.admin-layout .form-card + .form-card { margin-top: 18px; }
body.admin-layout .stats-grid { gap: 14px; }
body.admin-layout .dash-stat-grid { gap: 14px; }

/* --- reference order detail layout --- */
.admin-order-page { max-width: 1280px !important; }
.admin-order-page .order-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.order-back { color:#40546a; font-size:13px; font-weight:600; text-decoration:none; }
.order-profile { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#40546a; color:#fff; font-size:11px; font-weight:700; }
.order-hero { display:flex; justify-content:space-between; gap:20px; align-items:end; margin-bottom:22px; }
.order-hero h1 { margin:4px 0 7px; color:#26384b; font-size:29px; }
.order-hero p { margin:0; color:#7b8998; font-size:13px; }
.order-hero-actions { display:flex; align-items:center; gap:12px; }
.order-status { padding:8px 13px; border-radius:4px; background:#e7f5ee; color:#21734e; font-size:12px; font-weight:700; }
.order-summary-card,.order-section,.order-total-card { border:1px solid #dfe5ec; border-radius:10px; background:#fff; box-shadow:0 6px 18px rgba(57,75,95,.06); }
.order-summary-card { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin-bottom:20px; padding:19px 22px; }
.order-summary-card div { padding:0 18px; border-right:1px solid #edf0f4; }
.order-summary-card div:first-child { padding-left:0; }
.order-summary-card div:last-child { border-right:0; padding-right:0; }
.order-summary-card small,.order-section-head span,.order-item-head,.order-product small,.order-details dt,.order-total-card small { display:block; color:#8b98a5; font-size:11px; }
.order-summary-card b { display:block; margin-top:8px; color:#26384b; font-size:14px; }
.order-section { margin-bottom:20px; overflow:hidden; }
.order-section-head { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:18px 20px; border-bottom:1px solid #edf0f4; }
.order-section-head h2,.order-actions-card h2 { margin:0; color:#405064; font-size:15px; }
.order-timeline { display:grid; grid-template-columns:repeat(4,1fr); gap:0; padding:26px 24px 22px; }
.order-step { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; color:#a3adb8; }
.order-step:not(:last-child)::after { content:""; position:absolute; left:calc(50% + 18px); right:calc(-50% + 18px); top:12px; height:2px; background:#e5e9ee; }
.order-step.done { color:#40546a; }
.order-step.done::after { background:#40546a; }
.order-step i { position:relative; z-index:1; display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#e5e9ee; color:#fff; font-style:normal; font-size:11px; font-weight:700; }
.order-step.done i { background:#40546a; }
.order-step b { font-size:12px; }
.order-step small { font-size:11px; }
.order-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,.85fr); gap:20px; align-items:start; }
.order-item-head,.order-item { display:grid; grid-template-columns:minmax(230px,1fr) 100px 100px 100px; gap:14px; align-items:center; padding:12px 20px; }
.order-item-head { background:#f8fafc; }
.order-item { min-height:72px; border-top:1px solid #edf0f4; color:#405064; font-size:12px; }
.order-product { display:flex; align-items:center; gap:12px; min-width:0; }
.order-product img,.order-product-mark { width:52px; height:52px; flex:0 0 52px; object-fit:cover; border-radius:4px; background:#eef2f5; }
.order-product-mark { display:grid; place-items:center; color:#40546a; font-weight:700; }
.order-product b,.order-product small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-product b { color:#26384b; font-size:12px; }
.order-qty { color:#9ba6b1; white-space:nowrap; }
.order-qty b { display:inline-grid; place-items:center; min-width:27px; height:27px; margin:0 5px; border:1px solid #e1e6eb; border-radius:50%; color:#405064; }
.order-item strong { color:#26384b; text-align:right; }
.order-total-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:20px; }
.order-total-card { padding:15px 18px; }
.order-total-card div { display:flex; justify-content:space-between; gap:16px; padding:6px 0; color:#647383; font-size:12px; }
.order-total-card b { color:#26384b; }
.order-grand-total { background:#40546a; border-color:#40546a; color:#fff; }
.order-grand-total div,.order-grand-total b { color:#fff; font-size:15px; }
.order-grand-total small { color:#dbe5ef; }
.order-details { display:grid; grid-template-columns:80px 1fr; gap:11px 16px; padding:19px 20px; margin:0; }
.order-details dd { margin:0; color:#405064; font-size:12px; overflow-wrap:anywhere; }
.order-actions-card { padding-bottom:18px; }
.order-actions-card h2 { padding:18px 20px 4px; }
.order-actions-card form { display:grid; gap:9px; padding:10px 20px 0; }
.order-actions-card select { min-height:40px; }
.order-payment { display:flex; justify-content:space-between; gap:16px; padding:15px 20px; border-top:1px solid #edf0f4; font-size:12px; }
.order-payment small { display:block; margin-top:4px; color:#8b98a5; }
.order-payment em { color:#21734e; font-style:normal; font-weight:700; }
.order-success { margin-bottom:16px; padding:12px 16px; border:1px solid #bde4cf; border-radius:6px; background:#effaf4; color:#21734e; font-size:13px; }
@media (max-width:760px) {
  .admin-order-page .order-hero { align-items:stretch; flex-direction:column; }
  .order-hero-actions { justify-content:space-between; }
  .order-summary-card { grid-template-columns:repeat(2,1fr); gap:16px 0; }
  .order-summary-card div:nth-child(2n) { border-right:0; }
  .order-summary-card div:nth-child(3) { padding-left:0; }
  .order-layout,.order-total-grid { grid-template-columns:1fr; }
  .order-timeline { min-width:620px; }
  .order-section:has(.order-timeline) { overflow-x:auto; }
  .order-item-head,.order-item { grid-template-columns:minmax(190px,1fr) 80px 90px 90px; min-width:520px; }
  .order-section:has(.order-items) { overflow-x:auto; }
}

/* Hide admin scrollbar chrome while preserving scrolling. */
html:has(.app-shell),
body:has(.app-shell) {
  scrollbar-width: none;
}

html:has(.app-shell)::-webkit-scrollbar,
body:has(.app-shell)::-webkit-scrollbar,
body.admin-layout .side::-webkit-scrollbar,
body.admin-layout .app-main::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}



/* Admin shell recovery */
body.admin-layout{--admin-sidebar-width:236px;min-height:100dvh;overflow-x:hidden;background:#eef2f8}
body.admin-layout .mk-top,body.admin-layout .mk-searchbar-nav,body.admin-layout .mk-appbar,body.admin-layout .mk-drawer,body.admin-layout .mk-tabbar{display:none!important}
body.admin-layout .app-shell{display:block;min-height:100dvh;margin:0;padding:0;overflow:visible}
body.admin-layout .side{position:fixed;inset:16px auto 16px 16px;display:flex;width:var(--admin-sidebar-width);height:calc(100dvh - 32px);flex-direction:column;z-index:20;overflow:hidden;background:#40546a;border:0;border-radius:12px;color:#fff;box-shadow:0 12px 28px rgba(49,65,82,.16)}
body.admin-layout .side-head{display:flex;align-items:center;gap:10px;min-height:82px;padding:18px;border-bottom:1px solid rgba(255,255,255,.13)}
body.admin-layout .side-nav{display:flex;flex:1;flex-direction:column;gap:5px;padding:14px 10px;overflow-y:auto}
body.admin-layout .side-nav a{display:flex;justify-content:space-between;align-items:center;min-height:42px;padding:11px 13px;border-radius:5px;color:#e5edf5;text-decoration:none;font-size:12.5px}
body.admin-layout .side-nav a.on{background:#fff;color:#34475b;box-shadow:0 4px 10px rgba(22,34,48,.1)}
body.admin-layout .side-nav a:hover{background:rgba(255,255,255,.1);color:#fff}
body.admin-layout .side-foot{padding:14px 16px;border-top:1px solid rgba(255,255,255,.13);color:#cbd6e2;font-size:10px}
body.admin-layout .app-main{width:auto;min-height:100dvh;margin-left:calc(var(--admin-sidebar-width) + 32px);padding:28px 34px 56px;background:#eef2f8;overflow:visible}
body.admin-layout .app-main> *{width:min(1440px,100%);margin-left:auto;margin-right:auto}
body.admin-layout .panel,body.admin-layout .form-card,body.admin-layout .stat,body.admin-layout .dash-card,body.admin-layout .dash-stat,body.admin-layout .table-empty{box-sizing:border-box;border:1px solid #dfe5ec;border-radius:10px;background:#fff;box-shadow:0 6px 18px rgba(57,75,95,.06)}
body.admin-layout .panel,body.admin-layout .form-card{margin-bottom:18px}
body.admin-layout .panel-head,body.admin-layout .form-card{padding:18px}
@media(max-width:640px){body.admin-layout{--admin-sidebar-width:0px;overflow-y:auto}body.admin-layout .side{inset:0 auto 0 0;width:min(86vw,304px);height:100dvh;border-radius:0;transform:translateX(-105%);transition:transform .22s ease}body.admin-layout .side.is-open{transform:translateX(0)}body.admin-layout .admin-nav-toggle{position:fixed;top:12px;right:14px;display:flex;width:44px;height:44px;flex-direction:column;justify-content:center;align-items:center;gap:5px;z-index:50;border:1px solid #dfe3e7;border-radius:4px;background:#fff}body.admin-layout .admin-nav-toggle span{width:18px;height:2px;background:#18251e}body.admin-layout .admin-nav-backdrop{position:fixed;inset:0;display:block;opacity:0;pointer-events:none;z-index:39;border:0;background:rgba(11,16,13,.42);transition:opacity .2s}body.admin-layout .admin-nav-backdrop.is-visible{opacity:1;pointer-events:auto}body.admin-layout .app-main{margin-left:0;padding:74px 12px 36px}body.admin-layout .table-wrap{max-width:100vw;overflow-x:auto}}

/* One shared admin shell for every route */
body.admin-layout #admin-global-nav-react .side{display:flex}
body.admin-layout .app-shell>.side,body.admin-layout .app-shell>.order-side{display:none!important}
body.admin-layout #main>section[id^="admin-"],body.admin-layout #main>main[class$="-react"]{min-height:100dvh;margin-left:calc(var(--admin-sidebar-width) + 32px);padding:28px 34px 56px;background:#eef2f8}
body.admin-layout #main>section[id^="admin-"]>* ,body.admin-layout #main>main[class$="-react"]>*{max-width:1440px;margin-left:auto;margin-right:auto}
@media(max-width:640px){body.admin-layout #main>section[id^="admin-"],body.admin-layout #main>main[class$="-react"]{margin-left:0;padding:74px 12px 36px}}

/* Admin shell recovery */
body.admin-layout{--admin-sidebar-width:236px;min-height:100dvh;overflow-x:hidden;background:#eef2f8}
body.admin-layout .mk-top,body.admin-layout .mk-searchbar-nav,body.admin-layout .mk-appbar,body.admin-layout .mk-drawer,body.admin-layout .mk-tabbar{display:none!important}
body.admin-layout .app-shell{display:block;min-height:100dvh;margin:0;padding:0;overflow:visible}
body.admin-layout .side{position:fixed;inset:16px auto 16px 16px;display:flex;width:var(--admin-sidebar-width);height:calc(100dvh - 32px);flex-direction:column;z-index:20;overflow:hidden;background:#40546a;border:0;border-radius:12px;color:#fff;box-shadow:0 12px 28px rgba(49,65,82,.16)}
body.admin-layout .side-head{display:flex;align-items:center;gap:10px;min-height:82px;padding:18px;border-bottom:1px solid rgba(255,255,255,.13)}
body.admin-layout .side-nav{display:flex;flex:1;flex-direction:column;gap:5px;padding:14px 10px;overflow-y:auto}
body.admin-layout .side-nav a{display:flex;justify-content:space-between;align-items:center;min-height:42px;padding:11px 13px;border-radius:5px;color:#e5edf5;text-decoration:none;font-size:12.5px}
body.admin-layout .side-nav a.on{background:#fff;color:#34475b;box-shadow:0 4px 10px rgba(22,34,48,.1)}
body.admin-layout .side-nav a:hover{background:rgba(255,255,255,.1);color:#fff}
body.admin-layout .side-foot{padding:14px 16px;border-top:1px solid rgba(255,255,255,.13);color:#cbd6e2;font-size:10px}
body.admin-layout .app-main{width:auto;min-height:100dvh;margin-left:calc(var(--admin-sidebar-width) + 32px);padding:28px 34px 56px;background:#eef2f8;overflow:visible}
body.admin-layout .app-main> *{width:min(1440px,100%);margin-left:auto;margin-right:auto}
body.admin-layout .panel,body.admin-layout .form-card,body.admin-layout .stat,body.admin-layout .dash-card,body.admin-layout .dash-stat,body.admin-layout .table-empty{box-sizing:border-box;border:1px solid #dfe5ec;border-radius:10px;background:#fff;box-shadow:0 6px 18px rgba(57,75,95,.06)}
body.admin-layout .panel,body.admin-layout .form-card{margin-bottom:18px}
body.admin-layout .panel-head,body.admin-layout .form-card{padding:18px}
@media(max-width:640px){body.admin-layout{--admin-sidebar-width:0px;overflow-y:auto}body.admin-layout .side{inset:0 auto 0 0;width:min(86vw,304px);height:100dvh;border-radius:0;transform:translateX(-105%);transition:transform .22s ease}body.admin-layout .side.is-open{transform:translateX(0)}body.admin-layout .admin-nav-toggle{position:fixed;top:12px;right:14px;display:flex;width:44px;height:44px;flex-direction:column;justify-content:center;align-items:center;gap:5px;z-index:50;border:1px solid #dfe3e7;border-radius:4px;background:#fff}body.admin-layout .admin-nav-toggle span{width:18px;height:2px;background:#18251e}body.admin-layout .admin-nav-backdrop{position:fixed;inset:0;display:block;opacity:0;pointer-events:none;z-index:39;border:0;background:rgba(11,16,13,.42);transition:opacity .2s}body.admin-layout .admin-nav-backdrop.is-visible{opacity:1;pointer-events:auto}body.admin-layout .app-main{margin-left:0;padding:74px 12px 36px}body.admin-layout .table-wrap{max-width:100vw;overflow-x:auto}}

/* Admin page scrolling */
html:has(body.admin-layout),body.admin-layout{height:auto!important;min-height:100%;overflow-y:auto!important;overflow-x:hidden!important}
body.admin-layout #main{display:block!important;min-height:100dvh!important;height:auto!important;overflow:visible!important}
body.admin-layout .app-shell,body.admin-layout .app-main{height:auto!important;min-height:100dvh!important;max-height:none!important;overflow:visible!important}
body.admin-layout #admin-global-nav-react .side{position:fixed!important}
body.admin-layout .table-wrap{max-width:100%;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}

/* Shared admin pagination */
body.admin-layout .admin-pagination{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;border-top:1px solid #dfe5ec;background:#fff;color:#718095;font-size:12px}
body.admin-layout .admin-pagination nav{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
body.admin-layout .admin-pagination a,body.admin-layout .admin-pagination .gap{display:inline-flex;min-width:30px;height:30px;align-items:center;justify-content:center;padding:0 8px;border:1px solid #dfe5ec;border-radius:4px;background:#fff;color:#405064;text-decoration:none}
body.admin-layout .admin-pagination a:hover,body.admin-layout .admin-pagination a.on{border-color:#40546a;background:#40546a;color:#fff}
body.admin-layout .admin-pagination .gap{border-color:transparent;background:transparent}
body.admin-layout .pager,body.admin-layout .product-pagination,body.admin-layout .vendor-pagination{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;border-top:1px solid #dfe5ec;background:#fff;color:#718095;font-size:12px}
body.admin-layout .pager a,body.admin-layout .pager span,body.admin-layout .product-page-btn,body.admin-layout .vendor-page-btn{display:inline-flex;min-width:30px;height:30px;align-items:center;justify-content:center;padding:0 8px;border:1px solid #dfe5ec;border-radius:4px;background:#fff;color:#405064;text-decoration:none}
@media(max-width:640px){body.admin-layout .admin-pagination,body.admin-layout .pager,body.admin-layout .product-pagination,body.admin-layout .vendor-pagination{align-items:flex-start;flex-direction:column}.admin-pagination nav{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}}
