:root {
  --bg: #e8f1ff;
  --surface: #ffffff;
  --surface-strong: #f4f8ff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: #dbeafe;
  --success: #16a34a;
  --danger: #dc2626;
  --border: #d7e3f4;
  --shadow: 0 20px 45px rgba(37, 99, 235, 0.08);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 84px;
  --sidebar-bg: linear-gradient(180deg, #102a43 0%, #0f172a 100%);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  color: #f8fafc;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  z-index: 30;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.brand-logo-icon {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: #93c5fd;
  white-space: nowrap;
}

.sidebar-toggle,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover,
.icon-button:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #ffffff;
}

.sidebar-toggle svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: #cbd5e1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(59, 130, 246, 0.18);
  color: #ffffff;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-label {
  font-size: 0.94rem;
  font-weight: 500;
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .brand-block {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-head {
  flex-direction: column;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 10px;
}

.sidebar-backdrop {
  display: none;
}

.content-shell {
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title-wrap h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-open-btn {
  display: none;
}

.page-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.18), transparent 24%),
    linear-gradient(180deg, #dbeafe 0%, #eff6ff 45%, #f8fbff 100%);
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  color: #1e3a8a;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-heading h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #334155;
}

.auth-field span {
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fbff;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auth-alert-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-footer {
  margin: 20px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-footer a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.card p {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
}

.dashboard-intro {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.dashboard-intro-copy h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #1e3a8a;
}

.dashboard-intro-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.6;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.table-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.table-header h2 {
  margin: 0;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead {
  background: #f8fbff;
}

th, td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
}

tr:hover td {
  background: #f8fbff;
}

.inline-form {
  display: inline-block;
}

.button {
  border: none;
  cursor: pointer;
  outline: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.button:hover {
  filter: brightness(1.03);
}

.button.secondary {
  background: #f8fbff;
  color: var(--text);
  border: 1px solid var(--border);
}

.button.small {
  padding: 9px 14px;
  font-size: 0.9rem;
}

.button.danger {
  background: var(--danger);
}

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

.form-panel {
  padding: 28px;
}

form label {
  display: block;
  margin-bottom: 18px;
  color: #334155;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f8fbff;
  color: var(--text);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

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

.form-page {
  max-width: 1200px;
}

@media (max-width: 960px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  }

  .app-shell.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 20;
  }

  .app-shell.sidebar-mobile-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-open-btn {
    display: inline-flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .page-body {
    padding: 22px;
  }
}

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

@media (max-width: 720px) {
  .topbar,
  .page-body,
  .panel,
  .form-grid,
  .fieldset-grid {
    padding: 18px;
  }

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

  .form-grid,
  .fieldset-grid {
    grid-template-columns: 1fr;
  }
}

.category-tree-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-tree-marker {
  color: var(--muted);
  font-size: 0.9rem;
}

.category-tree-table td:first-child {
  min-width: 260px;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.alert.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.category-tree-help {
  margin: 0 28px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.category-panel {
  padding: 28px;
  overflow: hidden;
}

.form-card {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.form-card:first-of-type {
  border-top: none;
  padding-top: 0;
}

.form-card-header {
  margin-bottom: 18px;
}

.form-card-header h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.form-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-grid-compact {
  margin-top: 20px;
}

.toggle-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0 !important;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fbff;
}

.toggle-inline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.file-field {
  margin-bottom: 0 !important;
}

.form-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.product-assign-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-assign-row {
  display: flex !important;
  align-items: center;
  gap: 14px;
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbff;
  cursor: pointer;
}

.product-assign-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.product-assign-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-assign-info strong {
  font-size: 0.95rem;
  color: var(--text);
}

.product-assign-info small {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.mass-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mass-action-select {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.category-list-form {
  margin: 0;
}

.p-tree-wrapper {
  border: 1px solid #dfe7ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 8px;
  overflow: auto;
}

.p-tree-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.p-tree,
.p-tree-node-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-tree-node-children {
  padding-left: 22px;
}

.p-tree-node-collapsed > .p-tree-node-children {
  display: none;
}

.p-tree-node-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.p-tree-node-content:hover,
.p-tree-node-content.p-tree-node-selected {
  background: #f1f5f9;
}

.p-tree-node-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}

.p-tree-node-toggle-leaf {
  visibility: hidden;
  pointer-events: none;
}

.p-tree-node-expanded > .p-tree-node-content .p-tree-node-toggle-icon {
  transform: rotate(90deg);
}

.p-tree-node-toggle-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.p-tree-node-checkbox {
  display: none;
}

.p-tree-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #3b82f6;
}

.p-tree-drag-handle {
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
}

.p-tree-node-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
}

.p-tree-node-icon-svg {
  width: 18px;
  height: 18px;
}

.p-tree-node-label {
  flex: 1;
  min-width: 120px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
}

.p-tree-node-meta {
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
}

.p-tree-node-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}

.p-tree-node-action:hover {
  text-decoration: underline;
}

.p-tree-node-content.dragging {
  opacity: 0.5;
}

.p-tree-node-content.drop-target.drop-child {
  background: #eff6ff;
  outline: 1px solid #93c5fd;
}

.p-tree-node-content.drop-target.drop-before {
  box-shadow: inset 0 2px 0 #3b82f6;
}

.p-tree-node-content.drop-target.drop-after {
  box-shadow: inset 0 -2px 0 #3b82f6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill-active {
  background: #ecfdf5;
  color: #166534;
}

.status-pill-disabled {
  background: #fef2f2;
  color: #991b1b;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-row-root td {
  background: #fcfdff;
}

.category-row-child:hover td,
.category-row-root:hover td {
  background: #f8fbff;
}

.form-section {
  padding: 24px 28px;
  border-top: 1px solid var(--border);
}

.form-section-header {
  margin-bottom: 18px;
}

.form-section-header h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.form-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px 28px 28px;
  border-top: 1px solid var(--border);
  background: #f8fbff;
}

.category-form .form-grid {
  margin: 0;
}

.product-assign-panel {
  margin-top: 0;
  padding-top: 24px;
  border-top: none;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #64748b;
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.category-row.dragging {
  opacity: 0.45;
}

.category-row.drop-target.drop-child {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: var(--primary-soft);
}

.category-row.drop-target.drop-before {
  box-shadow: inset 0 3px 0 var(--primary);
}

.category-row.drop-target.drop-after {
  box-shadow: inset 0 -3px 0 var(--primary);
}

.product-assign-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.product-assign-panel h3 {
  margin: 0;
}

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

.product-assign-item {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbff;
}

.product-assign-item input[type="checkbox"] {
  width: auto;
  margin-top: 4px;
}

.product-assign-item span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-assign-item small {
  color: var(--muted);
}

@media (max-width: 720px) {
  .p-tree-node-meta,
  .status-pill {
    display: none;
  }

  .product-assign-grid {
    grid-template-columns: 1fr;
  }
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  background: #ffffff;
  color: #0f172a;
  pointer-events: auto;
  animation: toast-in 0.22s ease;
}

.toast-success {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.toast-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.toast-message {
  flex: 1;
  line-height: 1.45;
  font-size: 0.95rem;
}

.toast-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-toolbar-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.list-panel {
  padding: 24px 28px 28px;
}

.list-toolbar-wrap {
  margin-bottom: 20px;
}

.list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-toolbar-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.list-toolbar-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.list-toolbar-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  background: #fff;
}

.list-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-toolbar-select {
  min-width: 130px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}

.list-toolbar-add {
  margin-left: auto;
}

.list-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.list-toolbar-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.list-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-pagination-status {
  font-size: 0.88rem;
  color: var(--muted);
}

.button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.category-mass-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.category-level-indent {
  display: inline-block;
  padding-left: calc(var(--level, 0) * 18px);
}

.cell-checkbox {
  width: 44px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  background: #f1f5f9;
  color: #475569;
}

.status-chip-pending { background: #fef3c7; color: #92400e; }
.status-chip-processing { background: #dbeafe; color: #1e40af; }
.status-chip-shipped { background: #e0e7ff; color: #3730a3; }
.status-chip-delivered { background: #dcfce7; color: #166534; }

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

.data-table th.cell-price,
.data-table td.cell-price {
  text-align: right;
  white-space: nowrap;
}

.data-table th.cell-actions,
.data-table td.cell-actions {
  width: 180px;
}

.product-panel {
  padding: 28px;
}

.product-table tbody tr:last-child td {
  border-bottom: none;
}

.product-cell-name {
  min-width: 260px;
}

.product-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name-block strong {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

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

.slug-chip {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge-consultation {
  background: #ecfdf5;
  color: #166534;
}

.type-badge-configurable {
  background: #eff6ff;
  color: #1d4ed8;
}

.type-badge-simple {
  background: #f8fafc;
  color: #475569;
  border: 1px solid var(--border);
}

.type-badge-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(22, 101, 52, 0.12);
  font-size: 0.7rem;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.stock-badge-ok {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--border);
}

.stock-badge-low {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.table-empty {
  padding: 48px 24px !important;
  text-align: center;
  color: var(--muted);
}

.table-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.action-group .inline-form {
  display: inline-flex;
}

.product-form .field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  color: #334155;
}

.product-form .field-label > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.product-form .field-label-full {
  grid-column: 1 / -1;
}

.product-form input[type="file"] {
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}

.product-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.image-preview-item {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fbff;
  overflow: hidden;
}

.image-preview-item img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  background: #e2e8f0;
}

.image-preview-item figcaption {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-item.is-broken img {
  display: none;
}

.image-preview-item.is-broken {
  position: relative;
  min-height: 160px;
}

.image-preview-item.is-broken::before {
  content: 'Image unavailable';
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: 12px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.82rem;
}

.image-preview-empty {
  margin-top: 16px;
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fbff;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .product-table th:nth-child(2),
  .product-table td:nth-child(2),
  .product-table th:nth-child(6),
  .product-table td:nth-child(6) {
    display: none;
  }

  .action-group {
    flex-direction: column;
    align-items: stretch;
  }
}

/* CMS — pages & blog */
.cms-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cms-header,
.cms-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cms-header-count {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.cms-header-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cms-header-actions,
.cms-view-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cms-table-panel {
  padding: 0;
  overflow: hidden;
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
}

.cms-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f8fbff;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cms-table tbody td {
  padding: 16px 20px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.cms-table tbody tr:last-child td {
  border-bottom: none;
}

.cms-table tbody tr:hover {
  background: #fafcff;
}

.cms-table-title {
  min-width: 180px;
  max-width: 320px;
  vertical-align: middle;
}

.cms-table-title-link {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-table-title-link:hover {
  color: var(--primary-dark);
}

.cms-table-slug {
  min-width: 140px;
}

.cms-table-author,
.cms-table-date {
  white-space: nowrap;
  color: #475569;
}

.cms-table-actions,
.cms-table-actions-head {
  width: 220px;
  text-align: right;
}

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

.cms-table-empty {
  padding: 0 !important;
  border: none !important;
}

.cms-table-empty .cms-empty {
  border: none;
  border-radius: 0;
  background: transparent;
}

.cms-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.cms-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
}

.cms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px dashed #cbd5e1;
  border-radius: 24px;
}

.cms-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.cms-empty-icon svg {
  width: 28px;
  height: 28px;
}

.cms-empty strong {
  font-size: 1.05rem;
  color: var(--text);
}

.cms-empty p {
  margin: 0 0 8px;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.5;
}

.cms-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.cms-view-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.cms-view-article {
  overflow: hidden;
  min-width: 0;
}

.cms-view-inner {
  padding: 32px 40px 40px;
  max-width: 780px;
}

.cms-view-hero {
  width: 100%;
  max-height: 320px;
  overflow: hidden;
  background: #eef2f7;
  border-bottom: 1px solid var(--border);
}

.cms-view-hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.cms-view-header {
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.cms-view-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 700;
}

.cms-view-lead {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
}

.cms-view-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--muted);
}

.cms-view-meta-row span + span::before {
  content: "·";
  margin-right: 12px;
  color: #cbd5e1;
}

.cms-view-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
}

.cms-side-card {
  padding: 20px;
}

.cms-side-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.cms-meta-list {
  display: grid;
  gap: 12px;
}

.cms-meta-item {
  display: grid;
  gap: 4px;
}

.cms-meta-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cms-meta-value {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
}

.cms-seo-preview {
  display: grid;
  gap: 6px;
}

.cms-seo-preview strong {
  color: #1a0dab;
  font-size: 0.95rem;
  line-height: 1.35;
}

.cms-seo-preview span {
  color: #4d5156;
  font-size: 0.84rem;
  line-height: 1.45;
}

.cms-article-body {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cms-article-body > :first-child {
  margin-top: 0 !important;
}

.cms-article-body > :last-child {
  margin-bottom: 0 !important;
}

.cms-article-body h1,
.cms-article-body h2,
.cms-article-body h3,
.cms-article-body h4 {
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
  line-height: 1.35;
  font-weight: 700;
}

.cms-article-body h2 {
  font-size: 1.3rem;
}

.cms-article-body h3 {
  font-size: 1.1rem;
}

.cms-article-body p,
.cms-article-body ul,
.cms-article-body ol,
.cms-article-body blockquote {
  margin: 0 0 1rem;
}

.cms-article-body p:empty {
  display: none;
}

.cms-article-body ul,
.cms-article-body ol {
  padding-left: 1.5rem;
}

.cms-article-body li {
  margin-bottom: 0.35rem;
}

.cms-article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.25rem 0;
}

.cms-article-body a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cms-article-body .blog-toc {
  padding: 16px 18px;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
}

.cms-article-body .blog-toc h2 {
  margin-top: 0;
  font-size: 1rem;
}

.cms-article-body .blog-toc p {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.cms-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.cms-article-body th,
.cms-article-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.cms-empty-inline {
  color: var(--muted);
  font-style: italic;
}

.cms-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.cms-form-main,
.cms-form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cms-form-section {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cms-form-section .cms-section-head {
  margin-bottom: 0;
}

.cms-section-head {
  margin-bottom: 16px;
}

.cms-section-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.cms-section-head p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.cms-form-footer {
  position: sticky;
  top: 88px;
}

.button-block {
  width: 100%;
  justify-content: center;
}

.cms-upload-zone {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fbff;
  padding: 24px;
  text-align: center;
}

.cms-upload-zone input[type="file"] {
  display: none;
}

.cms-upload-label {
  display: grid;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
}

.cms-upload-label span {
  font-weight: 600;
}

.cms-upload-label small {
  color: var(--muted);
}

.cms-featured-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge-published {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-badge-draft {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid var(--border);
}

.content-form .field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  color: #334155;
}

.content-form .field-label > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.content-form .field-label-full {
  grid-column: 1 / -1;
}

.content-body-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.content-body-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-body-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.content-body-input {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafcff;
  line-height: 1.55;
}

.field-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .cms-view-layout,
  .cms-form-layout {
    grid-template-columns: 1fr;
  }

  .cms-view-sidebar {
    position: static;
  }

  .cms-form-footer {
    position: static;
  }

  .cms-table-actions-head,
  .cms-table-actions {
    width: auto;
  }
}

@media (max-width: 640px) {
  .cms-view-inner {
    padding: 24px 20px 28px;
  }

  .cms-view-title {
    font-size: 1.45rem;
  }

  .cms-table thead th:nth-child(2),
  .cms-table tbody td:nth-child(2) {
    display: none;
  }

  .cms-row-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

#variants-table input[type="text"],
#variants-table input[type="number"] {
  width: 100%;
  min-width: 80px;
}

/* ── Product form (redesign) ── */

.product-form-panel {
  padding: 0;
  overflow: visible;
}

.product-form-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 28px 28px 0;
}

.product-form-eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.product-form-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.product-form-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-form-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.product-form-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 16px 24px 28px;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 0 24px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.product-form-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.product-form-nav-link:hover {
  background: #eef2f7;
  color: #334155;
}

.product-form-nav-link.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.product-form-nav-link.is-hidden {
  display: none;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.product-form-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px 120px;
  min-width: 0;
}

.product-form .form-card-elevated {
  margin: 0;
  padding: 22px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.product-form .form-card-elevated.is-hidden {
  display: none;
}

.product-form .form-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.form-card-header-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 800;
}

.product-form .form-card-header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.product-form .form-card-header p {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
}

.form-card-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.product-form .form-grid {
  gap: 16px;
  margin-bottom: 16px;
}

.product-form .form-grid:last-child {
  margin-bottom: 0;
}

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

.product-form label {
  margin-bottom: 0;
}

.product-form .field-label > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.01em;
}

.product-form input[type="text"],
.product-form input[type="number"],
.product-form select,
.product-form textarea {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.product-form input:focus,
.product-form select:focus,
.product-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.product-form textarea {
  min-height: 96px;
}

.product-type-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.88rem;
}

.form-note.is-hidden,
.is-hidden {
  display: none !important;
}

.form-footer-sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 0;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.button.ghost {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.button.ghost.danger {
  color: #dc2626;
}

.button.ghost.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.config-empty-state {
  padding: 28px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
}

.config-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.config-editor-panel {
  margin-bottom: 8px;
}

.config-subheading {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}

.config-option-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.config-option-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.config-option-card-head strong {
  font-size: 0.88rem;
  color: #334155;
}

.table-responsive-compact table {
  min-width: 0;
}

.config-table th,
.config-table td {
  padding: 10px 12px;
  font-size: 0.88rem;
}

.table-input {
  padding: 8px 10px !important;
  border-radius: 8px !important;
  font-size: 0.88rem !important;
}

.variant-options-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.4;
}

.question-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.question-item-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 130px auto 36px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.question-item-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.question-label-field {
  margin: 0;
}

.question-label-field .question-label {
  font-weight: 500;
}

.question-type-field {
  margin: 0;
}

.question-type-field select {
  padding: 9px 10px;
  font-size: 0.85rem;
}

.question-required-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  cursor: pointer;
}

.question-required-toggle input {
  width: auto;
  margin: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #94a3b8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-button:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.question-item-details {
  border-top: 1px solid #f1f5f9;
}

.question-item-details summary {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.question-item-details summary:hover {
  color: #334155;
}

.question-item-details-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

.question-item-details-body .field-label-full,
.question-item-details-body .question-options-field:not(.is-hidden) {
  grid-column: 1 / -1;
}

.image-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.image-preview-empty-icon {
  font-size: 1.5rem;
  opacity: 0.5;
}

.image-preview-empty strong {
  color: #334155;
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .product-form-shell {
    grid-template-columns: 1fr;
  }

  .product-form-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    max-height: none;
    padding: 16px 20px;
  }

  .product-form-nav-link {
    flex: 0 1 auto;
  }

  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .question-item-main {
    grid-template-columns: 28px 1fr;
    grid-template-areas:
      "num label"
      "num type"
      "req req"
      "rm rm";
  }

  .question-item-num { grid-area: num; }
  .question-label-field { grid-area: label; }
  .question-type-field { grid-area: type; }
  .question-required-toggle { grid-area: req; justify-self: start; }
  .icon-button { grid-area: rm; justify-self: end; }

  .question-item-details-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .product-form-topbar,
  .product-form-sections,
  .form-footer-sticky {
    padding-left: 18px;
    padding-right: 18px;
  }
}
