:root {
  --font-sans: 'Segoe UI Variable Text', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg: #f3f5fb;
  --surface: #fff;
  --line: #d7def2;
  --text: #1a2340;
  --muted: #667292;
  --accent: #303293;
  --accent-strong: #25277a;
  --accent-soft: #eceeff;
  --accent-glow: rgba(48, 50, 147, .2);
  --ink: #111a36;
  --success: #149c66;
  --warning: #ce8c20;
  --danger: #cc464f;
}

.logs-context {
  margin: .55rem 0 0;
  padding: .65rem;
  border: 1px solid rgba(66, 94, 171, .2);
  border-radius: 10px;
  background: #f7f9ff;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: min(460px, 60vw);
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  color: var(--text);
  line-height: 1.45;
  background:
    radial-gradient(1200px 620px at 12% -24%, rgba(48, 50, 147, .12), transparent 68%),
    radial-gradient(980px 540px at 96% 118%, rgba(78, 124, 255, .1), transparent 65%),
    linear-gradient(180deg, #f8f9ff, #eef1fb);
}

body.admin-nav-open {
  overflow: hidden;
}

body.media-modal-open {
  overflow: hidden;
}

body.admin-picker-body {
  background: #f3f6ff;
}

.admin-picker-main {
  min-height: 100vh;
  padding: .55rem;
}

.admin-picker-body .surface {
  border-radius: 12px;
  box-shadow: none;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: .002em;
}

h1 {
  font-size: clamp(2.05rem, 1.9rem + 1.4vw, 3rem);
  line-height: 1.07;
  font-weight: 760;
}

h2 {
  font-size: clamp(1.35rem, 1.2rem + .7vw, 2rem);
  font-weight: 720;
}

a { color: inherit; }
form { margin: 0; }
code {
  font-family: var(--font-mono);
  font-size: .92em;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
}

.admin-sidebar {
  padding: 1rem;
  background:
    radial-gradient(420px 240px at 22% -8%, rgba(112, 114, 255, .2), transparent 68%),
    linear-gradient(180deg, #151d44, #111a35);
  color: #e9edff;
  border-right: 1px solid rgba(173, 189, 255, .15);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-brand {
  text-decoration: none;
  display: flex;
  gap: .72rem;
  align-items: center;
  margin-bottom: 1.15rem;
  color: #fff;
}

.admin-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.admin-brand-logo-dark {
  display: none;
}

.admin-brand-text {
  min-width: 0;
}

.admin-brand-text strong {
  display: block;
  font-size: 1.13rem;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: .01em;
}

.nav-group {
  margin-top: 1rem;
}

.nav-group h4 {
  margin: 0 0 .45rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(220, 228, 255, .72);
}

.nav-link {
  display: flex;
  gap: .55rem;
  align-items: center;
  text-decoration: none;
  padding: .56rem .7rem;
  border-radius: 12px;
  color: #e5ebff;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}

.nav-link-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(229, 235, 255, .9);
}

.nav-link-label {
  min-width: 0;
}

.nav-link-icon svg {
  display: block;
  width: 1.22rem;
  height: 1.22rem;
}

.nav-link.active {
  background: rgba(108, 123, 255, .26);
  border-color: rgba(174, 189, 255, .5);
  color: #fff;
}

.nav-link.active .nav-link-icon {
  color: #fff;
}

.nav-link:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(191, 205, 255, .32);
}

.nav-link:hover .nav-link-icon {
  color: #fff;
}

.admin-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.admin-topbar {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid rgba(53, 80, 157, .14);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .9rem;
}

.admin-topbar-leading {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.admin-mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid rgba(66, 94, 171, .24);
  background: #fff;
  color: #243968;
  font-size: 1.16rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.admin-mobile-nav-toggle:hover {
  background: #f6f8ff;
  border-color: rgba(48, 50, 147, .4);
}

.admin-mobile-nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-topbar .form-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.admin-topbar .form-actions form {
  display: inline-flex;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 1.03rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-workspace {
  padding: 1.15rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.surface {
  border: 1px solid rgba(66, 94, 171, .15);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 34px rgba(20, 35, 77, .08);
  padding: 1.12rem;
  min-width: 0;
}

.surface-head {
  margin-bottom: .9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .9rem;
}

.surface-head .subtle,
.surface > .subtle {
  margin-top: .35rem;
}

.subtle {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .72rem;
}

.detail-card {
  border: 1px solid rgba(71, 100, 180, .14);
  border-radius: 16px;
  padding: .9rem 1rem;
  background: linear-gradient(180deg, #fff, #f8faff);
  display: grid;
  gap: .28rem;
}

.detail-card strong {
  font-size: 1.05rem;
  font-weight: 720;
}

.surface-muted {
  background: rgba(247, 249, 255, .86);
  box-shadow: none;
}

.stacked-meta {
  display: grid;
  gap: .2rem;
}

.stacked-meta small {
  color: var(--muted);
}

.order-detail-grid {
  align-items: start;
}

.order-customer-meta {
  margin-top: .8rem;
}

.detail-note {
  margin-top: .95rem;
  padding: .85rem .95rem;
  border: 1px dashed rgba(66, 94, 171, .28);
  border-radius: 14px;
  background: rgba(255, 255, 255, .8);
}

.detail-note strong {
  display: block;
  margin-bottom: .3rem;
}

.detail-note p {
  margin: 0;
  color: var(--muted);
}

.orders-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(66, 94, 171, .18);
  border-radius: 999px;
  padding: .42rem .78rem;
  background: #f8faff;
  color: #30406e;
  font-size: .84rem;
  font-weight: 650;
}

.order-manage-surface {
  margin-top: 1rem;
}

.stat-card {
  border: 1px solid rgba(71, 100, 180, .14);
  border-radius: 14px;
  padding: .85rem;
  background: linear-gradient(180deg, #fff, #f8faff);
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(66, 94, 171, .16);
  background: #fff;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: .72rem .8rem;
  border-bottom: 1px solid rgba(66, 94, 171, .12);
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-table table th,
.compact-table table td {
  padding-top: .62rem;
  padding-bottom: .62rem;
}

th {
  color: #5b6788;
  font-size: .95rem;
  font-weight: 700;
  background: #f8faff;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

tbody tr:hover {
  background: #f6f8ff;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.products-inline-editor .table-wrap table {
  min-width: 980px;
}

.products-inline-editor tr.is-inline-editing {
  background: #eef3ff;
}

.products-inline-editor .cell-editable {
  min-width: 140px;
}

.products-inline-editor .title-cell-display {
  display: inline-flex;
  align-items: center;
  gap: .44rem;
  min-width: 0;
  max-width: 100%;
}

.products-inline-editor .cell-input {
  width: 100%;
}

.products-inline-editor .inline-input {
  width: 100%;
  border-radius: 9px;
  min-height: 34px;
  padding: .35rem .5rem;
  font-size: .86rem;
}

.products-inline-editor .inline-slug-input {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #6b789b;
  font-weight: 600;
}

.products-inline-editor .inline-slug-prefix {
  white-space: nowrap;
  font-size: .8rem;
}

.actions-cell-inline {
  align-items: flex-start;
  gap: .42rem .58rem;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.inline-pencil-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  flex: 0 0 30px;
  box-sizing: border-box;
  border: 1px solid rgba(65, 92, 165, .24);
  border-radius: 10px;
  background: #fff;
  color: #2b3f6f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.inline-pencil-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 15px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.inline-pencil-btn:hover {
  background: #f3f6ff;
  border-color: rgba(48, 50, 147, .38);
}

.inline-pencil-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.products-inline-editor .title-edit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: .45rem;
  width: 100%;
}

.products-inline-editor .title-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  align-self: center;
}

.products-inline-editor .title-edit-row .inline-input {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.inline-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  flex: 0 0 28px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  font-weight: 700;
}

.inline-icon-save {
  background: rgba(20, 156, 102, .12);
  border-color: rgba(20, 156, 102, .34);
  color: #10875a;
}

.inline-icon-save:hover {
  background: rgba(20, 156, 102, .2);
}

.inline-icon-cancel {
  background: rgba(204, 70, 79, .12);
  border-color: rgba(204, 70, 79, .34);
  color: #b8323b;
}

.inline-icon-cancel:hover {
  background: rgba(204, 70, 79, .2);
}

.inline-action-btn {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.inline-action-btn[disabled] {
  opacity: .45;
  pointer-events: none;
}

.inline-feedback {
  width: 100%;
  font-size: .78rem;
  color: #2b3f6f;
}

.inline-feedback.error {
  color: #b42339;
}

.form-grid {
  display: grid;
  gap: .8rem;
}

.split-grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.form-actions form {
  margin: 0;
  display: inline-flex;
}

label {
  display: grid;
  gap: .38rem;
  font-weight: 600;
  color: #22315c;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(66, 94, 171, .25);
  border-radius: 12px;
  padding: .62rem .7rem;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #93a0be;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(48, 50, 147, .65);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

textarea {
  resize: vertical;
}

.rich-editor-source {
  display: none;
}

.rich-editor {
  border: 1px solid rgba(66, 94, 171, .2);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  padding: .5rem;
  border-bottom: 1px solid rgba(66, 94, 171, .14);
  background: #f7f9ff;
}

.rich-editor-group {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}

.rich-editor-select {
  width: auto;
  min-width: 88px;
  min-height: 32px;
  border-radius: 8px;
  padding: .28rem .38rem;
  font-size: .82rem;
}

.rich-editor-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid rgba(66, 94, 171, .24);
  border-radius: 8px;
  background: #fff;
  color: #2e4171;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.rich-editor-btn:hover {
  background: #eef2ff;
  border-color: rgba(48, 50, 147, .4);
}

.rich-editor-btn-html {
  width: auto;
  min-width: 54px;
  padding: 0 .52rem;
  font-size: .75rem;
  letter-spacing: .02em;
}

.rich-editor-btn-html.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(48, 50, 147, .8);
  color: #fff;
}

.rich-editor-body {
  min-height: 230px;
  padding: .72rem .78rem;
  color: var(--ink);
  line-height: 1.45;
  overflow: auto;
}

.rich-editor-body:focus {
  outline: none;
}

.rich-editor-code {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(66, 94, 171, .14);
  border-radius: 0;
  padding: .72rem .78rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.45;
  color: #dce5ff;
  background: #101a38;
  resize: vertical;
}

.rich-editor-code:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(140, 156, 255, .35);
}

.rich-editor.is-html-mode .rich-editor-select {
  opacity: .48;
  pointer-events: none;
}

.rich-editor.is-html-mode .rich-editor-btn:not(.rich-editor-btn-html):not([data-rich-cmd="insertImage"]) {
  opacity: .48;
  pointer-events: none;
}

.accent-btn,
.ghost-btn {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: .58rem 1rem;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  line-height: 1.1;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
  white-space: nowrap;
}

.accent-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 8px 22px rgba(48, 50, 147, .3);
}

.accent-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(48, 50, 147, .34);
}

.accent-btn.is-loading {
  opacity: .72;
  pointer-events: none;
  filter: saturate(.75);
}

.ghost-btn {
  border: 1px solid rgba(65, 92, 165, .26);
  background: #fff;
  color: #243968;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(48, 50, 147, .42);
  background: #f5f7ff;
}

.ghost-btn.danger,
.link-danger {
  color: var(--danger);
}

.link-danger {
  border: 0;
  background: none;
  padding: 0;
  text-decoration: underline;
}

.text-link {
  color: #283f84;
  text-decoration: none;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .25rem .64rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.15;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  max-width: 100%;
}

.status-chip.success { color: #0e6d4a; background: #d4f5e8; }
.status-chip.warning { color: #835711; background: #ffe8bf; }
.status-chip.danger { color: #8d2234; background: #ffd8dd; }
.status-chip.neutral { color: #2b3f6f; background: #e4eaff; }
.stacked-chips { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.truncate-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert {
  border: 1px solid #fecaca;
  background: #fff1f1;
  color: #a02424;
  border-radius: 10px;
  padding: .65rem;
}

.success-note {
  border: 1px solid #86efac;
  background: #ecfdf3;
  color: #166534;
  border-radius: 10px;
  padding: .65rem;
}

.code-editor {
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.4;
  min-height: 380px;
  background: #0f1d24;
  color: #e8f2f3;
}

.code-editor-shell {
  border: 1px solid rgba(18,54,58,.2);
  border-radius: 12px;
  overflow: hidden;
}

.code-editor-shell .code-editor {
  border: 0;
  border-radius: 0;
  min-height: 520px;
}

.CodeMirror {
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.5;
  min-height: 520px;
  height: auto;
}

.media-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  align-items: center;
}

.media-picker {
  border: 1px dashed rgba(66, 94, 171, .35);
  border-radius: 12px;
  padding: .72rem;
  display: grid;
  gap: .55rem;
  background: #fbfcff;
}

.media-picker-preview {
  border: 1px solid rgba(66, 94, 171, .16);
  background: #fff;
  border-radius: 10px;
  padding: .58rem;
  display: grid;
  gap: .45rem;
}

.media-picker-preview img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(66, 94, 171, .12);
}

.seo-media-picker {
  max-width: 420px;
}

.seo-media-picker .media-picker-preview img {
  max-height: 116px;
  object-fit: contain;
  background: #f6f8ff;
  padding: .35rem;
}

.media-picker-empty {
  border-radius: 8px;
  background: #f5f7ff;
  border: 1px solid rgba(66, 94, 171, .13);
  color: #55658b;
  padding: .55rem .62rem;
  font-size: .9rem;
}

.media-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
}

.media-modal.is-hidden {
  display: none;
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(8, 14, 36, .58);
}

.media-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 1.2rem));
  height: min(84vh, 820px);
  border-radius: 14px;
  border: 1px solid rgba(66, 94, 171, .22);
  background: #fff;
  box-shadow: 0 24px 44px rgba(8, 14, 36, .38);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.media-modal-head {
  border-bottom: 1px solid rgba(66, 94, 171, .16);
  background: #f7f9ff;
  padding: .62rem .72rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
}

.media-modal-head strong {
  font-size: .96rem;
  color: #243968;
}

.media-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.media-gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .55rem;
}

.media-gallery-empty {
  margin: 0;
}

.media-thumb {
  border: 1px solid rgba(66, 94, 171, .18);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: grid;
  cursor: grab;
  position: relative;
}

.media-thumb:active {
  cursor: grabbing;
}

.media-thumb.dragging {
  opacity: .92;
  box-shadow: 0 16px 28px -20px rgba(22, 25, 58, .5);
}

.media-thumb img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  display: block;
}

.media-thumb.is-main {
  border-color: rgba(20, 156, 102, .78);
  box-shadow: inset 0 0 0 1px rgba(20, 156, 102, .36), 0 10px 18px rgba(20, 156, 102, .14);
}

.media-thumb-main-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: rgba(20, 156, 102, .94);
  color: #fff;
  font-size: .69rem;
  font-weight: 700;
  line-height: 1;
  padding: .26rem .5rem;
}

