:root {
  color-scheme: light;
  --color-bg: #f5f8ff;
  --color-surface: #ffffff;
  --color-surface-alt: #eef2ff;
  --color-primary: #2563eb;
  --color-primary-dark: #1e3a8a;
  --color-on-primary: #ffffff;
  --color-text: #0f172a;
  --color-muted: #5f6b89;
  --color-border: #d7e3ff;
  --color-icon-bg: rgba(37, 99, 235, 0.08);
  --color-icon-border: rgba(37, 99, 235, 0.16);
  --color-icon-hover: rgba(37, 99, 235, 0.18);
  --color-sidebar: #ffffff;
  --color-sidebar-alt: #eef2ff;
  --color-sidebar-active: rgba(37, 99, 235, 0.08);
  --color-sidebar-text: #0f172a;
  --color-sidebar-muted: #5f6b89;
  --color-sidebar-link: #111827;
  --color-sidebar-link-active: #0f172a;
  --color-navbar: #ffffff;
  --color-navbar-text: #111827;
  --color-focus: rgba(59, 130, 246, 0.4);
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-accent-soft: rgba(37, 99, 235, 0.16);
  --sidebar-width: 280px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 12px 28px rgba(30, 64, 175, 0.08);
  --shadow-md: 0 20px 48px rgba(30, 64, 175, 0.12);
  font-family: 'DM Sans', sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #2a2f3d;
  --color-surface: #1e1e2d;
  --color-surface-alt: #252838;
  --color-primary: #93c5fd;
  --color-primary-dark: #bfdbfe;
  --color-on-primary: #07122b;
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
  --color-border: #1e293b;
  --color-icon-bg: rgba(148, 163, 184, 0.16);
  --color-icon-border: rgba(148, 163, 184, 0.26);
  --color-icon-hover: rgba(148, 163, 184, 0.3);
  --color-sidebar: #1e1e2d;
  --color-sidebar-alt: rgba(148, 163, 184, 0.18);
  --color-sidebar-active: rgba(148, 163, 184, 0.24);
  --color-sidebar-text: rgba(255, 255, 255, 0.92);
  --color-sidebar-muted: rgba(255, 255, 255, 0.6);
  --color-sidebar-link: rgba(226, 232, 240, 0.78);
  --color-sidebar-link-active: rgba(255, 255, 255, 0.96);
  --color-navbar: #1e1e2d;
  --color-navbar-text: #f8fafc;
  --color-focus: rgba(96, 165, 250, 0.42);
  --color-danger: #f87171;
  --color-warning: #fbbf24;
  --color-accent-soft: rgba(96, 165, 250, 0.26);
  --shadow-sm: 0 16px 30px rgba(2, 6, 23, 0.55);
  --shadow-md: 0 28px 50px rgba(2, 6, 23, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

body[data-page="dashboard"],
body[data-page="categories"],
body[data-page="add-product"],
body[data-page="suppliers"],
body[data-page="shipping"],
body[data-page="other-vendors"],
body[data-page="integrations"],
body[data-page="reports"] {
  overflow: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-container {
  max-width: 480px;
  width: 100%;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.auth-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.auth-header p {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.logo {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-width: 20px;
  height: 20px;
  margin: 0;
}

label {
  font-weight: 500;
  color: var(--color-text);
}

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

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

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
  background: var(--color-surface);
}

textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 20px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn.small {
  padding: 8px 14px;
  font-size: 13px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.is-disabled:hover {
  transform: none;
}

.primary-btn {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
  background: var(--color-primary-dark);
}

.ghost-btn {
  background: var(--color-icon-bg);
  color: var(--color-text);
  border: 1px solid var(--color-icon-border);
}

.ghost-btn:hover {
  background: var(--color-icon-hover);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.danger-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.icon-btn {
  border: 1px solid var(--color-icon-border);
  background: var(--color-icon-bg);
  color: var(--color-text);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: var(--color-icon-hover);
}

.icon-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.icon-btn.small {
  width: 32px;
  height: 32px;
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

.full-width {
  width: 100%;
}

.auth-switch {
  text-align: center;
  color: var(--color-muted);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.main-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.card {
  min-width: 0;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 22, 58, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar {
  position: relative;
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 32px 24px 24px;
  gap: 24px;
  overflow-x: hidden;
  overscroll-behavior: contain;
  transition: width 0.3s ease, flex-basis 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  border-right: 1px solid var(--color-border);
}

.sidebar > * {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar-collapse-toggle {
  position: absolute;
  top: 28px;
  left: calc(var(--sidebar-width) - 16px);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: left 0.3s ease, transform 0.3s ease;
  z-index: 950;
}

.sidebar-collapse-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.sidebar-collapse-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

body[data-theme="dark"] .sidebar-collapse-toggle {
  background: var(--color-surface-alt);
  color: var(--color-sidebar-text);
}

body.sidebar-collapsed .sidebar {
  width: 0;
  flex-basis: 0;
  padding-inline: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar > * {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-collapse-toggle {
  left: 16px;
}

body.sidebar-collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-title {
  font-size: 20px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--color-sidebar-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
  letter-spacing: 0.08em;
  margin: 0 0 8px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--color-sidebar-link);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-sidebar-active);
  color: var(--color-sidebar-link-active);
}

.nav-icon {
  font-size: 18px;
}

.nav-footer {
  margin-top: auto;
}

.main-content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 0;
  background: var(--color-navbar);
  color: var(--color-navbar-text);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 980;
}

.topbar-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--color-navbar-text);
  text-decoration: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.topbar-brand,
.topbar-brand * {
  -webkit-tap-highlight-color: transparent;
}

.topbar-brand:hover {
  color: var(--color-navbar-text);
  text-decoration: none;
}

.topbar-brand:active,
.topbar-brand:focus {
  outline: none;
  background: none;
}

.topbar-brand .brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-brand .brand-title {
  color: var(--color-navbar-text);
  line-height: 1.2;
}

.topbar-brand .brand-subtitle {
  color: rgba(17, 24, 39, 0.7);
}

body[data-theme="dark"] .topbar-brand .brand-subtitle {
  color: rgba(248, 250, 252, 0.75);
}

.back-link {
  color: var(--color-primary);
  font-weight: 500;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  box-shadow: none;
  width: 100%;
  max-width: none;
}

.topbar-left .search-bar {
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
  min-width: 280px;
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  width: 100%;
  color: var(--color-text);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-navbar-text);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(17, 24, 39, 0.15);
  box-shadow: 0 12px 22px rgba(30, 64, 175, 0.22);
  outline: none;
}

.menu-toggle:active {
  transform: scale(0.96);
}

body[data-theme="dark"] .menu-toggle {
  background: rgba(30, 30, 45, 0.65);
  border-color: rgba(148, 163, 184, 0.45);
  color: rgba(226, 232, 240, 0.92);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.42);
}

body[data-theme="dark"] .menu-toggle:hover,
body[data-theme="dark"] .menu-toggle:focus-visible {
  background: rgba(30, 30, 45, 0.78);
  border-color: rgba(148, 163, 184, 0.58);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.5);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-left: 12px;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-buttons .btn {
  white-space: nowrap;
}

.auth-button {
  min-width: 0;
}

.auth-button__icon {
  font-size: 18px;
}

.auth-button__label {
  font-weight: 600;
}

[data-guest-actions][hidden],
[data-profile-menu][hidden],
[data-profile-dropdown][hidden] {
  display: none !important;
}

.profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.avatar-button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.avatar-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 999px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-icon-bg);
  color: var(--color-text);
  display: grid;
  place-items: center;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.avatar-button:hover .avatar,
.avatar-button:focus-visible .avatar {
  background: var(--color-icon-hover);
  transform: translateY(-1px);
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 220px;
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.profile-dropdown::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 18px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
  border-top-left-radius: 4px;
}

.profile-greeting {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

.profile-greeting span {
  color: var(--color-primary);
}

.profile-dropdown .btn {
  width: 100%;
}

body[data-theme="dark"] .profile-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 16px 32px rgba(2, 6, 23, 0.5);
}

body[data-theme="dark"] .profile-dropdown::before {
  border-color: var(--color-border);
}

.content-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.content-header p {
  margin: 0;
  color: var(--color-muted);
}

.sync-meta__time {
  color: var(--color-text);
  font-weight: 600;
}

.sync-meta--error {
  color: var(--color-danger, #d14343);
  font-size: 14px;
  line-height: 1.5;
}

body[data-theme="dark"] .sync-meta--error {
  color: var(--color-danger, #f97066);
}

.title-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.title-actions .action-icon {
  flex-shrink: 0;
}

.theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.theme-switcher--inline {
  flex-shrink: 0;
}

.theme-switcher--sidebar {
  width: 100%;
}

.theme-switcher__button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 168px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-switcher__button:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
}

.theme-switcher__button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus);
  border-color: var(--color-primary);
}

.theme-switcher--inline .theme-switcher__button {
  min-width: 0;
  width: auto;
}

.theme-switcher--compact .theme-switcher__button {
  width: 44px;
  height: 44px;
  padding: 10px;
  gap: 0;
  min-width: 0;
  justify-content: center;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.theme-switcher--sidebar .theme-switcher__button {
  justify-content: flex-start;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-sidebar-text);
  min-width: 0;
}

body[data-theme="dark"] .theme-switcher--sidebar .theme-switcher__button {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
}

.theme-switcher__icon {
  width: 22px;
  height: 22px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-navbar-text);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-switcher__icon svg {
  width: 18px;
  height: 18px;
}

.theme-switcher__icon[data-icon-mode="system"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 116, 144, 0.2));
}

.theme-switcher__icon[data-icon-theme="dark"] {
  background: rgba(250, 204, 21, 0.24);
  color: #facc15;
}

.theme-switcher__icon[data-icon-mode="system"][data-icon-theme="dark"] {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.28), rgba(15, 118, 110, 0.3));
  color: #facc15;
}

