:root {
  color-scheme: light;
  --ink: #0d1b31;
  --muted: #66748b;
  --line: #dfe6ef;
  --paper: #f7f7f3;
  --white: #ffffff;
  --navy: #09172c;
  --cobalt: #2458e6;
  --cyan: #2dd9df;
  --mint: #68dbc0;
  --violet: #805cf4;
  --danger: #c43d58;
  --shadow: 0 22px 65px rgba(15, 39, 72, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.preline { white-space: pre-line; }

.login-layout {
  min-height: 100vh;
  padding: 50px 20px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(45, 217, 223, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 217, 223, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 16% 18%, rgba(36, 88, 230, 0.34), transparent 32%),
    radial-gradient(circle at 82% 76%, rgba(128, 92, 244, 0.24), transparent 34%),
    var(--navy);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.login-card {
  width: min(100%, 520px);
  padding: 38px;
  border: 1px solid rgba(127, 211, 224, 0.25);
  border-radius: 28px;
  color: #eef6ff;
  background: rgba(12, 31, 56, 0.92);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.admin-brand { display: inline-flex; align-items: center; gap: 12px; }
.admin-brand > span:last-child { display: grid; gap: 2px; }
.admin-brand strong { font-size: 1rem; letter-spacing: -0.02em; }
.admin-brand small { color: #8aa0bc; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.admin-mark {
  width: 42px;
  height: 42px;
  padding: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  border: 1px solid rgba(45, 217, 223, 0.38);
  border-radius: 12px;
  background: rgba(45, 217, 223, 0.08);
}
.admin-mark i { display: block; border-radius: 2px 2px 0 0; background: linear-gradient(var(--cyan), var(--cobalt)); }
.admin-mark i:nth-child(1) { height: 55%; }
.admin-mark i:nth-child(2) { height: 100%; }
.admin-mark i:nth-child(3) { height: 76%; }

.login-copy { margin: 56px 0 32px; }
.kicker {
  color: var(--cobalt);
  font: 750 0.66rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.login-card .kicker { color: #70e4e7; }
.login-copy h1 {
  margin: 13px 0 17px;
  font-size: clamp(2.45rem, 8vw, 3.75rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}
.login-copy p { margin: 0; color: #a9bad0; line-height: 1.7; }

.login-form, .product-form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #3e4c63; font-size: 0.76rem; font-weight: 720; }
.login-form label { color: #d7e3f2; }
input, textarea, select {
  width: 100%;
  border: 1px solid #ccd6e4;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
input, select { min-height: 44px; padding: 0 12px; }
textarea { min-height: 105px; padding: 11px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(36, 88, 230, 0.11); }
.login-form input { min-height: 50px; border-color: rgba(167, 194, 225, 0.28); color: #fff; background: rgba(2, 13, 28, 0.58); }

.primary-action, .secondary-action, .icon-button {
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 11px;
  font-weight: 760;
}
.primary-action { border: 0; color: #fff; background: linear-gradient(110deg, var(--cobalt), #4775ef); box-shadow: 0 10px 24px rgba(36, 88, 230, 0.22); }
.login-form .primary-action { min-height: 52px; color: #06172d; background: linear-gradient(110deg, var(--cyan), var(--mint)); }
.primary-action.compact { min-height: 42px; }
.secondary-action { border: 1px solid #cfd8e5; color: #45536b; background: #fff; }
.icon-button { width: 42px; padding: 0; border: 1px solid var(--line); color: #617088; background: #fff; font-size: 1.45rem; }
.primary-action:disabled, .secondary-action:disabled { opacity: 0.6; cursor: wait; }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid #eabdc8; border-radius: 10px; color: #9e2942; background: #fff3f6; font-size: 0.74rem; }
.login-help { margin: 24px 0 0; color: #8094ad; font-size: 0.7rem; line-height: 1.7; }
.login-help code { color: #b7c9de; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 25px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #dce8f7;
  background:
    linear-gradient(rgba(45, 217, 223, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 217, 223, 0.035) 1px, transparent 1px),
    var(--navy);
  background-size: 32px 32px;
}
.sidebar-brand { margin: 0 9px; }
.admin-nav { margin-top: 46px; display: grid; gap: 6px; }
.admin-nav button {
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #91a5bf;
  background: transparent;
  font-weight: 680;
  text-align: left;
}
.admin-nav button span { width: 22px; color: #72ccd5; text-align: center; }
.admin-nav button:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.admin-nav button.active { border-color: rgba(45, 217, 223, 0.22); color: #fff; background: rgba(45, 217, 223, 0.1); }
.sidebar-bottom { padding: 18px 9px 0; display: grid; gap: 12px; border-top: 1px solid rgba(161, 188, 220, 0.14); }
.sidebar-bottom a, .sidebar-bottom button { color: #92a6bf; font-size: 0.78rem; font-weight: 680; }
.sidebar-bottom a { display: flex; justify-content: space-between; }
.sidebar-bottom button { padding: 0; border: 0; background: transparent; text-align: left; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: #fff; }

.admin-main { grid-column: 2; min-width: 0; padding: 48px clamp(24px, 4.5vw, 72px) 80px; }
.mobile-admin-header { display: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tab-in 0.18s ease-out; }
@keyframes tab-in { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 7px 0 0; font-size: clamp(2.4rem, 4.8vw, 4.15rem); line-height: 0.96; letter-spacing: -0.065em; }
.page-intro { max-width: 760px; margin: 18px 0 32px; color: var(--muted); line-height: 1.65; }

.summary-grid { margin: 34px 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.summary-card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(15, 39, 72, 0.045);
}
.summary-card span { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 730; letter-spacing: 0.06em; text-transform: uppercase; }
.summary-card strong { margin-top: 10px; display: block; font-size: clamp(1.35rem, 2vw, 1.85rem); letter-spacing: -0.04em; }
.summary-card i { width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(104, 219, 192, 0.13); }

.toolbar { margin-bottom: 14px; display: grid; grid-template-columns: minmax(240px, 1fr) 210px 190px; gap: 10px; }
.search-field { position: relative; display: block; }
.search-field span { position: absolute; top: 50%; left: 13px; color: #7a879c; transform: translateY(-50%); }
.search-field input { padding-left: 38px; }

.data-card, .editor-section, .delivery-card, .setup-card, .webhook-card, .payment-tracker-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(16, 38, 70, 0.055);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; color: #778399; background: #f7f9fc; font-size: 0.65rem; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
td { padding: 16px; border-top: 1px solid #e8edf3; color: #344158; font-size: 0.78rem; vertical-align: middle; }
tbody tr:hover { background: #fbfcfe; }
.order-id { display: grid; gap: 5px; }
.order-id strong { color: var(--ink); font-size: 0.76rem; }
.order-id small, .customer-cell small { color: #8490a3; }
.customer-cell { display: grid; gap: 4px; }
.customer-cell strong { color: var(--ink); }
.status-pill {
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid #d3dce9;
  border-radius: 99px;
  color: #617088;
  background: #f7f9fc;
  font-size: 0.64rem;
  font-weight: 760;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-pill.paid, .status-pill.delivered, .status-pill.picked_up { border-color: #aee2d4; color: #0b755f; background: #ecfbf6; }
.status-pill.processing, .status-pill.ready, .status-pill.shipped { border-color: #bfcdf7; color: #254fae; background: #eff3ff; }
.status-pill.payment_failed, .status-pill.checkout_error, .status-pill.cancelled { border-color: #edc1cb; color: #a52d49; background: #fff2f5; }
.view-button { min-height: 34px; padding: 0 11px; border: 1px solid #cdd8e7; border-radius: 9px; color: var(--cobalt); background: #f7f9ff; font-weight: 730; }
.empty-state { padding: 70px 25px; text-align: center; }
.empty-state > span { width: 62px; height: 62px; margin: 0 auto; display: grid; place-items: center; border-radius: 18px; color: var(--cobalt); background: #edf2ff; font-size: 1.5rem; }
.empty-state h3 { margin: 18px 0 7px; }
.empty-state p { margin: 0; color: var(--muted); }

.product-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.admin-product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(15, 39, 72, 0.055); }
.admin-product-card.inactive { opacity: 0.66; }
.admin-product-image { position: relative; background: #eff2f5; }
.admin-product-image img { width: 100%; aspect-ratio: 1.35; display: block; object-fit: cover; }
.visibility-tag { position: absolute; top: 11px; left: 11px; padding: 5px 8px; border-radius: 99px; color: #0c705c; background: rgba(235, 255, 248, 0.95); font-size: 0.62rem; font-weight: 760; }
.visibility-tag.hidden-product { color: #7a5360; background: rgba(255, 242, 245, 0.95); }
.admin-product-body { padding: 16px; }
.admin-product-meta { display: flex; justify-content: space-between; gap: 12px; color: #7b8799; font: 0.65rem ui-monospace, monospace; text-transform: uppercase; }
.admin-product-body h3 { margin: 12px 0 7px; font-size: 1.03rem; }
.admin-product-body p { min-height: 56px; margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.admin-product-actions { margin-top: 16px; padding-top: 13px; display: flex; gap: 8px; border-top: 1px solid #edf1f5; }
.admin-product-actions button { min-height: 36px; flex: 1; border: 1px solid #d3dce8; border-radius: 9px; color: #40516a; background: #fff; font-weight: 710; }
.admin-product-actions .delete-product { flex: 0 0 40px; color: var(--danger); }

.editor-form { display: grid; gap: 18px; }
.editor-section { padding: 24px; }
.editor-section-header { margin-bottom: 20px; display: flex; align-items: start; justify-content: space-between; gap: 25px; }
.editor-section-header h2 { margin: 0 0 5px; font-size: 1.12rem; }
.editor-section-header p { margin: 0; color: var(--muted); font-size: 0.76rem; }
.field-grid { display: grid; gap: 15px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.color-field input { height: 48px; padding: 4px; cursor: pointer; }
.site-image-upload-field small { color: var(--muted); font-weight: 500; line-height: 1.5; }
.site-image-preview {
  overflow: hidden;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef2f6;
}
.hero-image-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}
.logo-image-preview {
  min-height: 132px;
  padding: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #edf1f5 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f5 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f5 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.logo-image-preview img {
  width: min(100%, 280px);
  max-height: 110px;
  display: block;
  object-fit: contain;
}
.empty-image-preview {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.delivery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.delivery-card { padding: 22px; }
.delivery-card h2 { margin: 0 0 19px; font-size: 1.1rem; }
.delivery-card-fields { display: grid; gap: 15px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 16px; }
.toggle-row label { display: flex; align-items: center; gap: 8px; color: #405069; cursor: pointer; }
.toggle-row input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--cobalt); }

.payment-tracker-card { margin-top: 24px; padding: 24px; }
.payment-tracker-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.payment-tracker-header h2 { margin: 8px 0 7px; font-size: clamp(1.4rem, 2.5vw, 2rem); letter-spacing: -0.04em; }
.payment-tracker-header p { margin: 0; color: var(--muted); font-size: 0.72rem; }
.live-dot { width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: #18b893; box-shadow: 0 0 0 4px rgba(24, 184, 147, 0.13); }
.payment-summary-grid { margin: 22px 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.payment-summary-grid article { padding: 15px; border: 1px solid #e0e7f0; border-radius: 13px; background: #f8fafc; }
.payment-summary-grid span { display: block; color: var(--muted); font-size: 0.64rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.payment-summary-grid strong { margin-top: 7px; display: block; font-size: 1.25rem; letter-spacing: -0.035em; }
.payment-tracker-list { display: grid; gap: 13px; }
.payment-record { overflow: hidden; border: 1px solid #dfe6ef; border-left: 4px solid #aab7c8; border-radius: 14px; background: #fff; }
.payment-record.is-paid { border-left-color: #24b48d; }
.payment-record > header { padding: 15px 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e9eef4; background: #fbfcfe; }
.payment-record > header > div { display: grid; gap: 3px; }
.payment-record > header > div > span { color: #738198; font: 0.61rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.payment-record > header > div > strong { font-size: 0.9rem; }
.payment-record > header small { color: #8491a4; font-size: 0.67rem; }
.payment-record-grid { padding: 16px 17px; display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 20px; }
.payment-record-grid > section > small { display: block; margin-bottom: 9px; color: #7d899b; font-size: 0.62rem; font-weight: 760; letter-spacing: 0.07em; text-transform: uppercase; }
.payment-items { display: grid; gap: 9px; }
.payment-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; color: #304058; font-size: 0.75rem; }
.payment-item > div { min-width: 0; display: grid; gap: 3px; }
.payment-item span { color: var(--muted); font-size: 0.67rem; }
.payment-item p { margin: 5px 0 0; color: #536178; font-size: 0.69rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.payment-record address { color: #3c4b62; font-size: 0.74rem; font-style: normal; line-height: 1.6; white-space: pre-line; }
.payment-record > footer { padding: 13px 17px; display: flex; align-items: center; justify-content: flex-end; gap: 24px; border-top: 1px solid #e9eef4; background: #fbfcfe; }
.payment-record > footer > div { display: grid; gap: 2px; }
.payment-record > footer span { color: var(--muted); font-size: 0.61rem; font-weight: 720; text-transform: uppercase; }
.payment-record > footer strong { font-size: 0.88rem; }
.order-line-detail { max-width: 390px; margin: 7px 0 0; color: #59667a; font-size: 0.72rem; line-height: 1.55; white-space: pre-line; }

.setup-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.setup-card { padding: 19px; }
.setup-card > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-weight: 850; }
.setup-card.connected > span { color: #0c765f; background: #e9faf4; }
.setup-card.missing > span { color: #a82e48; background: #fff0f3; }
.setup-card h3 { margin: 15px 0 6px; font-size: 0.94rem; }
.setup-card p { margin: 0; color: var(--muted); font-size: 0.73rem; line-height: 1.55; }
.webhook-card { margin-top: 18px; padding: 25px; }
.webhook-card h2 { margin: 8px 0 16px; font-size: 1.35rem; }
.webhook-card > p { margin: 16px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.65; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.copy-row code { min-width: 0; padding: 13px 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; color: #2c4b84; background: #f6f8fc; white-space: nowrap; }

.modal-layer { position: fixed; z-index: 80; inset: 0; display: flex; justify-content: flex-end; }
.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 14, 29, 0.56); backdrop-filter: blur(3px); }
.modal-panel { position: relative; z-index: 1; width: min(620px, 100%); height: 100%; overflow-y: auto; background: #fbfbf8; box-shadow: -24px 0 80px rgba(4, 14, 29, 0.26); animation: panel-in 0.2s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateX(35px); } }
.modal-header { position: sticky; z-index: 2; top: 0; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); background: rgba(251, 251, 248, 0.95); backdrop-filter: blur(12px); }
.modal-header h2 { margin: 5px 0 0; font-size: 1.45rem; }
.modal-body { padding: 24px; }
.order-status-block { padding: 17px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.order-status-block small, .detail-block small { display: block; margin-bottom: 7px; color: #7e899b; font-size: 0.64rem; font-weight: 730; letter-spacing: 0.06em; text-transform: uppercase; }
.order-items { margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.order-line { padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 15px; border-bottom: 1px solid #ebeff4; }
.order-line:last-child { border: 0; }
.order-line span { color: var(--muted); font-size: 0.75rem; }
.order-totals { margin-top: 15px; display: grid; gap: 8px; }
.order-totals p { margin: 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; }
.order-totals p:last-child { padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); font-size: 0.95rem; font-weight: 760; }
.detail-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-block { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: #34435a; font-size: 0.78rem; line-height: 1.55; overflow-wrap: anywhere; }
.order-edit { margin-top: 18px; padding-top: 20px; display: grid; gap: 15px; border-top: 1px solid var(--line); }
.order-edit-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.product-panel { width: min(720px, 100%); }
.upload-field small { color: var(--muted); font-weight: 500; }
.optional-label { margin-left: 5px; color: #8290a5; font-size: 0.66rem; font-weight: 560; }
.image-choice-divider { height: 1px; margin: 1px 0; display: grid; place-items: center; background: var(--line); }
.image-choice-divider span { padding: 0 10px; color: #8a96a8; background: #fbfbf8; font-size: 0.65rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.form-actions { padding-top: 7px; display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed;
  z-index: 120;
  top: 18px;
  left: 50%;
  width: min(520px, calc(100% - 30px));
  padding: 13px 16px;
  border: 1px solid #aee4d5;
  border-radius: 12px;
  color: #0b6755;
  background: #edfff9;
  box-shadow: 0 18px 54px rgba(12, 46, 39, 0.18);
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 680;
}
.toast.error { border-color: #edbdc8; color: #9f2e47; background: #fff2f5; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .product-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-grid { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .admin-layout { display: block; }
  .sidebar {
    top: 70px;
    width: min(310px, 84vw);
    transform: translateX(-102%);
    transition: transform 0.2s;
  }
  .sidebar.open { transform: translateX(0); }
  .admin-main { padding: 0 18px 60px; }
  .mobile-admin-header {
    height: 70px;
    margin: 0 -18px 34px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
  }
  .mobile-admin-header .admin-brand small { color: #728198; }
  .mobile-admin-header button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .product-admin-grid { grid-template-columns: 1fr; }
  .payment-record-grid { grid-template-columns: 1fr; }
}

@media (max-width: 590px) {
  .login-card { padding: 28px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > button { width: 100%; }
  .summary-grid, .setup-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .field-grid.two, .field-grid.three, .field-grid.four { grid-template-columns: 1fr; }
  .editor-section { padding: 18px; }
  .order-status-block, .detail-grid { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
  .copy-row button { width: 100%; }
  .payment-tracker-card { padding: 18px; }
  .payment-tracker-header, .payment-record > header, .payment-record > footer { align-items: stretch; flex-direction: column; }
  .payment-summary-grid { grid-template-columns: 1fr; }
  .payment-record > footer { gap: 12px; }
  .payment-record > footer .view-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