.media-thumb-add {
  min-height: 172px;
  align-content: center;
  justify-items: center;
  gap: .4rem;
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(66, 94, 171, .25);
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
  color: #30457b;
  cursor: pointer;
}

.media-thumb-add:hover {
  border-color: rgba(48, 50, 147, .52);
  background: linear-gradient(180deg, #ffffff, #edf1ff);
}

.media-thumb-add-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(66, 94, 171, .28);
  display: grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  background: #fff;
}

.media-thumb-add-label {
  font-size: .86rem;
  font-weight: 700;
}

.media-thumb-meta {
  padding: .5rem;
  display: grid;
  gap: .4rem;
}

.media-thumb-meta strong {
  font-size: .88rem;
}

.media-thumb-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.media-thumb-handle {
  margin-right: auto;
  border: 1px solid rgba(66, 94, 171, .22);
  border-radius: 8px;
  background: #f7f9ff;
  color: #2f4375;
  padding: .32rem .48rem;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  cursor: grab;
}

.media-thumb-handle:active {
  cursor: grabbing;
}

.product-editor-surface {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.product-editor-surface .surface-head {
  margin-bottom: .42rem;
}

.product-editor-surface h1 {
  font-size: clamp(1.42rem, 1.2rem + .52vw, 1.9rem);
  line-height: 1.12;
}

.product-editor-hero {
  position: sticky;
  top: calc(var(--topbar-h, 64px) + 12px);
  z-index: 18;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto .9rem;
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(66, 94, 171, .16);
  border-radius: 16px;
  padding: 1rem 1rem .55rem;
  background:
    radial-gradient(520px 220px at 92% -28%, rgba(48, 50, 147, .1), transparent 68%),
    #fff;
  box-shadow: 0 18px 48px -42px rgba(35, 44, 92, .55);
}

.product-editor-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.product-editor-hero-main {
  min-width: 0;
  display: grid;
  gap: .42rem;
}

.product-back-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: .34rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 760;
  text-decoration: none;
}

.product-back-link::before {
  content: '<';
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(66, 94, 171, .16);
  border-radius: 8px;
  color: var(--accent);
  background: #f7f9ff;
}

.product-back-link:hover {
  color: var(--accent-strong);
}

.product-editor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem;
  color: var(--muted);
  font-size: .82rem;
}

.product-editor-meta > span:not(.status-chip) {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(66, 94, 171, .14);
  border-radius: 999px;
  padding: .24rem .58rem;
  background: rgba(247, 249, 255, .9);
}

.product-editor-hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.product-editor-tabs {
  position: static;
  z-index: 1;
  margin: .1rem -.28rem 0;
  padding: .34rem .28rem 0;
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid rgba(66, 94, 171, .12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.product-editor-tabs a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .38rem .7rem .5rem;
  color: #40517b;
  font-size: .82rem;
  font-weight: 760;
  text-decoration: none;
}

.product-editor-tabs a:hover,
.product-editor-tabs a:focus-visible {
  color: var(--accent-strong);
  background: transparent;
  border-bottom-color: rgba(48, 50, 147, .32);
  outline: none;
}

.product-editor-tabs .tab-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: .72rem;
  font-weight: 840;
  line-height: 1;
}

.product-editor-tabs .tab-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.product-editor-tabs .tab-count {
  min-width: 22px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 .38rem;
  color: var(--muted);
  background: #f2f5fc;
  font-family: var(--font-mono);
  font-size: .72rem;
}

.product-side-summary span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-side-summary strong {
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.1;
}

.product-editor-form {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  gap: .58rem;
  padding-bottom: 92px;
}

.product-editor-form p {
  margin: 0;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.product-layout-main {
  display: grid;
  gap: 18px;
}

.product-layout-side {
  position: sticky;
  top: 82px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.product-main-surface,
.product-side-meta,
.product-media-surface,
.product-pricing-surface,
.product-filters-surface,
.product-description-surface,
.product-seo-surface,
.product-related-surface {
  border-radius: 14px;
}

.product-editor-section {
  scroll-margin-top: calc(var(--topbar-h, 64px) + 170px);
}

.product-editor-section > .surface-head,
.product-side-head {
  margin-bottom: .72rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.product-editor-section > .surface-head h2,
.product-side-head h2 {
  margin: 0;
}

.product-editor-section > .surface-head p,
.product-side-head p {
  margin-top: .1rem;
}

.product-main-surface h2,
.product-side-meta h2,
.product-media-surface h2,
.product-pricing-surface h2,
.product-filters-surface h2,
.product-description-surface h2,
.product-seo-surface h2 {
  margin-bottom: .4rem;
  font-size: 1.16rem;
}

.product-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .78rem;
}

.product-side-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.product-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(66, 94, 171, .18);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.product-input-affix:focus-within {
  border-color: rgba(48, 50, 147, .48);
  box-shadow: 0 0 0 3px rgba(48, 50, 147, .1);
}

.product-input-affix input {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-input-affix span {
  min-width: 44px;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(66, 94, 171, .14);
  color: var(--muted);
  background: #f7f9ff;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 760;
}

.product-media-main-grid {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 12px;
}

.product-editor-form .product-media-main-grid .media-thumb {
  aspect-ratio: 1 / 1;
  min-height: 0;
  display: block;
  border-radius: 12px;
  background: #f2f5fc;
  transition: transform .15s ease, border-color .15s ease, box-shadow .18s ease, opacity .14s ease;
}

.product-editor-form .product-media-main-grid .media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-editor-form .product-media-main-grid .media-thumb:hover {
  border-color: rgba(48, 50, 147, .34);
  box-shadow: 0 14px 24px -20px rgba(22, 25, 58, .42);
  transform: translateY(-2px);
}

.product-editor-form .product-media-main-grid.is-dragging .media-thumb {
  transition: none;
}

.product-editor-form .product-media-main-grid .media-thumb.dragging {
  opacity: .94;
  transform: scale(.985);
  border-color: rgba(48, 50, 147, .45);
  box-shadow: 0 16px 28px -18px rgba(22, 25, 58, .44);
}

.product-editor-form .product-media-main-grid .media-thumb-main-badge,
.product-editor-form .product-media-main-grid .media-thumb-main-action {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 4;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 9px;
  color: #fff;
  background: rgba(20, 156, 102, .94);
  font-size: .68rem;
  font-weight: 760;
  line-height: 1;
}

.product-editor-form .product-media-main-grid .media-thumb-main-action {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, .94);
  border-color: rgba(66, 94, 171, .24);
  box-shadow: 0 8px 18px -14px rgba(22, 25, 58, .48);
  cursor: pointer;
}

.product-editor-form .product-media-main-grid .media-thumb-main-action:hover,
.product-editor-form .product-media-main-grid .media-thumb-main-action:focus-visible {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.product-editor-form .product-media-main-grid .media-thumb-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 8px 7px;
  color: #fff;
  background: linear-gradient(to top, rgba(17, 24, 48, .82), rgba(17, 24, 48, 0));
}

.product-editor-form .product-media-main-grid .media-thumb-meta strong {
  max-width: 100%;
  color: #fff;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-editor-form .product-media-main-grid .media-thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  opacity: 0;
  transition: opacity .14s ease;
}

.product-editor-form .product-media-main-grid .media-thumb:hover .media-thumb-actions,
.product-editor-form .product-media-main-grid .media-thumb:focus-within .media-thumb-actions {
  opacity: 1;
}

.product-editor-form .product-media-main-grid .media-thumb-actions .ghost-btn,
.product-editor-form .product-media-main-grid .media-thumb-handle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-color: rgba(255, 255, 255, .22);
  border-radius: 8px;
  padding: 0;
  color: #fff;
  background: rgba(17, 24, 48, .68);
  font-size: .78rem;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.product-editor-form .product-media-main-grid .media-thumb-actions .ghost-btn:hover,
.product-editor-form .product-media-main-grid .media-thumb-handle:hover {
  color: #fff;
  background: var(--accent);
}

.product-editor-form .product-media-main-grid .media-thumb-actions .ghost-btn.danger:hover {
  background: var(--danger);
}

.product-editor-form .product-media-main-grid .media-thumb-actions .ghost-btn:not(.danger):first-of-type {
  width: 28px;
  min-width: 28px;
  padding-inline: 0;
}

.product-editor-form .product-media-main-grid .media-thumb-add {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f7f9ff;
}

.product-editor-form .product-media-main-grid .media-thumb-add:hover {
  transform: translateY(-2px);
}

.product-media-footer {
  margin-top: .7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
}

.product-side-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .42rem;
  margin-bottom: .72rem;
}

.product-side-summary > div {
  min-width: 0;
  display: grid;
  gap: .16rem;
  border: 1px solid rgba(66, 94, 171, .14);
  border-radius: 12px;
  padding: .55rem .58rem;
  background: #f8faff;
}

.product-side-summary strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.product-price-summary {
  border: 1px solid rgba(66, 94, 171, .14);
  border-radius: 14px;
  padding: .82rem;
  background: linear-gradient(180deg, #f8f9ff, #eef2ff);
}

.product-price-summary > div {
  display: grid;
  gap: .12rem;
}

.product-price-label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-price-summary strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.1;
}

.product-price-summary small {
  color: var(--muted);
}

.product-rail-meta {
  margin-top: .7rem;
  display: grid;
  gap: .12rem;
  border: 1px solid rgba(66, 94, 171, .12);
  border-radius: 12px;
  overflow: hidden;
}

.product-rail-meta > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .5rem .62rem;
  background: #fff;
}

.product-rail-meta > div + div {
  border-top: 1px solid rgba(66, 94, 171, .1);
}

.product-rail-meta span {
  color: var(--muted);
  font-size: .82rem;
}

.product-rail-meta strong {
  color: var(--ink);
  font-size: .86rem;
}

.product-rail-actions {
  display: grid;
  gap: .5rem;
}

.product-rail-actions .ghost-btn {
  width: 100%;
}

.product-status-fieldset {
  margin: .72rem 0 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: .46rem;
}

.product-status-fieldset legend {
  margin-bottom: .42rem;
  color: #2b3f6f;
  font-size: .86rem;
  font-weight: 780;
}

.product-status-options {
  display: grid;
  gap: .42rem;
}

.product-status-option {
  margin: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: flex-start;
  gap: .52rem;
  border: 1px solid rgba(66, 94, 171, .16);
  border-radius: 12px;
  padding: .62rem;
  background: #fff;
  cursor: pointer;
}