.theme-switcher__button:hover .theme-switcher__icon,
.theme-switcher__button:focus-visible .theme-switcher__icon {
  transform: translateY(-1px);
}

.theme-switcher__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.theme-switcher.open .theme-switcher__chevron {
  transform: rotate(180deg);
}

.theme-switcher__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease, max-height 0.2s ease;
  min-width: 220px;
  z-index: 950;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
}

.theme-switcher.open .theme-switcher__menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  padding: 8px;
  max-height: 320px;
  visibility: visible;
}

.theme-switcher--sidebar .theme-switcher__menu {
  left: 0;
}

.theme-switcher__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text);
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
  outline: none;
}

.theme-switcher__option:hover,
.theme-switcher__option:focus {
  background: var(--color-surface-alt);
}

.theme-switcher__option.is-active {
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
}

.theme-switcher__option-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--color-icon-bg);
  color: var(--color-primary);
  flex-shrink: 0;
}

.theme-switcher__option-icon svg {
  width: 18px;
  height: 18px;
}

.theme-switcher__option[data-theme-option="dark"] .theme-switcher__option-icon {
  background: rgba(250, 204, 21, 0.22);
  color: #facc15;
}

.theme-switcher__option[data-theme-option="system"] .theme-switcher__option-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 116, 144, 0.2));
}

.sidebar-theme {
  margin-top: auto;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.action-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--color-icon-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.action-icon--label {
  width: auto;
  min-width: 44px;
  padding: 0 16px;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  text-transform: none;
}

.action-icon__label {
  font-size: 14px;
  font-weight: 600;
}

a.action-icon {
  text-decoration: none;
}

.action-icon:hover {
  background: var(--color-icon-hover);
}

.action-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus);
}

.action-icon:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.action-icon.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--color-surface);
}

.action-icon.is-disabled:hover {
  background: var(--color-surface);
}