.product-status-option:has(input:checked) {
  border-color: rgba(48, 50, 147, .36);
  background: linear-gradient(180deg, #f8f9ff, #eef1ff);
  box-shadow: inset 0 0 0 1px rgba(48, 50, 147, .08);
}

.product-status-option input {
  margin-top: .16rem;
}

.product-status-option strong,
.product-status-option small {
  display: block;
}

.product-status-option strong {
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.2;
}

.product-status-option small {
  margin-top: .12rem;
  color: var(--muted);
  font-weight: 520;
  line-height: 1.28;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.product-editor-form label {
  gap: .26rem;
  font-size: .86rem;
  font-weight: 720;
  color: #2c3d67;
}

.product-editor-form input,
.product-editor-form textarea,
.product-editor-form select {
  border-radius: 9px;
  padding: .56rem .62rem;
  font-size: .89rem;
}

.product-editor-form .surface {
  padding: .82rem;
}

.collapsible-surface {
  padding: 0;
  overflow: hidden;
}

.collapsible-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  cursor: pointer;
  padding: .75rem .82rem;
  user-select: none;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.collapsible-summary small {
  display: block;
  margin-top: .16rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.collapsible-summary-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(66, 94, 171, .16);
  border-radius: 999px;
  padding: .28rem .56rem;
  background: #f7f9ff;
  color: #32497d;
  font-size: .76rem;
  font-weight: 700;
}

.collapsible-surface[open] .collapsible-summary {
  border-bottom: 1px solid rgba(66, 94, 171, .12);
}

.collapsible-surface[open] .collapsible-summary-badge {
  background: var(--accent-soft);
  border-color: rgba(48, 50, 147, .22);
  color: var(--accent-strong);
}

.collapsible-surface[open] .collapsible-summary-badge::after {
  content: ' открыто';
}

.collapsible-body {
  padding: .72rem .82rem .82rem;
}

.seo-panel-grid {
  display: grid;
  gap: .58rem;
}

.seo-inline-note {
  align-self: end;
  border: 1px solid rgba(66, 94, 171, .14);
  border-radius: 10px;
  padding: .65rem .72rem;
  background: #f8faff;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
}

.seo-inline-note strong {
  display: block;
  margin-bottom: .14rem;
  color: var(--ink);
  font-size: .83rem;
}

.product-editor-form .media-picker {
  padding: .46rem;
  gap: .36rem;
}

.product-editor-form .media-picker-preview {
  padding: .4rem;
  gap: .28rem;
  justify-items: start;
}

.product-editor-form .media-picker-preview img {
  width: 100%;
  max-height: 108px;
  object-fit: cover;
}

.product-editor-form .seo-media-picker .media-picker-preview img,
.product-editor-form .product-seo-surface .media-picker-preview img {
  max-height: 90px;
  object-fit: contain;
}

.product-editor-form .media-picker-preview .subtle,
.product-editor-form .media-picker .subtle {
  font-size: .78rem;
  line-height: 1.22;
}

.product-editor-form .media-gallery-list {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: .34rem;
}

.media-gallery-list-product {
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: .45rem;
}

.product-editor-form .media-thumb img {
  height: 72px;
}

.product-editor-form .media-thumb-meta {
  padding: .3rem;
  gap: .22rem;
}

.product-editor-form .media-thumb-meta strong {
  font-size: .72rem;
  line-height: 1.18;
}

.product-editor-form .media-thumb-actions .ghost-btn {
  min-height: 26px;
  padding: .2rem .36rem;
  font-size: .7rem;
}

.product-editor-form .media-thumb-actions .media-thumb-handle {
  font-size: .68rem;
  padding: .18rem .3rem;
}

.product-media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  margin-bottom: .28rem;
}

.product-editor-form .media-gallery-list-product .media-thumb {
  min-height: 136px;
}

.product-editor-form .media-gallery-list-product .media-thumb img {
  height: 92px;
}

.product-editor-form .media-gallery-list-product .media-thumb-add {
  min-height: 136px;
}

.product-editor-form .media-gallery-list-product .media-thumb-add-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.55rem;
}

.product-editor-form .media-gallery-list-product .media-thumb-add-label {
  font-size: .72rem;
}

.product-editor-form .media-gallery-list-product .media-thumb-actions .ghost-btn {
  min-height: 24px;
  padding: .16rem .3rem;
  font-size: .66rem;
}

.product-editor-form .product-media-toolbar .ghost-btn {
  min-height: 30px;
  padding: .24rem .5rem;
  font-size: .74rem;
}

.product-editor-form .product-media-main-grid.media-gallery-list-product {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 12px;
}

.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb,
.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb-add {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb img {
  height: 100%;
}

.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb-actions .ghost-btn,
.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb-actions .media-thumb-handle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  margin-right: 0;
  padding: 0;
  font-size: .78rem;
}

.product-editor-form .product-media-main-grid.media-gallery-list-product .media-thumb-actions .ghost-btn:not(.danger) {
  width: 28px;
  padding-inline: 0;
}

.media-help-compact {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
  line-height: 1.2;
}

.property-warning {
  margin: .2rem 0 .42rem;
  border-radius: 8px;
  padding: .48rem .62rem;
  background: #f15353;
  color: #fff;
  font-size: .8rem;
  line-height: 1.3;
}

.filter-surface-note {
  margin: 0 0 .48rem;
  font-size: .78rem;
  line-height: 1.35;
}

.property-table {
  display: grid;
  gap: .46rem;
}

.property-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 36px;
  border: 1px solid rgba(66, 94, 171, .2);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.property-row.no-action {
  grid-template-columns: 210px minmax(0, 1fr);
}

.property-key {
  margin: 0;
  padding: .58rem .68rem;
  display: flex;
  align-items: center;
  font-size: .82rem;
  font-weight: 680;
  line-height: 1.2;
  color: #40517b;
  background: #f2f5fc;
  border-right: 1px solid rgba(66, 94, 171, .14);
}

.property-key-sub {
  background: #eef2fb;
}

.property-value {
  margin: 0;
  padding: .52rem .62rem;
  background: #fff;
  display: grid;
  align-content: center;
  gap: .32rem;
}

.property-value textarea {
  min-height: 76px;
}

.property-value-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .26rem;
}

.property-value-options .choice-option {
  margin: 0;
  padding: .18rem .34rem;
  border-radius: 999px;
  border-color: rgba(66, 94, 171, .2);
  font-size: .76rem;
  min-height: 24px;
  line-height: 1;
}

.property-value-options .choice-option input[type='checkbox'] {
  width: 12px;
  height: 12px;
}

.property-value-options .choice-option span {
  line-height: 1.05;
}

.property-value-options-sizes .choice-option {
  min-width: 92px;
  justify-content: flex-start;
}

.property-action {
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(66, 94, 171, .14);
  background: #f2f5fc;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1;
}

.property-action:hover {
  background: var(--accent);
  color: #fff;
}

.property-footer {
  margin-top: .4rem;
}

.product-editor-form textarea[name='description'] {
  min-height: 180px;
}

.product-variants-surface .variant-table th,
.product-variants-surface .variant-table td {
  vertical-align: middle;
}

.product-variants-surface .variant-table th {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}

.product-variants-surface .variant-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.variant-table input {
  min-width: 120px;
  height: 42px;
  min-height: 42px;
}

.related-products-select {
  min-height: 220px;
}

.product-variants-surface .table-wrap,
.product-related-surface .related-products-select {
  border-radius: 12px;
}

.product-variants-surface .actions-cell .ghost-btn {
  min-width: 82px;
}

.seo-preview-card {
  display: grid;
  gap: .2rem;
  border: 1px solid rgba(66, 94, 171, .14);
  border-radius: 12px;
  padding: .72rem .82rem;
  background: #f8faff;
}

.seo-preview-card span {
  color: #149c66;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.seo-preview-card strong {
  color: #1b3f93;
  font-size: 1rem;
  line-height: 1.25;
}

.seo-preview-card p {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.product-save-bar {
  position: fixed;
  left: var(--sidebar-w, 280px);
  right: 0;
  bottom: 0;
  width: auto;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  border: 0;
  border-top: 1px solid rgba(66, 94, 171, .16);
  border-radius: 0;
  padding: 12px 28px;
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -16px 44px -34px rgba(24, 31, 72, .64);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}

.product-save-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.product-save-bar strong,
.product-save-bar span {
  display: block;
}

.product-save-bar strong {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .86rem;
  line-height: 1.2;
}

.product-save-bar strong::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #d88918;
  box-shadow: 0 0 0 3px rgba(216, 137, 24, .16);
}

.product-save-bar span {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.25;
}

.product-save-bar-actions {
  display: flex;
  align-items: center;
  gap: .42rem;
}

.updates-stack {
  display: grid;
  gap: 18px;
}

.update-section + .update-section {
  margin-top: 16px;
}

.update-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.update-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-muted);
}

@media (max-width: 1260px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
  .product-layout-side {
    position: static;
  }
  .property-row {
    grid-template-columns: 180px minmax(0, 1fr) 34px;
  }
  .property-row.no-action {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .product-side-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-editor-form .media-gallery-list {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }
  .media-gallery-list-product {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 980px) {
  .product-editor-surface {
    padding: .6rem;
  }

  .product-editor-hero {
    position: static;
    padding: .82rem;
  }

  .product-editor-section {
    scroll-margin-top: 96px;
  }

  .product-editor-hero-row {
    flex-direction: column;
    align-items: stretch;
  }

  .product-editor-hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .product-editor-hero-actions .accent-btn,
  .product-editor-hero-actions .ghost-btn {
    flex: 1 1 150px;
  }

  .product-editor-tabs {
    margin-left: -.1rem;
    margin-right: -.1rem;
  }

  .product-save-bar {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding-inline: 14px;
  }
}

@media (max-width: 760px) {
  .product-editor-surface {
    padding: 0;
  }

  .product-editor-hero,
  .product-layout {
    margin-left: 0;
    margin-right: 0;
  }

  .product-editor-meta {
    gap: .3rem;
  }

  .product-editor-meta > span:not(.status-chip),
  .product-editor-meta .status-chip {
    max-width: 100%;
  }

  .product-side-summary,
  .product-side-meta-grid,
  .product-pricing-grid {
    grid-template-columns: 1fr;
  }

  .product-editor-form .surface {
    padding: .72rem;
  }

  .property-row,
  .property-row.no-action {
    grid-template-columns: 1fr;
  }

  .property-key {
    border-right: 0;
    border-bottom: 1px solid rgba(66, 94, 171, .14);
  }

  .property-value {
    min-width: 0;
  }

  .property-value-options .choice-option {
    min-height: 30px;
  }

  .product-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .product-save-bar-actions {
    width: 100%;
  }

  .product-save-bar-actions .ghost-btn,
  .product-save-bar-actions .accent-btn {
    flex: 1 1 120px;
  }

  .product-media-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .product-media-footer .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .product-editor-tabs a {
    min-height: 32px;
    padding: .28rem .56rem;
    font-size: .78rem;
  }

  .product-editor-form .media-gallery-list,
  .media-gallery-list-product {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }

  .product-editor-form .media-gallery-list-product .media-thumb,
  .product-editor-form .media-gallery-list-product .media-thumb-add {
    min-height: 124px;
  }
}

.choice-fieldset {
  margin: 0;
  padding: .65rem .7rem;
  border-radius: 12px;
  border: 1px solid rgba(66, 94, 171, .2);
  display: grid;
  gap: .55rem;
}

.choice-fieldset legend {
  font-weight: 700;
  color: #253762;
  padding: 0 .3rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .45rem;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .45rem .52rem;
  border-radius: 9px;
  border: 1px solid rgba(66, 94, 171, .16);
  background: #fff;
  font-weight: 600;
  color: #2b3f6f;
}

.choice-option input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.choice-option input[type='radio'] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.promo-options {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(66, 94, 171, .16);
  border-radius: 12px;
  padding: 4px;
  background: #f7f9ff;
}

.promo-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}

.promo-option input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.promo-option:has(input:checked) {
  color: var(--ink);
  background: #fff;
}

.promo-option:hover {
  background: rgba(255, 255, 255, .72);
}

.promo-option-label {
  min-width: 0;
  display: grid;
  gap: 1px;
  color: inherit;
}

.promo-option-label strong {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.promo-option-label small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1.25;
}

.promo-option-switch {
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  position: relative;
  border-radius: 999px;
  background: var(--line);
  transition: background .14s ease;
}

.promo-option-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 58, .25);
  transition: left .14s ease;
}

.promo-option input:checked ~ .promo-option-switch {
  background: var(--accent);
}

.promo-option input:checked ~ .promo-option-switch::after {
  left: 18px;
}

.field-help {
  margin-top: 6px;
  font-size: 12px;
}

.feedback-detail-grid {
  align-items: start;
}

.feedback-status-fieldset {
  min-height: 100%;
}

.feedback-status-grid {
  grid-template-columns: 1fr;
}

.feedback-status-option {
  justify-content: flex-start;
  padding: .65rem .75rem;
  min-height: 54px;
}

.feedback-status-option .status-chip {
  min-width: 116px;
}

.storefront-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.storefront-tabs .ghost-btn.active {
  border-color: rgba(48, 50, 147, .48);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 18px rgba(48, 50, 147, .24);
}

.storefront-tab-panel.is-hidden,
.is-hidden {
  display: none !important;
}

.storefront-tab-panel > .surface {
  padding: .88rem;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(20, 35, 77, .06);
}

.storefront-tab-panel > .surface h3 {
  font-size: 1rem;
  margin-bottom: .45rem;
}

.storefront-tab-panel .split-grid {
  gap: .52rem;
}

.storefront-tab-panel .media-picker {
  padding: .55rem;
}

.storefront-tab-panel .media-picker-preview {
  padding: .45rem;
}

.storefront-tab-panel .media-picker-preview img {
  max-height: 150px;
}

.ghost-btn.compact {
  padding: .45rem .72rem;
  font-size: .88rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}

.media-card {
  border: 1px solid rgba(18,54,58,.12);
  border-radius: 12px;
  background: #fff;
  padding: .7rem;
  display: grid;
  gap: .6rem;
  align-content: start;
}

.media-preview {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(18,54,58,.1);
  background: #f3f6f6;
}

.media-preview img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  display: block;
  padding: .55rem;
  background: #f7f9fb;
}

.media-meta {
  display: grid;
  gap: .25rem;
}

.media-meta code {
  font-size: .78rem;
  color: #355255;
  background: #f4f7f7;
  border: 1px solid rgba(18,54,58,.12);
  border-radius: 8px;
  padding: .25rem .4rem;
  word-break: break-all;
}

.toggle-grid {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgba(18,54,58,.14);
  border-radius: 10px;
  padding: .55rem .65rem;
  background: #fff;
  font-weight: 600;
  color: #1f3a3d;
}

.toggle-item input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

pre {
  margin: 0;
  overflow: auto;
  padding: .8rem;
  border-radius: 10px;
  border: 1px solid rgba(18,54,58,.15);
  background: #0f1d24;
  color: #e8f2f3;
}

.auth-page {
  background:
    radial-gradient(1200px 520px at 10% -15%, rgba(48, 50, 147, .16), transparent 65%),
    radial-gradient(900px 420px at 100% 100%, rgba(91, 116, 255, .14), transparent 58%),
    linear-gradient(180deg, #f8f9ff, #eef1fb);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(620px, 100%);
  border: 1px solid rgba(18, 54, 58, .14);
  border-radius: 24px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 16px 48px rgba(18, 33, 39, .12);
  padding: clamp(1.1rem, 2.2vw, 2rem);
  display: grid;
  gap: .9rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #303293, var(--accent));
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
}

.auth-brand.auth-brand-center {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  text-align: center;
  margin-top: .15rem;
}

.auth-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.auth-brand-logo.auth-brand-logo-xl {
  width: clamp(120px, 22vw, 188px);
  height: clamp(86px, 14vw, 124px);
}

.auth-brand-copy {
  display: grid;
  gap: .1rem;
}

.auth-brand-copy strong {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: #202b53;
}

.auth-brand-copy span {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: #5e6887;
}

.auth-brand-bottom {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: .01em;
  color: #202b53;
  line-height: 1.05;
}

.auth-title {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.02;
  margin-top: .15rem;
}

.auth-subtitle {
  margin: 0;
  color: #4f6265;
  font-size: 1.02rem;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: .95rem;
}

.auth-field {
  display: grid;
  gap: .42rem;
  color: #213b3d;
  font-size: 1.02rem;
  font-weight: 700;
}

.auth-field input {
  border-radius: 16px;
  border-color: rgba(18, 54, 58, .2);
  padding: .9rem 1rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.auth-field input:focus {
  border-color: rgba(48, 50, 147, .58);
  outline: none;
  box-shadow: 0 0 0 3px rgba(48, 50, 147, .14);
}

.auth-submit {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: .2rem;
}

.auth-hint {
  margin: .15rem 0 0;
  color: #607072;
  font-size: .95rem;
  line-height: 1.45;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: .75rem;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
}

.template-card h2 {
  font-size: clamp(1.45rem, 1.2rem + .5vw, 2rem);
  line-height: 1.1;
}

.template-card-meta {
  display: grid;
  gap: .46rem;
  min-width: 0;
  flex: 1;
  align-content: start;
}

.template-card-meta p {
  margin: 0;
}

.template-card-meta .subtle {
  line-height: 1.35;
}

.template-card-actions {
  margin-top: auto;
  padding-top: .15rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.template-card-actions .accent-btn,
.template-card-actions .ghost-btn {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.template-card-actions form {
  width: 100%;
  display: flex;
}

.template-card-actions form .ghost-btn {
  width: 100%;
}

.template-file {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid rgba(66, 94, 171, .18);
  border-radius: 9px;
  padding: .2rem .5rem;
  background: #f7f9ff;
  color: #2c3f73;
  font-family: var(--font-mono);
  font-size: .86rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.template-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-width: 0;
  max-width: 100%;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(66, 94, 171, .18);
  border-radius: 999px;
  background: #f7f9ff;
  color: #2b3f6f;
  padding: .18rem .52rem;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.filter-manager-page {
  gap: .8rem;
}

.filter-manager-note {
  padding: .85rem;
}

.filter-manager-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(420px, 1fr);
  gap: .75rem;
  align-items: start;
}

.filter-list-surface,
.filter-details-surface {
  padding: .85rem;
}

.filter-list-table {
  min-width: 1080px;
  table-layout: fixed;
}

.filter-list-table th:nth-child(1) { width: 16%; }
.filter-list-table th:nth-child(2) { width: 34%; }
.filter-list-table th:nth-child(3) { width: 8%; }
.filter-list-table th:nth-child(4) { width: 10%; }
.filter-list-table th:nth-child(5) { width: 10%; }
.filter-list-table th:nth-child(6) { width: 10%; }
.filter-list-table th:nth-child(7) { width: 12%; }

.filter-list-table th:nth-child(3),
.filter-list-table th:nth-child(4),
.filter-list-table th:nth-child(5),
.filter-list-table th:nth-child(6),
.filter-list-table th:nth-child(7),
.filter-list-table td:nth-child(3),
.filter-list-table td:nth-child(4),
.filter-list-table td:nth-child(5),
.filter-list-table td:nth-child(6),
.filter-list-table td:nth-child(7) {
  white-space: nowrap;
}

.filter-list-table td .status-chip {
  flex-shrink: 0;
}

.filter-row td {
  padding-top: .62rem;
  padding-bottom: .62rem;
}

.filter-row.is-selected {
  background: #eef2ff;
}

.filter-row-open {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.filter-row-meta {
  margin-top: .2rem;
  font-family: var(--font-mono);
  font-size: .78rem;
}

.filter-row-usage {
  margin: .32rem 0 0;
  font-size: .82rem;
  line-height: 1.3;
}

.filter-row-action {
  text-align: right;
  white-space: nowrap;
}

.filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.filter-chip-list .token-chip {
  font-size: .76rem;
  padding: .16rem .46rem;
}

.filter-detail-card {
  border-style: dashed;
  border-color: rgba(66, 94, 171, .24);
  background: linear-gradient(180deg, #fff, #fbfcff);
  padding: .8rem;
  box-shadow: none;
}

.filter-detail-card h3 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.filter-detail-card select[multiple] {
  min-height: 138px;
}

.filter-detail-usage {
  margin-top: .3rem;
  border-top: 1px dashed rgba(66, 94, 171, .26);
  padding-top: .55rem;
  display: grid;
  gap: .52rem;
}

.filter-detail-usage p {
  margin: 0;
}

.filter-usage-examples {
  display: grid;
  gap: .3rem;
  font-size: .9rem;
}

.filter-usage-examples ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: .16rem;
}

.filter-option-stats table {
  min-width: 100%;
}

.filter-option-stats th,
.filter-option-stats td {
  padding: .48rem .56rem;
  font-size: .86rem;
}

.filter-detail-empty {
  border-style: dashed;
}

.filter-group-card {
  padding: .9rem;
  border-style: dashed;
  border-color: rgba(66, 94, 171, .24);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.license-info {
  border-style: dashed;
  border-color: rgba(66, 94, 171, .3);
}

.admin-footer {
  border-top: 1px solid rgba(66, 94, 171, .16);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(10px);
  padding: .72rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}

.admin-footer-meta {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .55rem;
  color: #56648a;
  font-size: .93rem;
}

.admin-footer-meta strong {
  color: #202f5c;
  font-size: .97rem;
  font-weight: 800;
}

.admin-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
    position: relative;
    overflow-x: clip;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 300px);
    height: 100vh;
    border-right: 1px solid rgba(173, 189, 255, .2);
    border-bottom: 0;
    transform: translateX(-108%);
    transition: transform .22s ease, box-shadow .22s ease;
    z-index: 70;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .admin-shell.is-nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 0 24px 44px rgba(8, 14, 36, .44);
  }
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(8, 14, 36, .44);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 60;
  }
  .admin-shell.is-nav-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .admin-main {
    min-height: 100vh;
  }
  .admin-mobile-nav-toggle {
    display: inline-flex;
  }
  .split-grid { grid-template-columns: 1fr; }
  .order-summary-grid { grid-template-columns: 1fr 1fr; }
  .orders-summary-grid { grid-template-columns: 1fr 1fr; }
  .product-main-grid,
  .product-side-meta-grid {
    grid-template-columns: 1fr;
  }
  .field-span-2 {
    grid-column: auto;
  }
  .property-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }
  .property-row.no-action {
    grid-template-columns: minmax(0, 1fr);
  }
  .property-key,
  .property-value {
    grid-column: 1 / 2;
  }
  .property-row.no-action .property-key,
  .property-row.no-action .property-value {
    grid-column: auto;
  }
  .property-key {
    border-bottom: 1px solid rgba(255, 255, 255, .22);
  }
  .property-action {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
  }
  .property-value-options .choice-option {
    font-size: .74rem;
  }
  .media-input-row { grid-template-columns: 1fr; }
  .admin-topbar {
    padding: .8rem .9rem;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .admin-workspace {
    padding: .9rem;
    min-width: 0;
  }
  .admin-topbar-leading {
    width: 100%;
  }
  .admin-topbar .form-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .admin-footer {
    padding: .72rem .9rem;
  }
  .filter-manager-layout {
    grid-template-columns: 1fr;
  }
  .filter-list-table {
    min-width: 920px;
  }
  .auth-shell { padding: .7rem; }
  .auth-card { border-radius: 18px; }
  .auth-title { font-size: 2.2rem; }
}

@media (max-width: 760px) {
  .media-modal-dialog {
    width: calc(100vw - .55rem);
    height: calc(100vh - .55rem);
    border-radius: 10px;
  }
  .media-modal-head {
    padding: .52rem .56rem;
  }
  .media-modal-head .ghost-btn {
    min-height: 32px;
    padding: .34rem .54rem;
    font-size: .8rem;
  }
  .surface {
    padding: .82rem;
    border-radius: 14px;
  }
  .surface h1 {
    font-size: clamp(1.55rem, 1.35rem + 1.4vw, 2.1rem);
  }
  .surface h2 {
    font-size: clamp(1.18rem, 1.06rem + .65vw, 1.5rem);
  }
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .table-wrap table,
  .products-inline-editor .table-wrap table,
  .filter-list-table,
  .filter-option-stats table {
    min-width: 0 !important;
    width: 100%;
    border-spacing: 0;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }
  .table-wrap tbody {
    display: grid;
    gap: .48rem;
  }
  .table-wrap tr {
    border: 1px solid rgba(66, 94, 171, .16);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }
  .table-wrap tbody tr:hover {
    background: #fff;
  }
  .table-wrap td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .55rem;
    padding: .5rem .62rem;
    border-bottom: 1px dashed rgba(66, 94, 171, .16);
    min-height: 44px;
  }
  .table-wrap td:last-child {
    border-bottom: 0;
  }
  .table-wrap td::before {
    content: attr(data-label);
    color: #5d6a8d;
    font-size: .73rem;
    line-height: 1.25;
    font-weight: 760;
    text-transform: uppercase;
    letter-spacing: .045em;
    flex: 0 0 43%;
    max-width: 43%;
    padding-top: .08rem;
  }
  .table-wrap td[data-label=""]::before {
    display: none;
  }
  .table-wrap td > * {
    min-width: 0;
  }
  .table-wrap td .status-chip {
    flex-shrink: 0;
  }
  .order-summary-grid {
    grid-template-columns: 1fr;
  }
  .orders-summary-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap td .actions-cell,
  .table-wrap td.actions-cell,
  .table-wrap td .actions-cell-inline,
  .table-wrap td.actions-cell-inline {
    width: 100%;
    justify-content: flex-end;
  }
  .table-wrap td .inline-slug-input {
    justify-content: flex-end;
    text-align: right;
  }
  .table-wrap td .inline-slug-prefix {
    display: none;
  }
  .table-wrap td .inline-input,
  .table-wrap td input,
  .table-wrap td select,
  .table-wrap td textarea {
    text-align: right;
  }
  .table-wrap td .title-edit-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .table-wrap td .title-edit-actions {
    justify-content: flex-end;
  }
  .admin-mobile-nav-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .breadcrumbs {
    font-size: .94rem;
  }
  .admin-topbar .form-actions {
    gap: .45rem;
  }
  .admin-topbar .form-actions .accent-btn,
  .admin-topbar .form-actions .ghost-btn {
    min-height: 38px;
    padding: .46rem .74rem;
    font-size: .86rem;
  }
  .admin-footer {
    gap: .52rem;
  }
  .admin-footer-meta,
  .admin-footer-actions {
    width: 100%;
    justify-content: space-between;
  }
  .filter-list-table {
    min-width: 0;
  }
}

/* =========================================================
   Atank CMS admin refresh from door storefront visual language
   Keeps existing PHP views/routes and only changes presentation.
   ========================================================= */
:root {
  --font-sans: 'Manrope', 'Segoe UI Variable Text', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --door-primary: #0c1427;
  --door-primary-2: #243047;
  --door-secondary: #4b5563;
  --door-accent: #f0823f;
  --door-accent-soft: #fdf3e7;
  --door-surface: #f7f8fb;
  --bg: #f7f8fb;
  --surface: rgba(255, 255, 255, .92);
  --line: rgba(15, 23, 42, .10);
  --text: var(--door-primary);
  --muted: var(--door-secondary);
  --accent: var(--door-primary);
  --accent-strong: #0a1021;
  --accent-soft: var(--door-accent-soft);
  --accent-glow: rgba(240, 130, 63, .20);
  --ink: var(--door-primary);
  --success: #149c66;
  --warning: #ce8c20;
  --danger: #cc464f;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 20% 15%, rgba(240, 130, 63, .06), transparent 32%),
    radial-gradient(circle at 85% 8%, rgba(12, 20, 39, .05), transparent 38%),
    var(--door-surface);
  letter-spacing: 0;
  overflow-x: hidden;
}

h1, h2, h3 {
  color: var(--door-primary);
  letter-spacing: 0;
}

.admin-shell {
  grid-template-columns: 288px minmax(0, 1fr);
  overflow-x: hidden;
}

.admin-sidebar {
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--door-primary);
  background: rgba(255, 255, 255, .84);
  border-right: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 18px 0 42px -38px rgba(12, 20, 39, .35);
}