.action-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.logo-badge img {
  width: 22px;
  height: 22px;
  display: block;
}

body[data-theme="dark"] .logo-badge {
  background: transparent;
  border: none;
  box-shadow: none;
}

.action-icon.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  animation: spin 0.8s linear infinite;
}

.action-icon.is-loading > *:not(.visually-hidden) {
  opacity: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-header,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer {
  flex-wrap: wrap;
}

.card-header h2 {
  margin: 0;
  font-size: 20px;
}

.card-header--controls {
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

.card-header__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-bulk-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-bulk-controls .btn svg {
  width: 20px;
  height: 20px;
}

.product-bulk-actions {
  display: none;
  align-items: center;
  gap: 10px;
}

.product-bulk-actions.is-visible {
  display: inline-flex;
}

.product-bulk-count {
  font-size: 14px;
  color: var(--color-muted);
}

.product-bulk-controls .btn.is-active {
  box-shadow: 0 0 0 1px var(--color-primary);
}

.card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-search {
  max-width: 460px;
  width: 100%;
  margin-left: auto;
  background: var(--color-surface-alt);
}

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

.card-actions--stacked {
  align-items: stretch;
}

.card-bulk-action {
  white-space: nowrap;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-icon-border);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  padding: 10px;
}

.icon-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.icon-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.icon-btn--danger {
  color: var(--color-danger);
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.08);
}

.icon-btn__glyph {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-btn__loader {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-danger);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-size-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-muted);
}

.page-size-selector select {
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .page-size-selector {
    gap: 0;
  }

  .page-size-selector .page-size-label {
    display: none;
  }
}

.count-pill {
  background: var(--color-icon-bg);
  color: var(--color-text);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--color-icon-border);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.table-footer__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.table-footer__pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-pagination[hidden] {
  display: none;
}

.table-pagination__info {
  font-size: 14px;
  color: var(--color-muted);
}

.table-pagination__jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-pagination__input {
  width: 72px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-align: center;
}

.table-pagination__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.table-pagination__input::-webkit-outer-spin-button,
.table-pagination__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.table-pagination__input[type='number'] {
  -moz-appearance: textfield;
}

@media (max-width: 640px) {
  .table-footer {
    align-items: flex-start;
  }

  .table-footer__meta {
    width: 100%;
    justify-content: space-between;
  }

  .table-footer__meta .table-meta {
    display: none;
  }

  .table-footer__pagination {
    justify-content: space-between;
  }

  .table-pagination {
    width: 100%;
    justify-content: space-between;
  }

  .table-pagination__info {
    font-size: 12px;
  }
}

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

.pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination__button:hover:not(:disabled),
.pagination__button:focus-visible:not(:disabled) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.pagination__button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.pagination__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination__button--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
  cursor: default;
}

.pagination__ellipsis {
  color: var(--color-muted);
  font-size: 14px;
  padding: 0 6px;
}

.pagination__current {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-strong);
  font-weight: 600;
}

.variant-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.variant-pricing-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body[data-theme="dark"] .product-table,
body[data-theme="dark"] .category-table,
body[data-theme="dark"] .report-table,
body[data-theme="dark"] .sku-table,
body[data-theme="dark"] .variant-table,
body[data-theme="dark"] .variant-pricing-table,
body[data-theme="dark"] .mapping-table,
body[data-theme="dark"] .integrations-table {
  background: var(--color-surface);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.product-table .col-select {
  width: 52px;
  text-align: center;
}

.product-table .col-photo {
  width: 140px;
}

.product-table .col-actions {
  width: 140px;
  text-align: center;
}

.product-table td.col-actions {
  white-space: nowrap;
  text-align: center;
}

.product-table th,
.product-table td {
  text-align: left;
  padding: 20px 18px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  vertical-align: middle;
}

.mekari-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mekari-status__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.mekari-status__badge img {
  width: 18px;
  height: 18px;
  display: block;
}

.mekari-status__indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--color-surface, #fff);
  background: #94a3b8;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.mekari-status__indicator::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.mekari-status__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mekari-status__label {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.2;
}

.mekari-status__state {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.2;
}

.mekari-status__meta {
  font-size: 11px;
  color: var(--color-muted);
  line-height: 1.2;
  max-width: 240px;
}

.mekari-status[data-state='pending'] .mekari-status__badge {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.mekari-status[data-state='pending'] .mekari-status__indicator {
  background: #fbbf24;
}

.mekari-status[data-state='missing'] .mekari-status__badge {
  background: rgba(107, 114, 128, 0.14);
  border-color: rgba(107, 114, 128, 0.32);
  box-shadow: 0 6px 14px rgba(107, 114, 128, 0.16);
}

.mekari-status[data-state='missing'] .mekari-status__indicator {
  background: #9ca3af;
}

.mekari-status[data-state='missing'] .mekari-status__badge img {
  filter: grayscale(1);
  opacity: 0.55;
}

.mekari-status[data-state='missing'] .mekari-status__state {
  color: var(--color-muted);
}

.mekari-status[data-state='syncing'] .mekari-status__badge {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.16);
}

.mekari-status[data-state='syncing'] .mekari-status__indicator {
  background: #38bdf8;
  animation: mekari-indicator-pulse 1.6s ease-out infinite;
}

.mekari-status[data-state='syncing'] .mekari-status__badge img {
  filter: grayscale(1);
  opacity: 0.65;
}

.mekari-status[data-state='synced'] .mekari-status__indicator {
  background: #22c55e;
}

.mekari-status[data-state='error'] .mekari-status__badge {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.2);
}

.mekari-status[data-state='error'] .mekari-status__indicator {
  background: #ef4444;
}

.mekari-status[data-state='error'] .mekari-status__state {
  color: var(--color-danger);
}

.mekari-status__badge.has-tooltip {
  cursor: pointer;
}

.mekari-status__badge.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translate(-50%, 8px);
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  width: max-content;
  max-width: 240px;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 12;
}