.admin-brand {
  min-height: 96px;
  margin: 0;
  padding: 18px 20px;
  gap: 14px;
  color: var(--door-primary);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  background: rgba(255, 255, 255, .42);
}

.admin-brand-logo {
  width: 64px;
  height: 46px;
  flex: 0 0 64px;
  object-fit: contain;
}

.admin-brand-text {
  display: grid;
  gap: 2px;
}

.admin-brand-text strong {
  color: var(--door-primary);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.admin-brand-text span {
  color: #7c8797;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.sidebar-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, .16) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, .16);
  border-radius: 999px;
}

.nav-group {
  margin-top: 16px;
}

.nav-group:first-child {
  margin-top: 4px;
}

.nav-group h4 {
  margin: 0 12px 7px;
  color: #9aa3b2;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.nav-link {
  margin: 2px 0;
  padding: 10px 12px;
  gap: 12px;
  color: var(--door-primary-2);
  border: 0;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.nav-link:hover {
  color: var(--door-primary);
  background: rgba(240, 130, 63, .10);
  border-color: transparent;
  transform: translateX(2px);
}

.nav-link-icon {
  color: inherit;
}

.nav-link-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.nav-link.active {
  color: #fff;
  background: var(--door-primary);
  border: 0;
  box-shadow: 0 14px 28px -18px rgba(12, 20, 39, .55);
}

.nav-link.active .nav-link-icon {
  color: #fff;
}

.sidebar-user {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-top: 1px solid rgba(15, 23, 42, .06);
  background: rgba(255, 255, 255, .5);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--door-primary);
  border-radius: 50%;
  font-size: .88rem;
  font-weight: 800;
}

.sidebar-user .u-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-user .u-meta b,
.sidebar-user .u-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .u-meta b {
  color: var(--door-primary);
  font-size: .88rem;
}

.sidebar-user .u-meta span {
  color: var(--muted);
  font-size: .74rem;
}

.admin-main {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.admin-topbar {
  min-height: 64px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .76);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  backdrop-filter: blur(18px);
}

.breadcrumbs {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.admin-workspace {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 24px;
  gap: 18px;
}

.surface,
.detail-card,
.template-card,
.filter-list-surface,
.filter-details-surface {
  border-color: rgba(255, 255, 255, .65);
  background: rgba(255, 255, 255, .90);
  box-shadow:
    0 24px 48px -32px rgba(12, 20, 39, .25),
    0 10px 24px -20px rgba(240, 130, 63, .20);
  backdrop-filter: blur(18px);
}

.surface {
  border-radius: 18px;
}

.surface-head {
  align-items: flex-start;
}

.surface h1 {
  font-size: clamp(1.75rem, 1.55rem + .75vw, 2.45rem);
  font-weight: 800;
}

.surface h2 {
  font-size: clamp(1.16rem, 1.08rem + .35vw, 1.55rem);
  font-weight: 800;
}

.subtle {
  color: var(--muted);
}

.table-wrap {
  border-color: rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .72);
  box-shadow: none;
}

th {
  color: #727c8f;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

td {
  color: var(--door-primary-2);
}

tbody tr:hover {
  background: rgba(240, 130, 63, .06);
}

input,
textarea,
select {
  border-color: rgba(15, 23, 42, .14);
  background: #fff;
  color: var(--door-primary);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(240, 130, 63, .68);
  box-shadow: 0 0 0 3px rgba(240, 130, 63, .14);
}

.accent-btn {
  color: #fff;
  background: var(--door-primary);
  box-shadow: 0 14px 28px -18px rgba(12, 20, 39, .55);
}

.accent-btn:hover {
  background: #0a1021;
}

.ghost-btn {
  color: var(--door-primary);
  border-color: rgba(15, 23, 42, .14);
  background: rgba(255, 255, 255, .82);
}

.ghost-btn:hover {
  border-color: rgba(240, 130, 63, .45);
  background: var(--door-accent-soft);
}

.text-link {
  color: var(--door-accent);
}

.text-link:hover {
  color: #d66528;
}

.status-chip {
  letter-spacing: 0;
}

.auth-page {
  background:
    radial-gradient(circle at 20% 15%, rgba(240, 130, 63, .08), transparent 34%),
    radial-gradient(circle at 85% 8%, rgba(12, 20, 39, .06), transparent 40%),
    var(--door-surface);
}

.auth-card {
  background: rgba(255, 255, 255, .90);
  border: 1px solid rgba(255, 255, 255, .68);
  box-shadow:
    0 24px 48px -32px rgba(12, 20, 39, .25),
    0 10px 24px -20px rgba(240, 130, 63, .20);
}

.auth-brand-logo.auth-brand-logo-xl {
  width: 124px;
  height: 90px;
}

.auth-brand-bottom,
.auth-title {
  color: var(--door-primary);
}

@media (min-width: 761px) and (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 288px minmax(0, 1fr);
    overflow-x: hidden;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    height: 100vh;
    transform: none;
    transition: none;
    z-index: auto;
    overflow: hidden;
  }

  .admin-sidebar-backdrop {
    display: none;
  }

  .admin-mobile-nav-toggle {
    display: none;
  }
}

@media (max-width: 760px) {
  .admin-workspace {
    padding: 16px;
  }

  .admin-sidebar {
    background: rgba(255, 255, 255, .96);
  }
}

/* =========================================================
   ATANK CMS · v2 from claude-design/index.html
   ========================================================= */
:root {
  --brand: #303293;
  --brand-700: #23247a;
  --brand-500: #4f51b3;
  --brand-300: #8285d6;
  --brand-100: #e4e5f8;
  --brand-050: #f1f1fb;
  --accent: #0f9b8e;
  --accent-100: #d8f1ee;
  --bg: #eef0f6;
  --bg-elev: #f5f6fb;
  --surface: #fff;
  --surface-2: #f8f9fc;
  --ink: #14183a;
  --ink-2: #2a2f55;
  --muted: #6a7092;
  --muted-2: #9ea4c1;
  --line: #dfe2ee;
  --line-2: #eaecf4;
  --ok: #0e8150;
  --ok-bg: #d8f2e4;
  --warn: #a3590c;
  --warn-bg: #fbe6c8;
  --err: #b42b3c;
  --err-bg: #fadcdf;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --rad: 14px;
  --rad-lg: 18px;
  --rad-sm: 10px;
  --sidebar-w: 280px;
  --topbar-h: 64px;
  --font-sans: var(--font);
  --font-mono: var(--mono);
  --text: var(--ink);
  --border: var(--line);
  --accent-strong: var(--brand-700);
  --accent-soft: var(--brand-050);
  --accent-glow: rgba(48, 50, 147, .16);
  --success: var(--ok);
  --warning: var(--warn);
  --danger: var(--err);
  --door-primary: var(--ink);
  --door-primary-2: var(--ink-2);
  --door-accent: var(--brand);
  --door-accent-soft: var(--brand-050);
  --door-surface: var(--bg);
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--bg);
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0;
  color: var(--ink);
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  z-index: 50;
}

.admin-brand {
  min-height: 91px;
  margin: 0;
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}

.admin-brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
}

.admin-brand-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-brand-text strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
}

.admin-brand-text span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.sidebar-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.nav-group {
  margin-top: 16px;
}

.nav-group:first-child {
  margin-top: 6px;
}

.nav-group h4 {
  margin: 0 12px 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .13em;
}

.nav-link {
  position: relative;
  margin: 2px 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  border: 0;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(48, 50, 147, .11);
}

.nav-link:hover .nav-link-icon {
  color: inherit;
}

.nav-link-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  color: inherit;
}

.nav-link svg,
.nav-link-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
  opacity: .8;
  stroke-width: 1.75;
}

.nav-link-label {
  min-width: 0;
}

.nav-link.active {
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(48, 50, 147, .6);
}

.nav-link.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  color: var(--brand);
  background: var(--brand-100);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.nav-link.active .nav-badge {
  color: #fff;
  background: rgba(255, 255, 255, .22);
}

.sidebar-user {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-top: 1px solid var(--line-2);
}

.u-logout {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  margin-left: auto;
  transition: background .12s, color .12s;
}

.u-logout:hover {
  background: var(--err-bg);
  color: var(--err);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand));
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-user .u-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.sidebar-user .u-meta b {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .u-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  grid-column: 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-h);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: rgba(245, 246, 251, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.admin-topbar-leading {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs::before {
  content: "Атанк CMS ›";
  color: var(--muted);
  font-weight: 500;
}

.topbar-search {
  position: relative;
  width: 340px;
  max-width: 40vw;
  margin-left: auto;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 50px 0 36px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  outline: none;
}

.topbar-search input::placeholder {
  color: var(--muted-2);
}

.topbar-search input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(48, 50, 147, .12);
}

.topbar-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.topbar-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  transform: translateY(-50%);
}

.admin-topbar .form-actions {
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-topbar .form-actions form {
  display: inline-flex;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}

.icon-btn:hover {
  background: var(--brand-050);
  border-color: var(--brand-500);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.accent-btn,
.btn-primary {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 10px;
  box-shadow: 0 6px 16px -6px rgba(48, 50, 147, .6);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}

.accent-btn:hover,
.btn-primary:hover {
  color: #fff;
  background: var(--brand-700);
  border-color: var(--brand-700);
}

.ghost-btn,
.btn-ghost {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}

.ghost-btn:hover,
.btn-ghost:hover {
  color: var(--ink);
  background: var(--brand-050);
  border-color: var(--brand-500);
}

.ghost-btn.danger {
  color: var(--err);
  border-color: var(--err-bg);
  background: #fff;
}

.ghost-btn.danger:hover {
  color: #fff;
  border-color: var(--err);
  background: var(--err);
}

.accent-btn svg,
.ghost-btn svg,
.btn-ghost svg {
  width: 15px;
  height: 15px;
}

.admin-workspace {
  width: 100%;
  min-width: 0;
  padding: 22px 24px 40px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rad-lg);
}

.hero::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  pointer-events: none;
  background: radial-gradient(circle at center, var(--brand-100), transparent 70%);
  border-radius: 50%;
}

.hero-text,
.hero-quick {
  position: relative;
}

.hero h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero p b {
  color: var(--ink-2);
  font-weight: 700;
}

.hero-quick {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.wave {
  display: inline-block;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.kpi:hover {
  border-color: rgba(48, 50, 147, .2);
  box-shadow: 0 10px 26px -16px rgba(22, 25, 58, .25);
  transform: translateY(-1px);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.kpi-label svg {
  width: 14px;
  height: 14px;
}

.kpi-value {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-feature-settings: "tnum" 1;
}

.kpi-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-delta {
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.kpi-delta.up {
  color: var(--ok);
  background: var(--ok-bg);
}

.kpi-delta.dn {
  color: var(--err);
  background: var(--err-bg);
}

.kpi-spark {
  position: absolute;
  right: 14px;
  top: 16px;
  opacity: .85;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.grid-orders {
  display: block;
}

.card,
.surface {
  padding: 18px 20px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rad-lg);
  box-shadow: none;
}

.card-head,
.surface-head {
  margin-bottom: 14px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0;
}

.card-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.card-title h2,
.surface h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.surface h1,
.auth-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.card-title .sub,
.subtle,
.surface-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.card-tabs {
  padding: 3px;
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.card-tabs button {
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.card-tabs button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(22, 25, 58, .08);
}

.chart-wrap {
  position: relative;
}

.chart {
  width: 100%;
  height: 240px;
  display: block;
}

.chart-legend {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-weight: 600;
}

.legend-dot i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.quick-list {
  display: grid;
  gap: 8px;
}

.quick-row {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: border-color .15s, background .15s, transform .12s;
}

.quick-row:hover {
  background: var(--brand-050);
  border-color: var(--brand-500);
  transform: translateX(2px);
}

.quick-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-100);
  border-radius: 9px;
}

.quick-icon.warm {
  color: var(--accent);
  background: var(--accent-100);
}

.quick-icon svg {
  width: 17px;
  height: 17px;
}

.quick-row .qt b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.quick-row .qt span {
  color: var(--muted);
  font-size: 11.5px;
}

.quick-row .qk {
  padding: 2px 6px;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
}

.stock-count {
  color: var(--warn);
  font-size: 13px;
}

.stock-list {
  margin: 0 -4px;
  display: grid;
  gap: 2px;
}

.stock-item {
  padding: 9px 6px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  border-radius: 9px;
  transition: background .12s;
}

.stock-item:hover {
  background: var(--bg);
}

.sku-thumb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--brand-500);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}

.sku-thumb svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.stock-item .t {
  min-width: 0;
}

.stock-item .t b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-item .t span {
  color: var(--muted);
  font-size: 11.5px;
}

.stock-qty {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.stock-pill {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stock-pill.low {
  color: var(--warn);
  background: var(--warn-bg);
}

.stock-pill.out {
  color: var(--err);
  background: var(--err-bg);
}

.table-wrap {
  overflow-x: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.table,
.table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.table th,
.table td,
.table-wrap th,
.table-wrap td {
  padding: 12px 10px;
  color: var(--ink-2);
  text-align: left;
  vertical-align: middle;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.table th,
.table-wrap th {
  padding-top: 0;
  padding-bottom: 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.table tbody tr:hover,
.table-wrap tbody tr:hover {
  background: var(--bg);
}

.table tbody tr:last-child td,
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table td.num,
.table-wrap td.num,
.table-wrap td:nth-child(4),
.table-wrap td:nth-child(5) {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1;
}

.order-id,
.table-wrap td:first-child strong {
  color: var(--brand);
  font-family: var(--mono);
  font-weight: 700;
}

.cust {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cust .avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 11px;
}

.chip,
.status-chip {
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
}

.chip::before,
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: currentColor;
  border-radius: 50%;
}

.chip.ok,
.chip.success,
.status-chip.ok,
.status-chip.success {
  color: var(--ok);
  background: var(--ok-bg);
}

.chip.warn,
.chip.warning,
.status-chip.warn,
.status-chip.warning {
  color: var(--warn);
  background: var(--warn-bg);
}

.chip.err,
.chip.danger,
.status-chip.err,
.status-chip.danger {
  color: var(--err);
  background: var(--err-bg);
}

.chip.info,
.status-chip.info {
  color: var(--brand);
  background: var(--brand-100);
}

.chip.neu,
.chip.neutral,
.status-chip.neu,
.status-chip.neutral {
  color: var(--ink-2);
  background: var(--line-2);
}

.text-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: var(--brand-700);
}

.admin-footer {
  padding: 12px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line-2);
  background: transparent;
  backdrop-filter: none;
}

.admin-footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.admin-footer-meta strong {
  color: var(--ink-2);
  font-weight: 700;
}

.admin-footer-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  color: var(--brand-700);
  background: rgba(48, 50, 147, .08);
  border: 1px solid rgba(48, 50, 147, .14);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.fade-in {
  animation: fi .45s ease both;
}

.fade-in.d1 { animation-delay: .04s; }
.fade-in.d2 { animation-delay: .08s; }
.fade-in.d3 { animation-delay: .12s; }
.fade-in.d4 { animation-delay: .16s; }
.fade-in.d5 { animation-delay: .2s; }

@keyframes fi {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dashboard-home-grid {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard-home-grid > .card {
  min-width: 0;
  align-self: start;
}

.dashboard-quick-card .quick-list {
  align-content: start;
}

.recent-list {
  margin: 0 -4px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.recent-row {
  padding: 9px 6px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  max-height: 64px;
  overflow: hidden;
  color: var(--ink);
  border-radius: 9px;
  transition: background .12s;
}

.recent-row:hover {
  background: var(--bg);
}

.recent-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-100);
  border-radius: 9px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.recent-row svg,
.recent-icon svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
}

.recent-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.recent-meta b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-content-card {
  grid-column: 1 / -1;
}

.content-counts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-counts a {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.content-counts b {
  color: var(--brand);
  font-family: var(--mono);
}

.content-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.content-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.content-column h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.content-row {
  padding: 8px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 700;
}

.content-row:last-child {
  border-bottom: 0;
}

.content-row:hover {
  color: var(--brand);
}

.content-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-row small {
  overflow: hidden;
  max-width: 180px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-main,
  .dashboard-home-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-quick-card,
  .dashboard-content-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  /* override block-1 which hides sidebar via fixed+transform at ≤980px */
  .admin-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    overflow-x: unset;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    transform: none;
    z-index: 50;
    overflow: hidden;
    box-shadow: none;
  }

  .admin-sidebar-backdrop {
    display: none !important;
  }

  .admin-mobile-nav-toggle {
    display: none;
  }

  .admin-topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .admin-topbar-leading,
  .admin-topbar .form-actions,
  .topbar-search {
    width: 100%;
  }

  .topbar-search {
    max-width: none;
    margin-left: 0;
    order: 2;
  }

  .admin-topbar .form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-w: 64px;
  }

  .admin-brand-text,
  .nav-link-label,
  .nav-link > span:not(.nav-link-icon):not(.nav-badge),
  .nav-group h4,
  .sidebar-user .u-meta {
    display: none;
  }

  .admin-brand {
    min-height: auto;
    justify-content: center;
    padding: 14px 0;
  }

  .admin-brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .sidebar-scroll {
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-link {
    justify-content: center;
    padding: 10px;
  }

  .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 0 4px;
    font-size: 9px;
  }

  .sidebar-user {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-topbar {
    position: static;
  }

  .admin-mobile-nav-toggle {
    display: inline-flex;
  }

  .admin-workspace {
    padding: 16px;
  }

  .hero,
  .card-head,
  .surface-head {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .hero {
    display: grid;
  }

  .hero-quick {
    justify-content: flex-start;
  }

  .kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-home-grid,
  .content-columns {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-card,
  .dashboard-content-card {
    grid-column: auto;
  }

  .recent-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .recent-row .chip {
    grid-column: 2;
    justify-self: start;
  }

  .content-counts {
    width: 100%;
  }
}

/* =========================================================
   ATANK CMS · layout polish for forms and responsive views
   ========================================================= */
.surface,
.card {
  max-width: 100%;
}

.surface-head,
.card-head {
  min-height: 42px;
  align-items: flex-start;
}

.surface-head > div,
.card-title {
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.split-grid,
.product-editor-form {
  gap: 16px;
}

label,
.auth-field {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 40px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

textarea {
  width: 100%;
  min-height: 118px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(48, 50, 147, .12);
}

input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.form-actions form {
  display: inline-flex;
}

.accent-btn,
.ghost-btn,
.btn-ghost,
.icon-btn {
  flex: 0 0 auto;
}

.accent-btn,
.ghost-btn,
.btn-ghost {
  min-height: 38px;
  white-space: nowrap;
}

.products-filter-bar {
  margin: 14px -20px 0;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, max-content));
  align-items: center;
  gap: 8px;
}

.products-filter-bar input[type="search"] {
  width: 100% !important;
  min-width: 0;
}

.products-filter-bar select {
  width: auto !important;
  min-width: 140px;
}

.dashboard-home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.dashboard-home-grid > .card:not(.dashboard-content-card) {
  height: 100%;
  min-height: 224px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-self: stretch;
}

.dashboard-home-grid .quick-list,
.dashboard-home-grid .stock-list,
.dashboard-home-grid .recent-list {
  align-content: start;
}

.quick-row,
.stock-item,
.recent-row {
  min-height: 56px;
  max-height: 56px;
  overflow: hidden;
}

.quick-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.quick-row .qt,
.stock-item .t,
.recent-meta {
  min-width: 0;
}

.quick-row .qt b,
.stock-item .t b,
.recent-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-row .qt span,
.stock-item .t span,
.recent-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-item {
  grid-template-columns: 36px minmax(0, 1fr) 32px 44px;
}

.stock-qty {
  text-align: right;
}

.stock-pill,
.chip,
.status-chip {
  justify-self: end;
}

.recent-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.content-row {
  min-height: 38px;
  align-items: center;
}

.table-wrap {
  max-width: 100%;
}

.table-wrap table,
.table {
  table-layout: auto;
}

@media (max-width: 1320px) {
  .dashboard-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-quick-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .products-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-filter-bar select {
    width: 100% !important;
  }
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .admin-workspace {
    padding: 18px;
    gap: 16px;
  }

  .admin-topbar {
    align-items: flex-start;
  }

  .admin-topbar .form-actions {
    flex-wrap: wrap;
  }

  .dashboard-home-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-card,
  .dashboard-content-card {
    grid-column: auto;
  }

  .dashboard-home-grid > .card:not(.dashboard-content-card) {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .surface,
  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .surface-head,
  .card-head {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .surface-head .form-actions,
  .card-head .form-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .split-grid,
  .product-editor-form,
  .content-columns {
    grid-template-columns: 1fr !important;
  }

  .field-span-2 {
    grid-column: auto !important;
  }

  .products-filter-bar {
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px;
    grid-template-columns: 1fr;
  }

  .form-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .form-actions .accent-btn,
  .form-actions .ghost-btn,
  .form-actions .btn-ghost {
    flex: 1 1 150px;
  }

  .admin-topbar .form-actions .accent-btn,
  .admin-topbar .form-actions .ghost-btn {
    flex: 1 1 140px;
  }

  .topbar-search kbd {
    display: none;
  }

  .topbar-search input {
    padding-right: 12px;
  }

  .hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .quick-row,
  .stock-item,
  .recent-row {
    max-height: none;
  }

  .stock-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .stock-pill {
    grid-column: 2;
    justify-self: start;
  }

  .stock-qty {
    justify-self: end;
  }

  .content-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .content-row small {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .admin-workspace {
    padding: 12px;
  }

  .admin-topbar {
    padding: 10px 12px;
    gap: 10px;
  }

  .breadcrumbs {
    max-width: 100%;
  }

  .admin-topbar .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-topbar .icon-btn {
    width: 100%;
  }

  .admin-topbar .form-actions form,
  .admin-topbar .form-actions form .ghost-btn {
    width: 100%;
  }

  .hero-quick {
    width: 100%;
  }

  .hero-quick .btn-ghost {
    flex: 1 1 130px;
  }

  .quick-row,
  .recent-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .quick-row .qk,
  .recent-row .chip {
    grid-column: 2;
    justify-self: start;
  }
}

.storefront-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.storefront-tabs .ghost-btn.compact {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.storefront-tabs .ghost-btn.compact:hover {
  color: var(--brand);
  background: var(--brand-050);
  border-color: var(--brand-300);
}

.storefront-tabs .ghost-btn.compact.active,
.storefront-tabs .ghost-btn.compact[aria-selected="true"] {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 18px -10px rgba(48, 50, 147, .75);
}

.storefront-tabs-root {
  gap: 16px;
}

.storefront-tab-panel {
  display: grid;
  gap: 16px;
}

.storefront-tab-panel > h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.toggle-item {
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

.toggle-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--brand);
}

.publish-toggle {
  width: min(100%, 460px);
  align-self: start;
}

.publish-toggle input[type="checkbox"] {
  margin: 0;
  align-self: flex-start;
}

@media (max-width: 760px) {
  .storefront-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storefront-tabs .ghost-btn.compact {
    width: 100%;
  }

  .toggle-grid {
    grid-template-columns: 1fr;
  }
}

/* Final polish: topbar search and table headers */
.admin-topbar .topbar-search input[type="search"],
.admin-topbar .topbar-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  height: 38px;
  min-height: 38px;
  padding-left: 40px;
  padding-right: 54px;
  line-height: 38px;
}

.topbar-search svg {
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, color .14s ease;
}

.topbar-search:focus-within svg {
  color: var(--brand);
}

.topbar-search:has(input:not(:placeholder-shown)) svg {
  opacity: 0;
  transform: translateY(-50%) scale(.82);
}

.topbar-search:has(input:not(:placeholder-shown)) input[type="search"] {
  padding-left: 14px;
}

.table thead tr,
.table-wrap thead tr {
  min-height: 40px;
}

.table th,
.table-wrap th,
th {
  height: 40px;
  padding: 0 12px;
  vertical-align: middle;
  line-height: 1.2;
  background: var(--surface-2);
}

.table td,
.table-wrap td,
td {
  vertical-align: middle;
}

@media (max-width: 760px) {
  .admin-topbar .topbar-search input[type="search"],
  .admin-topbar .topbar-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    padding-right: 12px;
  }
}

/* Local admin dark theme */
.theme-toggle {
  min-height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--brand-050);
  border-color: var(--brand-500);
}

.theme-toggle-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  color: currentColor;
}

.theme-toggle-icon svg {
  width: 16px;
  height: 16px;
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 34px;
  background: var(--line);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(20, 24, 58, .06);
  transition: background .18s, box-shadow .18s;
}

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(20, 24, 58, .22);
  transition: transform .18s, background .18s;
}

.theme-toggle-label {
  min-width: 48px;
  text-align: left;
}

html[data-admin-theme="dark"] {
  color-scheme: dark;
  --brand: #8d91ff;
  --brand-700: #aeb1ff;
  --brand-500: #777cff;
  --brand-300: #565bd5;
  --brand-100: #242a54;
  --brand-050: #191f3b;
  --accent: #46cfc3;
  --accent-100: #183d45;
  --bg: #0d1020;
  --bg-elev: #12172b;
  --surface: #171c31;
  --surface-2: #11172a;
  --ink: #f3f5ff;
  --ink-2: #dbe0f7;
  --muted: #9da7ca;
  --muted-2: #707a9c;
  --line: #2b334e;
  --line-2: #222a43;
  --ok: #62d99d;
  --ok-bg: #123e2d;
  --warn: #f2b363;
  --warn-bg: #442a12;
  --err: #ff7b8d;
  --err-bg: #4a1f2a;
  --text: var(--ink);
  --border: var(--line);
  --accent-strong: var(--brand-700);
  --accent-soft: var(--brand-050);
  --accent-glow: rgba(141, 145, 255, .22);
  --success: var(--ok);
  --warning: var(--warn);
  --danger: var(--err);
  --door-primary: var(--ink);
  --door-primary-2: var(--ink-2);
  --door-secondary: var(--muted);
  --door-accent: var(--brand);
  --door-accent-soft: var(--brand-050);
  --door-surface: var(--bg);
}

html[data-admin-theme="dark"] body {
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 18% -16%, rgba(141, 145, 255, .14), transparent 62%),
    radial-gradient(760px 480px at 96% 8%, rgba(70, 207, 195, .10), transparent 56%),
    var(--bg);
}

html[data-admin-theme="dark"] h1,
html[data-admin-theme="dark"] h2,
html[data-admin-theme="dark"] h3 {
  color: var(--ink);
}

html[data-admin-theme="dark"] .admin-sidebar {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(23, 28, 49, .98), rgba(13, 16, 32, .98));
  border-right-color: var(--line-2);
  box-shadow: 18px 0 42px -38px rgba(0, 0, 0, .9);
}

html[data-admin-theme="dark"] .admin-brand,
html[data-admin-theme="dark"] .sidebar-user {
  color: var(--ink);
  background: rgba(255, 255, 255, .025);
  border-color: var(--line-2);
}

html[data-admin-theme="dark"] .admin-brand-text strong,
html[data-admin-theme="dark"] .sidebar-user .u-meta b {
  color: var(--ink);
}

html[data-admin-theme="dark"] .admin-brand-logo-light {
  display: none;
}

html[data-admin-theme="dark"] .admin-brand-logo-dark {
  display: block;
}

html[data-admin-theme="dark"] .admin-brand-text span,
html[data-admin-theme="dark"] .nav-group h4,
html[data-admin-theme="dark"] .sidebar-user .u-meta span {
  color: var(--muted);
}

html[data-admin-theme="dark"] .nav-link {
  color: var(--ink-2);
}

html[data-admin-theme="dark"] .nav-link:hover {
  color: var(--ink);
  background: rgba(141, 145, 255, .12);
}

html[data-admin-theme="dark"] .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #4c50c9, #24286f);
  box-shadow: 0 14px 28px -18px rgba(141, 145, 255, .75);
}

html[data-admin-theme="dark"] .avatar {
  color: #fff;
  background: linear-gradient(135deg, #4c50c9, #24286f);
}

html[data-admin-theme="dark"] .admin-topbar {
  color: var(--ink);
  background: rgba(13, 16, 32, .84);
  border-bottom-color: var(--line);
}

html[data-admin-theme="dark"] .breadcrumbs,
html[data-admin-theme="dark"] .breadcrumbs::before {
  color: var(--muted);
}

html[data-admin-theme="dark"] .breadcrumbs {
  color: var(--ink-2);
}

html[data-admin-theme="dark"] :where(.surface, .card, .detail-card, .template-card, .filter-list-surface, .filter-details-surface, .auth-card, .stat-card, .media-modal-dialog, .dashboard-content-card, .dashboard-quick-card) {
  color: var(--ink);
  background: rgba(23, 28, 49, .92);
  border-color: var(--line);
  box-shadow:
    0 24px 48px -34px rgba(0, 0, 0, .92),
    0 10px 22px -22px rgba(141, 145, 255, .45);
}

html[data-admin-theme="dark"] .table-wrap {
  background: rgba(17, 23, 42, .78);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .table th,
html[data-admin-theme="dark"] .table-wrap th,
html[data-admin-theme="dark"] th {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line-2);
}

html[data-admin-theme="dark"] .table td,
html[data-admin-theme="dark"] .table-wrap td,
html[data-admin-theme="dark"] td {
  color: var(--ink-2);
  border-color: var(--line-2);
}

html[data-admin-theme="dark"] tbody tr:hover {
  background: rgba(141, 145, 255, .08);
}

html[data-admin-theme="dark"] :where(.subtle, small, .meta, .muted) {
  color: var(--muted);
}

html[data-admin-theme="dark"] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select, .inline-input) {
  color: var(--ink);
  background: #11172a;
  border-color: var(--line);
}

html[data-admin-theme="dark"] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea)::placeholder {
  color: var(--muted-2);
}