.mekari-status__badge.has-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translate(-50%, 12px);
  width: 10px;
  height: 10px;
  background: #0f172a;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 11;
}

.mekari-status__badge.has-tooltip:hover::after,
.mekari-status__badge.has-tooltip:hover::before,
.mekari-status__badge.has-tooltip:focus-visible::after,
.mekari-status__badge.has-tooltip:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mekari-status__badge.has-tooltip:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

body[data-theme='dark'] .mekari-status__badge {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.6);
}

body[data-theme='dark'] .mekari-status__indicator {
  border-color: rgba(15, 23, 42, 0.85);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.5);
}

body[data-theme='dark'] .mekari-status[data-state='pending'] .mekari-status__badge {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(148, 163, 184, 0.38);
}

body[data-theme='dark'] .mekari-status[data-state='missing'] .mekari-status__badge {
  background: rgba(100, 116, 139, 0.28);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.5);
}

body[data-theme='dark'] .mekari-status[data-state='pending'] .mekari-status__indicator {
  background: #facc15;
}

body[data-theme='dark'] .mekari-status[data-state='syncing'] .mekari-status__indicator {
  background: #38bdf8;
}

body[data-theme='dark'] .mekari-status[data-state='missing'] .mekari-status__badge img {
  filter: grayscale(1);
  opacity: 0.6;
}

body[data-theme='dark'] .mekari-status[data-state='syncing'] .mekari-status__badge {
  background: rgba(14, 165, 233, 0.28);
  border-color: rgba(125, 211, 252, 0.45);
}

body[data-theme='dark'] .mekari-status[data-state='error'] .mekari-status__badge {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.4);
}

body[data-theme='dark'] .mekari-status__label {
  color: #e2e8f0;
}

body[data-theme='dark'] .mekari-status__state {
  color: rgba(148, 163, 184, 0.9);
}

body[data-theme='dark'] .mekari-status__meta {
  color: rgba(148, 163, 184, 0.75);
}

body[data-theme='dark'] .mekari-status__badge.has-tooltip::after {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.55);
}

body[data-theme='dark'] .mekari-status__badge.has-tooltip::before {
  background: #e2e8f0;
}

@keyframes mekari-indicator-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(56, 189, 248, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mekari-status__badge,
  .mekari-status__badge::after,
  .mekari-status__badge::before,
  .mekari-status__indicator,
  .mekari-status__indicator::after {
    transition: none;
  }

  .mekari-status[data-state='syncing'] .mekari-status__indicator {
    animation: none;
  }
}

.product-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--color-muted);
}

.category-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.category-table th,
.category-table td {
  text-align: left;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  vertical-align: middle;
}

.category-table th:last-child,
.category-table td:last-child {
  text-align: center;
  width: 120px;
}

.category-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--color-muted);
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: var(--color-primary);
}

.table-sort-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.table-sort-button[data-sort-active='true'] {
  color: var(--color-primary);
}

.table-sort-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.table-sort-indicator::before {
  content: '↕';
}

.table-sort-button[data-sort-active='true'] .table-sort-indicator {
  opacity: 1;
}

.table-sort-button[data-sort-direction='asc'] .table-sort-indicator::before {
  content: '▲';
}

.table-sort-button[data-sort-direction='desc'] .table-sort-indicator::before {
  content: '▼';
}

.product-table .empty-state td,
.category-table .empty-state td {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-muted);
  font-style: italic;
}

.fee-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-icon-border);
  color: var(--color-text);
  min-width: 88px;
}

.fee-chip--highlight {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.32);
  color: var(--color-primary);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-icon-border);
  color: var(--color-text);
}

.status-chip--connected {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.32);
  color: var(--color-success);
}

.status-chip--pending {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.32);
  color: var(--color-warning);
}

.status-chip--available {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.32);
  color: var(--color-muted);
}

.integration-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(245, 158, 11, 0.16);
  color: var(--color-warning);
}

.integrations-table td {
  vertical-align: top;
}

.integrations-table td:first-child {
  width: 320px;
}

.integrations-table td:nth-child(4) {
  min-width: 180px;
}

.integrations-table td:nth-child(5) {
  min-width: 200px;
}

.integration-name {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.integration-logo,
.integration-logo-preview {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-icon-border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.integration-logo {
  flex-shrink: 0;
}

.integration-logo__image,
.integration-logo-preview__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-surface);
}

.integration-logo__initial,
.integration-logo-preview__initial {
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
  text-transform: uppercase;
}

.integration-logo-field {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.integration-logo-field__input {
  flex: 1;
  min-width: 0;
}

.integration-logo-field__input input[type='url'] {
  width: 100%;
}

.integration-logo-preview {
  width: 48px;
  height: 48px;
}

.integration-logo-preview__initial[hidden],
.integration-logo-preview__image[hidden] {
  display: none;
}

.integration-name strong {
  display: block;
  font-size: 15px;
}

.integration-capabilities {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.integration-account {
  font-weight: 500;
}

.integration-account.is-empty {
  color: var(--color-muted);
  font-style: italic;
}

.integration-sync {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.integration-sync__frequency {
  font-weight: 500;
}

.integration-sync__meta {
  font-size: 13px;
  color: var(--color-muted);
}

.integration-config {
  min-width: 220px;
}

.integration-config dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.integration-config dl > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.integration-config dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.integration-config dd {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', monospace;
  font-size: 13px;
  color: var(--color-text);
  word-break: break-all;
}

.integration-config code {
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  display: inline-block;
}

.integration-config .token-value {
  letter-spacing: 0.08em;
}

.integration-config .is-empty {
  color: var(--color-muted);
  font-style: italic;
}


.integration-actions {
  text-align: right;
}

.integration-actions__layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.integration-actions__primary,
.integration-actions__secondary {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.integration-actions__secondary {
  justify-content: flex-end;
}

.integration-actions .btn.small {
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .integrations-table td {
    vertical-align: top;
  }

  .integration-actions__layout {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
  }

  .integration-actions__primary,
  .integration-actions__secondary {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .integration-actions__secondary {
    flex-wrap: wrap;
  }

  .integration-actions__secondary .btn.small {
    width: auto;
  }
}

.integration-metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.integration-metric {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface-alt);
}

.integration-metric__label {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0;
}

.integration-metric__value {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.integration-metric__meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

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

.integration-highlight {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface-alt);
}

.integration-highlight__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-icon-border);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.integration-highlight h3 {
  margin: 0;
  font-size: 16px;
}

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

.report-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-sync-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  width: min(100%, 360px);
  flex-wrap: wrap;
}

.report-sync-status .report-pnl__sync {
  padding: 0;
  background: transparent;
  border: none;
}

.report-sync-status .report-pnl__sync-value {
  color: var(--color-text);
}

.report-sync-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--color-warning);
  position: relative;
}