html[data-admin-theme="dark"] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select, .inline-input):focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(141, 145, 255, .16);
}

html[data-admin-theme="dark"] input[type="file"] {
  color: var(--ink-2);
  background: #11172a;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .topbar-search input {
  color: var(--ink);
  background: rgba(17, 23, 42, .96);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .topbar-search svg {
  color: var(--muted);
}

html[data-admin-theme="dark"] .topbar-search kbd {
  color: var(--muted);
  background: #0d1020;
  border-color: var(--line);
}

html[data-admin-theme="dark"] :where(.icon-btn, .ghost-btn, .btn-ghost, .theme-toggle) {
  color: var(--ink-2);
  background: rgba(23, 28, 49, .94);
  border-color: var(--line);
}

html[data-admin-theme="dark"] :where(.icon-btn, .ghost-btn, .btn-ghost, .theme-toggle):hover {
  color: var(--ink);
  background: rgba(141, 145, 255, .12);
  border-color: var(--brand-500);
}

html[data-admin-theme="dark"] .accent-btn,
html[data-admin-theme="dark"] .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #4f53d7, #303293);
  border-color: #6266e6;
  box-shadow: 0 12px 24px -16px rgba(141, 145, 255, .88);
}

html[data-admin-theme="dark"] .accent-btn:hover,
html[data-admin-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #6266e6, #3b3fb4);
}

html[data-admin-theme="dark"] .icon-btn .dot {
  border-color: var(--surface);
}

html[data-admin-theme="dark"] .theme-toggle-track {
  background: rgba(70, 207, 195, .34);
  box-shadow: inset 0 0 0 1px rgba(70, 207, 195, .2);
}

html[data-admin-theme="dark"] .theme-toggle-knob {
  background: #e9fbff;
  transform: translateX(16px);
}

html[data-admin-theme="dark"] .theme-toggle-icon-light {
  color: var(--muted-2);
}

html[data-admin-theme="dark"] .theme-toggle-icon-dark {
  color: #e9fbff;
}

html[data-admin-theme="dark"] .status-chip.neutral,
html[data-admin-theme="dark"] .chip {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .06);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .status-chip.success {
  color: #99f0c2;
  background: rgba(18, 62, 45, .9);
}

html[data-admin-theme="dark"] .status-chip.warning {
  color: #ffd18f;
  background: rgba(68, 42, 18, .92);
}

html[data-admin-theme="dark"] .status-chip.danger {
  color: #ffb0bc;
  background: rgba(74, 31, 42, .92);
}

html[data-admin-theme="dark"] .admin-footer {
  color: var(--muted);
  border-top-color: var(--line);
  background: #0d1020;
}

html[data-admin-theme="dark"] .admin-footer-meta strong {
  color: var(--ink-2);
}

html[data-admin-theme="dark"] .admin-footer-note {
  color: #dfe2ff;
  background: rgba(141, 145, 255, .13);
  border-color: rgba(141, 145, 255, .25);
}