.report-sync-indicator::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.18;
}

.report-sync-indicator.is-online {
  background: var(--color-success);
}

.report-sync-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.report-sync-label {
  font-size: 12px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-sync-text strong {
  font-size: 15px;
}

.report-filters {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-filter-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.report-filter-group select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
}

.report-filter-group select:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-range-filter {
  position: relative;
}

.date-range-filter__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.date-range-filter__trigger:hover {
  border-color: var(--color-primary);
}

.date-range-filter__trigger:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-range-filter__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.date-range-filter__popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(320px, 100vw - 32px);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.date-range-filter__popover[hidden] {
  display: none !important;
}

.date-range-filter__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-range-filter__section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.date-range-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.date-range-filter__close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, outline 0.2s ease;
}

.date-range-filter__close:hover {
  color: var(--color-text);
  background: rgba(37, 99, 235, 0.12);
}

.date-range-filter__close:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-range-filter__quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-range-filter__quick-button {
  flex: 1 1 120px;
  min-width: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-align: center;
}

.date-range-filter__quick-button:hover {
  border-color: var(--color-primary);
}

.date-range-filter__quick-button.is-active {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

.date-range-filter__custom-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.date-range-filter__input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 180px;
  min-width: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.date-range-filter__input input[type="date"] {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}

.date-range-filter__input input[type="date"]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-range-filter__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.date-range-filter__action {
  flex: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.date-range-filter__action:hover {
  border-color: var(--color-primary);
}

.date-range-filter__action:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-range-filter__action--apply {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.date-range-filter__action--apply:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

@media (max-width: 640px) {
  .date-range-filter__popover {
    width: min(100vw - 24px, 360px);
    left: 50%;
    transform: translateX(-50%);
  }

  .date-range-filter__custom-inputs {
    justify-content: center;
  }

  .date-range-filter__input {
    max-width: 100%;
    flex: 1 1 140px;
  }
}

.report-metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.report-pnl__sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 500;
}

.report-pnl__sync-value {
  color: var(--color-text);
  font-weight: 600;
}

.report-pnl__error {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  font-size: 14px;
}

.report-pnl__cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.report-pnl__layout {
  display: grid;
  gap: 24px;
}

@media (min-width: 1024px) {
  .report-pnl__layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: stretch;
  }
}

.report-pnl__integration {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-pnl__integration-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-pnl__integration-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 0 0 6px;
}

.report-pnl__integration-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.report-pnl__integration-account {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

.report-pnl__integration-account.is-empty {
  font-style: italic;
}

.report-pnl__integration-config {
  display: grid;
  gap: 12px;
}

.report-pnl__config-item {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.08);
}

.report-pnl__config-item dt {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.report-pnl__config-item dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-all;
}

.report-pnl__config-item code,
.report-pnl__token {
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: inline-block;
}

.report-pnl__config-item.is-empty {
  background: transparent;
}

.report-pnl__config-item.is-empty code,
.report-pnl__config-item.is-empty .report-pnl__token {
  background: rgba(148, 163, 184, 0.08);
  color: var(--color-muted);
}

.report-pnl__token {
  color: var(--color-primary);
}

.report-pnl__integration-placeholder {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.report-pnl__integration-placeholder a {
  color: var(--color-primary);
  font-weight: 600;
}

.report-pnl__integration.is-empty .status-chip {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--color-muted);
}

.report-pnl__card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-pnl__label {
  font-size: 13px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-pnl__value {
  font-size: 22px;
  font-weight: 700;
}

.report-pnl.is-loading .report-pnl__cards,
.report-pnl.is-loading .report-pnl__sync {
  opacity: 0.6;
}

.report-metric {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-metric__label {
  font-size: 13px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-metric__value {
  font-size: 22px;
  font-weight: 700;
}

.report-metric__meta {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0;
}

.report-table { 
  min-width: 980px;
}

.report-table th:first-child,
.report-table td:first-child {
  min-width: 240px;
}

.report-table th:nth-child(5),
.report-table th:nth-child(6),
.report-table th:nth-child(7),
.report-table th:nth-child(8),
.report-table th:nth-child(9),
.report-table th:nth-child(10),
.report-table td:nth-child(5),
.report-table td:nth-child(6),
.report-table td:nth-child(7),
.report-table td:nth-child(8),
.report-table td:nth-child(9),
.report-table td:nth-child(10) {
  text-align: right;
}

.report-table th:nth-child(11),
.report-table td:nth-child(11),
.report-table th:nth-child(12),
.report-table td:nth-child(12) {
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.status-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.status-card--primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), var(--color-surface));
  border-color: rgba(37, 99, 235, 0.28);
}

.status-card--accent {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), var(--color-surface));
  border-color: rgba(14, 165, 233, 0.2);
}

.status-card__label {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.status-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
}

.status-card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.tab-container {
  margin-top: 16px;
}

.tab-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 12px 8px;
}

.tab-nav__button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-nav__button:hover,
.tab-nav__button:focus-visible {
  color: var(--color-text);
  background: rgba(37, 99, 235, 0.06);
  outline: none;
}