html[data-admin-theme="dark"] .logs-context,
html[data-admin-theme="dark"] pre,
html[data-admin-theme="dark"] code {
  color: var(--ink-2);
  background-color: #0f1426;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .media-tile,
html[data-admin-theme="dark"] .media-thumb,
html[data-admin-theme="dark"] .image-preview,
html[data-admin-theme="dark"] .upload-zone,
html[data-admin-theme="dark"] .toggle-item,
html[data-admin-theme="dark"] .quick-row,
html[data-admin-theme="dark"] .stock-item,
html[data-admin-theme="dark"] .recent-row,
html[data-admin-theme="dark"] .content-row {
  background: rgba(17, 23, 42, .74);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .filter-row.is-selected {
  background: rgba(141, 145, 255, .075);
  box-shadow: inset 3px 0 0 rgba(141, 145, 255, .42);
}

html[data-admin-theme="dark"] .filter-row.is-selected td {
  background: transparent;
}

html[data-admin-theme="dark"] .token-chip,
html[data-admin-theme="dark"] .token-chip.neutral {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .055);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .filter-row-open.text-link {
  color: #aeb1ff;
}

html[data-admin-theme="dark"] .filter-list-table .status-chip.success {
  color: #d4d8ef;
  background: rgba(255, 255, 255, .065);
}

html[data-admin-theme="dark"] .filter-list-table .status-chip.success::before {
  opacity: .62;
}

html[data-admin-theme="dark"] .media-picker,
html[data-admin-theme="dark"] .seo-media-picker,
html[data-admin-theme="dark"] .product-editor-form .media-picker {
  color: var(--ink-2);
  background: rgba(17, 23, 42, .74);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .media-picker-preview,
html[data-admin-theme="dark"] .seo-media-picker .media-picker-preview,
html[data-admin-theme="dark"] .product-editor-form .media-picker-preview {
  color: var(--ink-2);
  background: #0f1426;
  border-color: var(--line-2);
}

html[data-admin-theme="dark"] .media-picker-empty {
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .media-picker-preview img,
html[data-admin-theme="dark"] .seo-media-picker .media-picker-preview img {
  background: #0d1020;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .media-card {
  color: var(--ink-2);
  background: rgba(17, 23, 42, .82);
  border-color: var(--line);
  box-shadow: 0 16px 34px -28px rgba(0, 0, 0, .9);
}

html[data-admin-theme="dark"] .media-card .media-meta strong {
  color: var(--ink);
}

html[data-admin-theme="dark"] .media-preview {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .035) 75%),
    #131a31;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .media-preview img {
  background: #eef2f8;
  border-radius: 8px;
}

html[data-admin-theme="dark"] .media-meta code {
  color: #dfe2ff;
  background: #0f1426;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .rich-editor {
  background: #0f1426;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .rich-editor-toolbar {
  background: #11172a;
  border-bottom-color: var(--line);
}

html[data-admin-theme="dark"] .rich-editor-select,
html[data-admin-theme="dark"] .rich-editor-btn {
  color: var(--ink-2);
  background: rgba(23, 28, 49, .96);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .rich-editor-btn:hover,
html[data-admin-theme="dark"] .rich-editor-select:hover {
  color: var(--ink);
  background: rgba(141, 145, 255, .12);
  border-color: var(--brand-500);
}

html[data-admin-theme="dark"] .rich-editor-body {
  color: var(--ink);
  background: #0f1426;
}

html[data-admin-theme="dark"] .rich-editor-body:focus {
  box-shadow: inset 0 0 0 2px rgba(141, 145, 255, .32);
}

html[data-admin-theme="dark"] .rich-editor-code,
html[data-admin-theme="dark"] .code-editor {
  color: #e6e9ff;
  background: #0f1426;
  border-color: var(--line);
}

html[data-admin-theme="dark"] .seo-inline-note,
html[data-admin-theme="dark"] .stats-card,
html[data-admin-theme="dark"] .collapsible-surface,
html[data-admin-theme="dark"] .product-editor-hero,
html[data-admin-theme="dark"] .product-editor-tabs,
html[data-admin-theme="dark"] .product-side-summary > div,
html[data-admin-theme="dark"] .product-input-affix,
html[data-admin-theme="dark"] .product-price-summary,
html[data-admin-theme="dark"] .product-rail-meta,
html[data-admin-theme="dark"] .product-rail-meta > div,
html[data-admin-theme="dark"] .product-status-option,
html[data-admin-theme="dark"] .seo-preview-card,
html[data-admin-theme="dark"] .product-save-bar {
  color: var(--muted);
  background: rgba(17, 23, 42, .74);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .seo-inline-note strong,
html[data-admin-theme="dark"] .stats-card strong,
html[data-admin-theme="dark"] .product-side-summary strong,
html[data-admin-theme="dark"] .product-price-summary strong,
html[data-admin-theme="dark"] .product-rail-meta strong,
html[data-admin-theme="dark"] .product-status-option strong,
html[data-admin-theme="dark"] .seo-preview-card strong,
html[data-admin-theme="dark"] .product-save-bar strong {
  color: var(--ink);
}

html[data-admin-theme="dark"] .product-back-link,
html[data-admin-theme="dark"] .product-editor-meta,
html[data-admin-theme="dark"] .product-editor-tabs a,
html[data-admin-theme="dark"] .product-status-fieldset legend,
html[data-admin-theme="dark"] .product-input-affix span {
  color: var(--ink-2);
}

html[data-admin-theme="dark"] .product-back-link::before,
html[data-admin-theme="dark"] .product-editor-meta > span:not(.status-chip),
html[data-admin-theme="dark"] .product-editor-tabs .tab-icon,
html[data-admin-theme="dark"] .product-editor-tabs .tab-count,
html[data-admin-theme="dark"] .product-input-affix span {
  color: #dfe2ff;
  background: rgba(255, 255, 255, .055);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .product-editor-tabs a:hover,
html[data-admin-theme="dark"] .product-editor-tabs a:focus-visible,
html[data-admin-theme="dark"] .product-status-option:has(input:checked) {
  color: #f0f2ff;
  background: rgba(141, 145, 255, .12);
  border-color: rgba(141, 145, 255, .36);
}

html[data-admin-theme="dark"] .product-save-bar {
  box-shadow: 0 18px 46px -26px rgba(0, 0, 0, .78);
}

html[data-admin-theme="dark"] .product-media-main-grid .media-thumb-main-action {
  color: #eef1ff;
  background: rgba(17, 23, 42, .86);
  border-color: rgba(255, 255, 255, .14);
}

html[data-admin-theme="dark"] .product-media-main-grid .media-thumb-main-action:hover,
html[data-admin-theme="dark"] .product-media-main-grid .media-thumb-main-action:focus-visible {
  color: #fff;
  background: var(--accent);
  border-color: rgba(141, 145, 255, .54);
}

html[data-admin-theme="dark"] .seo-preview-card span {
  color: #7de0bd;
}

html[data-admin-theme="dark"] .collapsible-summary-badge {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .055);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .property-row {
  border-color: var(--line);
  background: #0f1426;
}

html[data-admin-theme="dark"] .property-key,
html[data-admin-theme="dark"] .property-action {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .055);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .property-key-sub {
  background: rgba(255, 255, 255, .07);
}

html[data-admin-theme="dark"] .property-value {
  color: var(--ink-2);
  background: #0f1426;
}

html[data-admin-theme="dark"] .promo-options {
  background: rgba(255, 255, 255, .035);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .choice-option,
html[data-admin-theme="dark"] .property-value-options .choice-option,
html[data-admin-theme="dark"] .promo-option {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .045);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .choice-option:hover,
html[data-admin-theme="dark"] .property-value-options .choice-option:hover,
html[data-admin-theme="dark"] .promo-option:hover {
  color: var(--ink);
  background: rgba(141, 145, 255, .09);
  border-color: rgba(141, 145, 255, .34);
}

html[data-admin-theme="dark"] .promo-option:has(input:checked) {
  color: #f0f2ff;
  background: rgba(141, 145, 255, .12);
}

html[data-admin-theme="dark"] .promo-option-label strong {
  color: var(--ink);
}

html[data-admin-theme="dark"] .promo-option-switch {
  background: rgba(255, 255, 255, .14);
}

@media (max-width: 980px) {
  .theme-toggle-label {
    display: none;
  }

  .theme-toggle {
    padding-inline: 9px;
  }
}

@media (max-width: 760px) {
  .theme-toggle {
    flex: 0 0 auto !important;
  }
}

/* Commercial settings */
.settings-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface-2, #f7f9ff);
  border: 1px solid var(--line-2, rgba(66, 94, 171, .14));
  border-radius: 12px;
}

.settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-block h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.toggle-item > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.toggle-item strong {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.2;
}

.toggle-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.settings-details {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.settings-details[open] {
  display: grid;
}

.settings-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  list-style: none;
}

.settings-details summary::-webkit-details-marker {
  display: none;
}

.settings-details summary::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.settings-details[open] summary::after {
  transform: rotate(225deg);
}

.settings-details summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.settings-smtp-toggle {
  margin-top: 12px;
}

.permission-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.permission-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.permission-danger {
  border-color: rgba(204, 70, 79, .24);
}

.permission-danger small {
  color: var(--err);
}

.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 16px;
  align-items: stretch;
}

.security-account-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.security-account-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.security-session-list {
  display: grid;
  gap: 10px;
}

.security-session-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.security-session-row strong,
.security-session-row span {
  display: block;
  min-width: 0;
}

.security-session-row strong {
  color: var(--ink);
  font-size: 13.5px;
}

.security-session-row span,
.security-session-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.security-session-row > div:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-session-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.backup-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.backup-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.backup-panel {
  align-content: start;
}

.backup-danger-panel {
  border-color: rgba(204, 70, 79, .26);
}

html[data-admin-theme="dark"] .settings-block {
  background: rgba(17, 23, 42, .74);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .settings-details {
  background: rgba(15, 20, 38, .92);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .permission-group {
  background: rgba(15, 20, 38, .72);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .permission-danger {
  border-color: rgba(255, 120, 112, .24);
}

html[data-admin-theme="dark"] .security-account-card,
html[data-admin-theme="dark"] .security-session-row {
  background: rgba(15, 20, 38, .72);
  border-color: var(--line);
}

html[data-admin-theme="dark"] .toggle-item strong,
html[data-admin-theme="dark"] .settings-details summary {
  color: var(--ink);
}

html[data-admin-theme="dark"] .backup-danger-panel {
  border-color: rgba(255, 120, 112, .28);
}

@media (max-width: 760px) {
  .settings-block-head,
  .settings-details summary {
    display: grid;
    justify-content: stretch;
  }

  .settings-details summary small {
    margin-left: 0;
  }

  .backup-summary-grid,
  .backup-actions-grid,
  .permission-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .security-session-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .security-session-meta {
    text-align: left;
  }
}

/* Mobile admin stability */
@media (max-width: 760px) {
  body.admin-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .admin-shell {
    grid-template-columns: 1fr !important;
    overflow-x: hidden;
  }

  .admin-main {
    min-width: 0;
  }

  .admin-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: auto;
    width: min(86vw, 304px) !important;
    max-width: 304px;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    flex-direction: column;
    background: var(--bg-elev, #fff);
    border-right: 1px solid var(--line);
    transform: translate3d(-106%, 0, 0);
    transition: transform .18s ease, box-shadow .18s ease;
    z-index: 90;
    overflow: hidden;
    will-change: transform;
  }

  .admin-shell.is-nav-open .admin-sidebar {
    transform: translate3d(0, 0, 0);
    box-shadow: 18px 0 48px rgba(8, 14, 36, .32);
  }

  .admin-sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    padding: 0;
    border: 0;
    margin: 0;
    background: rgba(9, 13, 31, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 80;
  }

  .admin-shell.is-nav-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-brand {
    min-height: 72px;
    justify-content: flex-start;
    padding: 14px 16px;
  }

  .admin-brand-text,
  .nav-link-label,
  .nav-link > span:not(.nav-link-icon):not(.nav-badge),
  .nav-group h4,
  .sidebar-user .u-meta {
    display: block;
  }

  .sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 12px 16px;
    overflow-y: auto;
  }

  .nav-link {
    justify-content: flex-start;
    min-height: 40px;
    padding: 10px 12px;
  }

  .nav-badge {
    position: static;
    margin-left: auto;
  }

  .sidebar-user {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .admin-topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px;
  }

  .admin-topbar-leading,
  .admin-topbar-actions,
  .topbar-search {
    width: 100%;
  }

  .admin-topbar-leading {
    min-height: 34px;
    gap: 8px;
  }

  .admin-mobile-nav-toggle {
    display: inline-flex !important;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 16px;
  }

  .breadcrumbs {
    max-width: calc(100vw - 78px);
    overflow: hidden;
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-topbar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    order: 2;
    gap: 8px;
    margin-left: 0 !important;
  }

  .admin-topbar-actions .is-hidden {
    display: none !important;
  }

  .admin-topbar-actions .theme-toggle,
  .admin-topbar-actions .icon-btn,
  .admin-topbar-actions .ghost-btn,
  .admin-topbar-actions .accent-btn {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding-inline: 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .admin-topbar-actions .theme-toggle {
    grid-column: span 1;
  }

  .admin-topbar-actions .icon-btn {
    grid-column: span 1;
  }

  .admin-topbar-actions .ghost-btn,
  .admin-topbar-actions .accent-btn {
    justify-content: center;
  }

  .topbar-search {
    order: 3;
    max-width: none;
    margin-left: 0;
  }

  .admin-topbar .topbar-search input[type="search"],
  .admin-topbar .topbar-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    height: 36px;
    min-height: 36px;
    padding-left: 38px;
    padding-right: 12px;
    font-size: 12.5px;
    line-height: 36px;
  }

  .topbar-search:has(input:not(:placeholder-shown)) input[type="search"] {
    padding-left: 12px;
  }

  .topbar-search kbd {
    display: none;
  }

  .admin-workspace {
    padding: 12px;
    gap: 12px;
  }

  .hero {
    padding: 16px;
  }

  .hero h1 {
    font-size: 21px;
    line-height: 1.12;
  }
}

@media (max-width: 380px) {
  .admin-topbar-actions .ghost-btn,
  .admin-topbar-actions .accent-btn {
    font-size: 11.5px;
  }

  .admin-topbar-actions svg {
    width: 15px;
    height: 15px;
  }
}

/* Desktop topbar compression: keep editor actions inside the viewport. */
@media (min-width: 981px) {
  .admin-topbar {
    overflow: hidden;
  }

  .admin-topbar-leading {
    flex: 0 1 240px;
  }

  .breadcrumbs {
    max-width: 100%;
  }

  .topbar-search {
    flex: 1 1 260px;
    width: auto;
    min-width: 190px;
    max-width: 420px;
  }

  .admin-topbar-actions {
    flex: 0 0 auto;
    min-width: 0;
  }

  .admin-topbar-actions .theme-toggle,
  .admin-topbar-actions .icon-btn,
  .admin-topbar-actions .ghost-btn,
  .admin-topbar-actions .accent-btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 981px) and (max-width: 1740px) {
  .admin-topbar {
    gap: 10px;
    padding-inline: 16px;
  }

  .topbar-search {
    max-width: 320px;
  }

  .admin-topbar-actions {
    gap: 6px;
  }

  .admin-topbar-actions .accent-btn[href="/admin/products/new"] {
    min-width: 94px;
    padding-inline: 14px;
  }

  .admin-topbar-actions .accent-btn[href="/admin/products/new"] .topbar-new-prefix {
    display: none;
  }
}

@media (min-width: 981px) and (max-width: 1560px) {
  .admin-topbar-leading {
    flex-basis: 190px;
  }

  .topbar-search {
    max-width: 260px;
  }

  .theme-toggle-label {
    display: none;
  }

  .admin-topbar-actions .ghost-btn[href="/"] {
    width: 44px;
    min-width: 44px;
    padding-inline: 0;
    overflow: hidden;
    font-size: 0;
  }

  .admin-topbar-actions .ghost-btn[href="/"] svg {
    margin: 0;
  }
}

@media (min-width: 981px) and (max-width: 1320px) {
  .admin-topbar {
    display: grid;
    grid-template-columns: minmax(140px, auto) minmax(220px, 1fr);
    grid-auto-rows: auto;
    min-height: 0;
    padding-block: 10px;
  }

  .topbar-search {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .admin-topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .product-editor-hero {
    top: 124px;
  }

  .product-editor-section {
    scroll-margin-top: 250px;
  }
}

/* Product editor fixed action bar. Kept at the end to beat older duplicated admin rules. */
.product-editor-hero,
.product-editor-form {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.product-editor-surface {
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

@media (min-width: 981px) {
  .product-editor-hero {
    position: sticky !important;
    top: calc(var(--topbar-h, 64px) + 12px) !important;
    z-index: 60 !important;
  }
}

body > .product-save-bar {
  position: fixed !important;
  left: var(--sidebar-w, 280px) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  max-width: none !important;
  z-index: 1200 !important;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -18px 48px -34px rgba(24, 31, 72, .74);
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}

body > .product-save-bar.is-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 980px) {
  body > .product-save-bar {
    left: 0 !important;
    padding-inline: 14px;
  }
}