.tab-nav__button.is-active {
  color: var(--color-primary-dark);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-panels {
  margin-top: 8px;
}

.tab-panel[hidden] {
  display: none;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  color: var(--color-text);
}

.record-table th,
.record-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.record-table th {
  color: var(--color-muted);
  font-weight: 700;
  background: var(--color-surface-alt);
}

.record-table .numeric {
  text-align: right;
}

.record-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.9rem;
}

.status-badge::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.status-badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b7791f;
}

.status-badge--warning::before {
  background: #f59e0b;
}

.status-badge--success {
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
}

.status-badge--success::before {
  background: #10b981;
}

.status-badge--info {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.status-badge--info::before {
  background: #6366f1;
}

.ghost-link {
  background: none;
  border: none;
  color: var(--color-primary-dark);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.ghost-link:hover,
.ghost-link:focus-visible {
  background: rgba(37, 99, 235, 0.08);
  outline: none;
}

.report-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
}

.report-status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.report-status-pill.is-on-track {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.28);
}

.report-status-pill.is-manual {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
}

.report-status-pill.is-scheduled {
  color: var(--color-primary);
  background: var(--color-accent-soft);
  border-color: rgba(37, 99, 235, 0.28);
}

.report-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.report-source-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 180px;
  text-align: left;
  font-weight: 700;
  line-height: 1.3;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.report-source-tab__note {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.report-source-tab.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
}

body[data-warehouse-source='auto'] [data-warehouse-manual-container],
body[data-warehouse-source='auto'] [data-warehouse-auto-actions][hidden],
body[data-warehouse-source='auto'] [data-warehouse-manual-period-tabs] {
  display: none;
}

body[data-warehouse-source='manual'] [data-warehouse-auto-container],
body[data-warehouse-source='manual'] [data-warehouse-auto-actions] {
  display: none;
}

body[data-warehouse-source='manual'] [data-warehouse-manual-container] {
  display: grid;
}

.warehouse-manual-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  grid-column: 1 / -1;
}

.warehouse-manual-period-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.warehouse-manual-period-tab.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  background: var(--color-accent-soft);
  color: var(--color-primary);
}

.warehouse-manual-upload {
  border: 1px dashed var(--color-border-stronger);
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 12px;
}

.warehouse-manual-upload ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--color-text-muted);
}

.warehouse-manual-upload__info p {
  margin: 0;
}

.warehouse-manual-upload__status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.warehouse-manual-upload__status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--color-border);
  border: 1px solid var(--color-border-stronger);
}

.warehouse-manual-upload__status-dot.is-active {
  background: rgba(37, 99, 235, 0.18);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.warehouse-manual-upload__status-dot.is-warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--color-warning);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.warehouse-manual-upload__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.stacked-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.helper-text {
  color: var(--color-text-muted);
  font-size: 13px;
}

.report-integration-guide {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-integration-step {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 16px;
  background: var(--color-surface-alt);
}

.report-integration-step__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-icon-border);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.report-integration-step h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.report-integration-step p {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.6;
}

.category-table .category-margin {
  text-align: center;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 14px;
}

.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  font-size: 14px;
}

.form-section__subtitle {
  margin: 6px 0 18px;
  color: var(--color-muted);
  font-size: 14px;
}

.contact-stack .contact-name {
  font-weight: 600;
  color: var(--color-text);
}

.contact-stack a {
  font-weight: 500;
}

.table-note {
  color: var(--color-muted);
  font-size: 14px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  flex-wrap: wrap;
}

.detail-list li span:first-child {
  color: var(--color-muted);
  font-weight: 600;
}

.detail-list li span:last-child {
  text-align: right;
}

@media (max-width: 768px) {
  .detail-list li span:last-child {
    text-align: left;
  }
}

.photo-preview {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: #edeff8;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--color-muted);
  overflow: hidden;
}

.product-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.product-expand-row td {
  padding: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
}

.product-expand-row.is-expanded td {
  border-bottom: none;
}

.product-expand-section {
  padding: 4px 18px 0;
}

@media (min-width: 961px) {
  .product-row > td {
    border-bottom: none;
  }
}

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

.product-cell strong {
  font-weight: 600;
  word-break: break-word;
  display: block;
  line-height: 1.35;
}

.product-expand-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: var(--color-surface, #fff);
  color: var(--color-text);
  border-radius: 0;
  padding: 12px 0;
  cursor: pointer;
  text-align: left;
  gap: 12px;
}

.product-expand-toggle__info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-expand-toggle__label {
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text);
  font-weight: 500;
}

.product-expand-toggle__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.product-expand-toggle__cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.product-expand-toggle:is(:hover, :focus-visible) {
  background: var(--color-surface, #fff);
}

.product-expand-toggle.is-active {
  background: var(--color-surface, #fff);
}

.product-expand-toggle.is-active .product-expand-toggle__cta {
  color: var(--color-text);
}

.product-status-mobile {
  display: none;
}

.product-mobile-controls {
  display: none;
  width: 100%;
}

.product-mobile-actions {
  display: none;
  width: auto;
}

.product-expand-toggle--mobile {
  display: none;
}

.product-meta {
  color: var(--color-muted);
  font-size: 13px;
}

.product-sku {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted-strong, var(--color-muted));
}

.product-variant-row td {
  padding: 0;
  background: var(--color-surface-alt);
  border-bottom: none;
}

.product-variant-row.is-expanded td {
  border-bottom: 1px solid var(--color-border);
}

.product-variant-content {
  padding: 24px 28px 28px;
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
}

.product-variant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.product-variant-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.product-variant-subtitle {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.sku-collapse-btn {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sku-collapse-btn:is(:hover, :focus-visible) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sku-table-wrapper {
  overflow-x: auto;
}

.sku-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.sku-table th,
.sku-table td {
  text-align: left;
  padding: 10px 0;
  font-size: 13px;
}

.sku-table thead th {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}

.sku-table tbody td {
  border-bottom: 1px solid var(--color-border);
}

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

.sku-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sku-code {
  font-weight: 600;
  font-size: 13px;
  word-break: break-all;
}

.sku-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.sku-empty-state {
  padding: 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.04);
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
}

.sku-empty-state strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 4px;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-meta {
  color: var(--color-muted);
  font-size: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #c7c9d6;
  transition: .2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.action-menu {
  position: relative;
}

.action-menu__trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.action-menu__trigger--label {
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  border: none;
  padding: 0;
}

.action-menu__trigger:hover,
.action-menu__trigger:focus-visible,
.action-menu[data-open="true"] .action-menu__trigger {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.action-menu__trigger:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.action-menu__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 4px 0;
  z-index: 1200;
}

.action-menu__item {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  transition: background 0.2s ease;
}

.action-menu__item:hover,
.action-menu__item:focus-visible {
  background: var(--color-surface-alt);
  outline: none;
}

.action-menu__item--danger {
  color: var(--color-danger);
}

body[data-theme="dark"] .action-menu__trigger {
  background: var(--color-surface-alt);
}

body[data-theme="dark"] .action-menu__list {
  box-shadow: 0 20px 30px rgba(2, 6, 23, 0.7);
}

.form-card {
  gap: 32px;
}

.mapping-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.mapping-toolbar input[type='search'],
.mapping-toolbar input[type='text'] {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font: inherit;
  color: var(--color-text);
}

.mapping-toolbar .btn {
  flex-shrink: 0;
}

.mapping-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mapping-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--color-surface-alt);
}

body[data-theme="dark"] .mapping-group {
  background: var(--color-surface);
}

.mapping-group__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .mapping-group__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.mapping-group__stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--color-muted);
}

.mapping-group__meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.mapping-group__prefix {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.mapping-group__target {
  font-size: 14px;
  color: var(--color-muted);
}

.mapping-group__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .mapping-group__actions {
    align-items: flex-end;
    text-align: right;
  }
}

.mapping-group__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-lg);
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
}

body[data-theme="dark"] .mapping-group__badge {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.mapping-table th,
.mapping-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.mapping-table th {
  font-weight: 600;
  color: var(--color-muted);
}

.mapping-empty-state {
  padding: 32px;
  text-align: center;
  color: var(--color-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.manual-mapping-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 992px) {
  .manual-mapping-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
  }
}

.manual-mapping-products {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  overflow: hidden;
}

body[data-theme="dark"] .manual-mapping-products {
  background: var(--color-surface);
}

.manual-mapping-products table {
  width: 100%;
  border-collapse: collapse;
}

.manual-mapping-products th,
.manual-mapping-products td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 14px;
}

.manual-mapping-products th {
  font-weight: 600;
  color: var(--color-muted);
}

.manual-product-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.manual-product-meta {
  display: block;
  font-size: 13px;
  color: var(--color-muted);
}

.manual-mapping-form {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--color-surface-alt);
}

body[data-theme="dark"] .manual-mapping-form {
  background: var(--color-surface);
}

.manual-mapping-form form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manual-selection-info {
  font-size: 14px;
  color: var(--color-muted);
}

.mapping-status-log {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-muted);
  list-style: none;
  padding-left: 0;
}

.mapping-status-log li {
  margin-bottom: 6px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-row > .form-group {
  min-width: 0;
}

.image-upload-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.image-upload-grid::-webkit-scrollbar {
  height: 6px;
}

.image-upload-grid::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.image-upload-grid::-webkit-scrollbar-track {
  background: transparent;
}

.image-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 120px;
  max-width: 120px;
  scroll-snap-align: start;
}

.image-dropzone {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  text-align: center;
  padding: 12px;
}

.image-dropzone .image-icon {
  font-size: 28px;
}

.image-text {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  color: var(--color-muted);
}

.image-dropzone.is-focused {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
  background: var(--color-surface);
}

.image-upload.has-image .image-dropzone {
  border-style: solid;
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.image-upload.has-image .image-icon {
  opacity: 0;
  visibility: hidden;
}

.image-upload.has-image .image-text {
  display: none;
}

.image-dropzone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-preview-image][hidden] {
  display: none;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 440px;
}

.variant-pricing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
}

.variant-table th,
.variant-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.variant-pricing-table th,
.variant-pricing-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: 13px;
  white-space: nowrap;
}

.variant-pricing-table th {
  font-weight: 600;
  text-align: left;
  color: var(--color-muted);
}

.variant-pricing-table td {
  background: var(--color-surface);
}

.variant-pricing-table input,
.variant-pricing-table select {
  width: 100%;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font: inherit;
}

.variant-pricing-table input:focus,
.variant-pricing-table select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
  background: var(--color-surface);
}

.variant-pricing-table .variant-actions {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

.variant-pricing-table .variant-actions.locked {
  color: var(--color-muted);
  font-size: 12px;
}

.variant-pricing-table .variant-actions.locked::after {
  content: '—';
  display: inline-block;
}

.variant-pricing-table .icon-btn {
  margin-inline: auto;
}

.variant-pricing-table .icon-btn.small {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.variant-pricing-table .numeric-input {
  min-width: 110px;
}

.variant-pricing-table .readonly-input {
  background: var(--color-surface-alt);
  color: var(--color-muted);
  cursor: not-allowed;
}

.variant-pricing-table select:disabled {
  background: var(--color-surface);
  color: var(--color-text);
  opacity: 1;
  cursor: default;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal.modal--wide {
  width: min(900px, calc(100% - 48px));
}

.modal {
  width: min(420px, calc(100% - 48px));
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 48px);
  overflow: visible;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  max-height: inherit;
  flex: 1 1 auto;
  min-height: 0;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  padding-bottom: 12px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 16px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--color-surface) 35%, var(--color-surface) 100%);
  backdrop-filter: blur(2px);
}

.modal .icon-btn.small {
  width: 32px;
  height: 32px;
}

.modal .btn {
  min-width: 120px;
}

.modal textarea {
  min-height: 110px;
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 16px;
    align-items: stretch;
  }

  .modal {
    width: min(360px, calc(100% - 24px));
    margin: 0 auto;
    padding: 22px 20px 24px;
    gap: 16px;
    max-height: calc(100vh - 32px);
    height: calc(100vh - 32px);
  }

  .modal-form {
    gap: 16px;
  }

  .modal-body {
    padding: 0;
    gap: 16px;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 18px;
    width: 100%;
  }

  .modal .btn {
    min-width: 0;
    width: 100%;
  }
}

.variant-table th:last-child,
.variant-table td:last-child {
  text-align: center;
}

.variant-row input {
  width: 100%;
}

.variant-actions {
  width: 1%;
  white-space: nowrap;
}

.variant-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.variant-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-options-list:empty {
  display: none;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.option-chip:hover,
.option-chip:focus-visible {
  background: var(--color-icon-hover);
  border-color: var(--color-primary);
  outline: none;
}

.option-chip span:last-child {
  font-size: 12px;
  color: var(--color-muted);
}

.variant-options-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-options-input input {
  flex: 1;
  min-width: 180px;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--color-text);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 240px;
  }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
  }

  .app-shell {
    position: relative;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-width), 320px, 85vw);
    background: var(--color-sidebar);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    border-right: 1px solid var(--color-border);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-content {
    padding: 24px 16px 64px;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-actions {
    align-self: flex-end;
  }

  .content-header {
    flex-direction: column;
  }

  .form-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }

  .variant-pricing-table {
    min-width: 1000px;
  }

  .variant-pricing-table input,
  .variant-pricing-table select {
    min-width: 140px;
  }

  .report-sync-status {
    justify-content: space-between;
    gap: 12px;
  }

  .report-filters {
    grid-template-columns: 1fr;
  }

  .report-metrics {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (min-width: 961px) {
  .sidebar-backdrop {
    display: none;
  }
}

@media (max-width: 900px) {
  .card-header--controls {
    flex-direction: column;
    align-items: stretch;
  }

  .card-header__left {
    width: 100%;
  }

  .card-title-group {
    width: 100%;
  }

  .card-title-row {
    justify-content: space-between;
  }

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

  .card-search {
    margin-left: 0;
    max-width: none;
  }

  .product-table {
    min-width: 680px;
  }

  .product-table th,
  .product-table td {
    padding: 16px 12px;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 32px 24px;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .topbar-left {
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: 1 1 auto;
  }

  .topbar-left .search-bar {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    padding: 4px 12px;
    gap: 4px;
    border-radius: 12px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .topbar-left .search-bar input {
    font-size: 14px;
  }

  .topbar-left .search-icon {
    font-size: 14px;
  }

  .title-bar {
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .card-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .card-header__left {
    gap: 8px;
  }

  .card-title-group {
    gap: 6px;
  }

  .card-search {
    width: 100%;
  }

  .product-table {
    min-width: 620px;
  }

  .product-row td {
    vertical-align: top;
  }

  .product-bulk-controls {
    display: none;
  }

  .product-mobile-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .product-mobile-actions {
    width: 100%;
  }

  .product-mobile-actions .action-menu__trigger {
    width: 40px;
    height: 40px;
  }

  .title-bar h1 {
    font-size: 24px;
    flex: 1 1 auto;
  }

  .title-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
    gap: 8px;
  }

  .card {
    padding: 20px;
  }

  .topbar-actions {
    margin-left: auto;
    align-self: center;
  }

  .topbar-brand .brand {
    display: none;
  }

  .auth-buttons {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .auth-button {
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .auth-button__label {
    display: none;
  }

  .auth-button__icon {
    font-size: 18px;
  }

  .report-overview .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .report-sync-status {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .report-sync-status .btn {
    width: 100%;
    justify-content: center;
  }

  .variant-table,
  .variant-pricing-table {
    min-width: 680px;
  }

  .product-table {
    min-width: 100%;
  }

  .product-table .col-status,
  .product-table .col-photo {
    width: auto;
  }

  .product-table .col-select,
  .product-table td.col-select {
    display: none;
  }

  .product-table .col-actions,
  .product-table td.col-actions {
    display: none;
  }

  .product-table th,
  .product-table td {
    padding: 16px 12px;
  }

  .product-table .col-status,
  .product-table td.col-status {
    display: none;
  }

  .product-status-mobile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 8px;
  }

  .product-status-mobile .mekari-status {
    width: 100%;
  }

  .product-expand-section {
    display: none;
  }

  .product-expand-row {
    display: none;
  }

  .product-mobile-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .product-mobile-controls .product-expand-toggle--mobile {
    flex: 1;
  }

  .product-mobile-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 0;
  }

  .product-mobile-actions .action-menu {
    flex: 0 0 auto;
  }

  .product-mobile-actions .action-menu__trigger {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    font-size: 24px;
  }

  .product-mobile-actions .action-menu__list {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: max-content;
    max-width: calc(100vw - 40px);
  }

  .product-expand-toggle--mobile {
    display: inline-flex;
    flex: 1;
    width: 100%;
  }

  .product-cell strong {
    font-size: 16px;
  }

  .product-variant-content {
    padding: 20px 16px 24px;
  }

  .sku-table {
    min-width: 100%;
  }

  .sku-table th,
  .sku-table td {
    padding: 10px 6px;
    font-size: 12px;
    word-break: break-word;
    text-align: center;
  }

  .sku-table th:nth-child(4),
  .sku-table th:nth-child(5),
  .sku-table th:nth-child(6),
  .sku-table td:nth-child(4),
  .sku-table td:nth-child(5),
  .sku-table td:nth-child(6) {
    display: none;
  }

  .sku-cell {
    align-items: center;
    text-align: center;
    gap: 6px;
  }

  .auth-form,
  .form-section,
  .form-row,
  .image-upload-grid {
    gap: 16px;
  }

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

  .variant-options-input {
    flex-direction: column;
    align-items: stretch;
  }

  .variant-options-input input {
    min-width: 0;
  }
}
