:root {
  --font: "Montserrat", "Segoe UI", Arial, sans-serif;
  --bg-top: #eef5ff;
  --bg-bottom: #f7f8fc;
  --text-main: #142033;
  --text-muted: #657187;
  --text-soft: #8b97ab;
  --primary: #1769ff;
  --primary-600: #0f57df;
  --primary-700: #0b45b9;
  --primary-soft: rgba(23, 105, 255, 0.1);
  --primary-soft-strong: rgba(23, 105, 255, 0.18);
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.82);
  --surface-muted: #f6f8fc;
  --border: rgba(169, 183, 210, 0.42);
  --border-strong: rgba(126, 146, 184, 0.36);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 10px 24px rgba(33, 53, 92, 0.08);
  --shadow-md: 0 22px 56px rgba(33, 53, 92, 0.13);
  --success: #15965f;
  --danger: #dc3f5f;
  --warning: #d48a08;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 284px;
  --sidebar-collapsed-width: 88px;
  --page-background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 32%),
    radial-gradient(circle at 20% 15%, rgba(112, 169, 255, 0.18), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(255, 182, 193, 0.18), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-top: #07111f;
  --bg-bottom: #0d1729;
  --text-main: #f1f6ff;
  --text-muted: #a9b7d0;
  --text-soft: #7f90ae;
  --primary: #6fa8ff;
  --primary-600: #4f91f7;
  --primary-700: #d6e7ff;
  --primary-soft: rgba(111, 168, 255, 0.13);
  --primary-soft-strong: rgba(111, 168, 255, 0.22);
  --surface: rgba(16, 27, 46, 0.94);
  --surface-soft: rgba(16, 27, 46, 0.84);
  --surface-muted: rgba(255, 255, 255, 0.055);
  --border: rgba(145, 168, 210, 0.18);
  --border-strong: rgba(145, 168, 210, 0.29);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 22px 56px rgba(0, 0, 0, 0.38);
  --success: #58c991;
  --danger: #ff7d98;
  --warning: #ffc165;
  --page-background:
    radial-gradient(circle at top left, rgba(93, 136, 255, 0.18), transparent 30%),
    radial-gradient(circle at 18% 16%, rgba(38, 95, 183, 0.3), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(14, 166, 146, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--text-main);
  background: var(--page-background);
}

body.dashboard-page {
  overflow: hidden;
}

body.dashboard-page .app-shell,
body.dashboard-page .sidebar {
  transition: none;
}

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

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

button {
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

.mobile-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 17, 31, 0.42);
  z-index: 30;
}

.app-shell {
  width: calc(100% - 16px);
  min-height: 100vh;
  margin: 0 8px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0 32px;
  transition: grid-template-columns 0.22s ease;
}

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

.public-shell {
  width: min(100% - 16px, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 32px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 40;
  transition: width 0.22s ease, padding 0.22s ease;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.public-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

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

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  position: relative;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary) 0%, #89bdff 100%);
  box-shadow: 0 12px 26px rgba(23, 105, 255, 0.28);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 9px;
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.menu-toggle,
.sidebar-toggle {
  width: 42px;
  height: 42px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: 0.18s ease;
}

.menu-toggle:hover,
.sidebar-toggle:hover {
  background: var(--surface-muted);
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.hamburger {
  width: 18px;
  height: 13px;
  display: grid;
  gap: 4px;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transition: 0.18s ease;
}

body.sidebar-collapsed .sidebar-toggle .hamburger span:nth-child(2) {
  width: 12px;
}

body.sidebar-collapsed .sidebar-toggle .hamburger span:nth-child(3) {
  width: 7px;
}

.sidebar-section-label {
  margin: 0 0 8px 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.nav-link,
.nav-dropdown-toggle {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 12px;
  border-radius: 15px;
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  transition: 0.18s ease;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  opacity: 0.9;
}

.nav-link:hover,
.nav-dropdown-toggle:hover {
  color: var(--text-main);
  background: var(--surface-muted);
  border-color: var(--border);
}

.nav-link.active,
.nav-dropdown.active .nav-dropdown-toggle {
  color: var(--primary-700);
  background: var(--primary-soft);
  border-color: var(--primary-soft-strong);
  font-weight: 700;
}

.nav-link.active::after {
  display: none;
}

.nav-dropdown.active .nav-dropdown-toggle::after {
  display: none;
}

.nav-dropdown {
  display: grid;
  gap: 6px;
}

.nav-dropdown-toggle {
  justify-content: flex-start;
}

.nav-dropdown-caret {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex: none;
  transition: transform 0.18s ease;
}

.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  gap: 6px;
  padding: 6px 0 4px 34px;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: grid;
}

.nav-sub-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  transition: 0.18s ease;
}

.nav-sub-link:hover {
  color: var(--text-main);
  background: var(--surface-muted);
  border-color: var(--border);
}

.nav-sub-link.active {
  color: var(--primary-700);
  background: var(--primary-soft);
  border-color: var(--primary-soft-strong);
}

.market-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.market-dot.ozon {
  background: #1769ff;
}

.market-dot.wb {
  background: #a53cff;
}

.market-dot.yandex {
  background: #ffcc00;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

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

.user-label {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.user-value {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.theme-toggle,
.logout-btn {
  width: 100%;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.theme-icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffe28d 0%, #ffb467 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.theme-text {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  text-align: left;
  gap: 1px;
}

.theme-label {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-state {
  font-size: 13px;
  font-weight: 700;
}

body.sidebar-collapsed .sidebar {
  padding: 16px 12px;
  align-items: center;
}

body.sidebar-collapsed .sidebar-header {
  width: 100%;
  flex-direction: column;
}

body.sidebar-collapsed .brand {
  width: 100%;
  justify-content: center;
  padding: 4px 0 8px;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-dropdown-caret,
body.sidebar-collapsed .user-card,
body.sidebar-collapsed .theme-text,
body.sidebar-collapsed .logout-text {
  display: none;
}

body.sidebar-collapsed .nav-dropdown-menu,
body.sidebar-collapsed .nav-dropdown.open .nav-dropdown-menu {
  display: none;
}

body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-footer {
  width: 100%;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-dropdown-toggle {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .theme-toggle,
body.sidebar-collapsed .logout-btn {
  padding: 0;
  min-width: 0;
}

body.sidebar-collapsed .nav-link.active::after {
  display: none;
}

body.sidebar-collapsed .nav-link.active,
body.sidebar-collapsed .nav-dropdown.active .nav-dropdown-toggle {
  box-shadow: inset 3px 0 0 var(--primary);
}

body.dashboard-page .main-area {
  grid-template-rows: 1fr;
}

body.dashboard-page .topbar,
body.dashboard-page .breadcrumbs {
  display: none;
}

body.dashboard-page .page-stack {
  gap: 0;
}

.main-area {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

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

.topbar .menu-toggle {
  display: none;
}

.topbar-title-wrap {
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-heading {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-copy {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-copy:empty,
.topbar-actions:empty {
  display: none;
}

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

.message-region {
  display: grid;
  gap: 12px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.breadcrumbs a,
.breadcrumbs span {
  color: inherit;
}

.breadcrumbs a {
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.breadcrumbs a:hover {
  color: var(--text-muted);
  border-color: currentColor;
}

.breadcrumbs .separator {
  opacity: 0.65;
}

.message-stack {
  display: grid;
  gap: 10px;
}

.message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.message.success {
  border-color: rgba(21, 150, 95, 0.18);
  background: linear-gradient(180deg, rgba(21, 150, 95, 0.08), rgba(21, 150, 95, 0.04));
}

.message.error,
.message.danger {
  border-color: rgba(220, 63, 95, 0.22);
  background: linear-gradient(180deg, rgba(220, 63, 95, 0.08), rgba(220, 63, 95, 0.04));
}

.message.warning {
  border-color: rgba(212, 138, 8, 0.22);
  background: linear-gradient(180deg, rgba(212, 138, 8, 0.08), rgba(212, 138, 8, 0.04));
}

.message.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.message-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.message-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.message.success .message-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(21, 150, 95, 0.12);
}

.message.error .message-dot,
.message.danger .message-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 63, 95, 0.12);
}

.message.warning .message-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(212, 138, 8, 0.12);
}

.message-body {
  min-width: 0;
  color: var(--text-main);
  line-height: 1.6;
}

.message-close {
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.message-close:hover {
  color: var(--text-main);
  background: var(--surface-muted);
}

.page-stack {
  display: grid;
  gap: 20px;
}

.public-page-stack {
  min-height: calc(100vh - 170px);
  align-content: center;
}

.hero-card,
.content-card,
.marketplace-group,
.dashboard-frame,
.mini-card,
.insight-card,
.empty-state,
.panel-card,
.table-card,
.auth-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-card,
.content-card,
.marketplace-group,
.dashboard-frame,
.insight-card,
.empty-state,
.panel-card,
.table-card,
.auth-card {
  border-radius: var(--radius-lg);
}

.hero-card,
.content-card,
.panel-card,
.table-card,
.auth-card,
.empty-state {
  padding: 24px;
}

.hero-card {
  overflow: hidden;
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 92% 8%, var(--primary-soft), transparent 28%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: stretch;
}

.hero-aside {
  display: grid;
  gap: 12px;
}

.mini-card {
  padding: 18px;
  border-radius: 18px;
}

.eyebrow,
.soft-pill,
.status-pill,
.shop-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  border: 1px solid transparent;
}

.eyebrow,
.soft-pill {
  color: var(--primary-700);
  background: var(--primary-soft);
  border-color: var(--primary-soft-strong);
}

.status-pill::before,
.shop-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.active,
.shop-badge.active {
  color: var(--success);
  background: rgba(21, 150, 95, 0.1);
  border-color: rgba(21, 150, 95, 0.16);
}

.status-pill.inactive,
.shop-badge.inactive {
  color: var(--danger);
  background: rgba(220, 63, 95, 0.1);
  border-color: rgba(220, 63, 95, 0.16);
}

.shop-badge.draft {
  color: var(--warning);
  background: rgba(212, 138, 8, 0.11);
  border-color: rgba(212, 138, 8, 0.18);
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin-top: 0;
}

.hero-title {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-text,
.section-copy,
.card-copy,
.copy-block,
.copy-block p,
.copy-block li {
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-text {
  max-width: 62ch;
  margin-bottom: 0;
  font-size: 15px;
}

.hero-actions,
.card-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.compact-toolbar-card {
  padding: 18px 20px;
}

.compact-toolbar {
  display: grid;
  gap: 14px;
}

.compact-actions {
  margin-top: 0;
}

.compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-label,
.detail-label,
.insight-kicker,
.field-label {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.accent-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5aa3ff 100%);
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.22);
}

.secondary-btn {
  color: var(--primary-700);
  background: var(--primary-soft);
  border-color: var(--primary-soft-strong);
}

.ghost-btn {
  color: var(--text-main);
  background: var(--surface);
  border-color: var(--border);
}

.accent-btn {
  color: #8d4b00;
  background: linear-gradient(135deg, #ffd36c 0%, #ffb15d 100%);
  box-shadow: 0 12px 24px rgba(255, 177, 93, 0.28);
}

.danger-btn {
  color: #fff;
  background: linear-gradient(135deg, #e3516d 0%, #ff8b77 100%);
  box-shadow: 0 12px 24px rgba(220, 63, 95, 0.2);
}

.btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.accent-btn:hover,
.danger-btn:hover,
.logout-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.btn:focus-visible,
.secondary-btn:focus-visible,
.ghost-btn:focus-visible,
.accent-btn:focus-visible,
.danger-btn:focus-visible,
.theme-toggle:focus-visible,
.menu-toggle:focus-visible,
.sidebar-toggle:focus-visible,
.message-close:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--primary-soft-strong);
  outline-offset: 2px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-copy {
  margin: 5px 0 0;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-list,
.status-list {
  display: grid;
  gap: 12px;
}

.detail-item,
.status-row {
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.detail-value,
.status-value {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-page .hero-card,
.profile-page .content-card {
  padding: 20px;
}

.profile-page .hero-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.profile-page .hero-aside,
.profile-page .detail-list,
.profile-page .grid.two {
  gap: 14px;
}

.profile-page .mini-card {
  padding: 14px 16px;
  border-radius: 16px;
}

.profile-page .detail-item {
  padding: 12px 14px;
}

.profile-page .metric-value {
  font-size: 19px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.status-description {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.insight-grid,
.seller-grid,
.stats-grid {
  display: grid;
  gap: 18px;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.insight-card,
.seller-card {
  padding: 20px;
  border-radius: 18px;
}

.seller-card {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  display: grid;
  gap: 16px;
}

.seller-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.card-title,
.insight-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}

.insight-text,
.card-copy {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.shop-meta,
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-view {
  min-height: calc(100vh - 136px);
}

.dashboard-frame {
  height: 100%;
  min-height: calc(100vh - 136px);
  overflow: hidden;
  background: var(--surface);
}

.dashboard-embed {
  width: 100%;
  height: calc(100vh - 136px);
  border: 0;
  background: linear-gradient(180deg, var(--surface), var(--surface-muted));
}

.dashboard-canvas {
  min-height: calc(100vh - 136px);
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 30% 18%, var(--primary-soft), transparent 28%),
    linear-gradient(180deg, var(--surface), var(--surface-muted));
}

.dashboard-empty {
  max-width: 720px;
  text-align: center;
  padding: 34px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}

.empty-state {
  text-align: center;
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--primary-700);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-strong);
}

.empty-state h3,
.dashboard-empty h1 {
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.dashboard-empty h1 {
  font-size: 26px;
}

.empty-state h3 {
  font-size: 18px;
}

.empty-state p,
.dashboard-empty p {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.6;
}

.empty-state .inline-actions,
.dashboard-empty .inline-actions {
  justify-content: center;
  margin-top: 18px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.table-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.seller-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.seller-table th {
  padding: 0 14px 4px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.seller-table td {
  padding: 14px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.seller-table td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 16px 0 0 16px;
}

.seller-table td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 16px 16px 0;
}

.table-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.table-subtitle {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.api-key-mask-list {
  display: grid;
  gap: 8px;
}

.api-key-mask-row {
  display: grid;
  gap: 4px;
}

.api-key-mask-label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .btn,
.table-actions .secondary-btn,
.table-actions .ghost-btn,
.table-actions .danger-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

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

.form-column,
.form-meta {
  display: grid;
  gap: 18px;
}

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

.form-group {
  display: grid;
  gap: 8px;
}

.field-required {
  color: var(--danger);
}

.form-group input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}

.form-group select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-soft);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-soft-strong);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--surface);
}

.field-help {
  color: var(--text-muted);
  font-size: 12px;
}

.field-errors,
.errorlist {
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}

.error-note {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(220, 63, 95, 0.22);
  background: rgba(220, 63, 95, 0.08);
  color: var(--text-main);
}

.error-note > *:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

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

.file-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.file-trigger {
  cursor: pointer;
}

.file-name {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px dashed var(--border);
  background: var(--surface-muted);
  color: var(--text-main);
  font-weight: 600;
}

.file-name.is-empty {
  color: var(--text-soft);
  font-weight: 500;
}

.example-image-wrap {
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.example-image {
  width: 100%;
  height: auto;
}

.copy-block > *:last-child {
  margin-bottom: 0;
}

.copy-block h2,
.copy-block h3 {
  margin: 24px 0 12px;
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.35;
}

.copy-block ul,
.copy-block ol {
  padding-left: 20px;
  margin-bottom: 18px;
}

.copy-block li + li {
  margin-top: 8px;
}

.copy-block strong,
.copy-block em {
  color: var(--text-main);
}

.auth-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 210px);
}

.auth-card {
  width: min(100%, 520px);
}

.auth-title {
  margin: 14px 0 10px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.auth-copy {
  margin-bottom: 20px;
  color: var(--text-muted);
}

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

.auth-actions {
  margin-top: 18px;
}

.mono,
.api-key-mask {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.api-key-mask {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.site-footer {
  margin-top: 4px;
}

.footer-card {
  padding: 20px 22px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.footer-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.logout-btn {
  color: var(--danger);
  border-color: rgba(220, 63, 95, 0.24);
  background: rgba(220, 63, 95, 0.08);
}

.logout-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #e3516d 0%, #ff8b77 100%);
  border-color: transparent;
}

@media (max-width: 1180px) {
  .hero-grid,
  .grid.two,
  .grid.three,
  .insight-grid,
  .stats-grid,
  .form-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  body {
    overflow-x: hidden;
  }

  body.dashboard-page {
    overflow: auto;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    width: min(100% - 20px, 1440px);
    margin: 0 auto;
    display: block;
    padding: 10px 0 24px;
  }

  .public-shell {
    width: min(100% - 20px, 1240px);
    padding: 10px 0 24px;
  }

  .topbar .menu-toggle {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(320px, calc(100vw - 20px));
    min-height: 0;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.24s ease;
    overflow-y: auto;
  }

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

  body.sidebar-open .mobile-scrim {
    display: block;
  }

  body.sidebar-collapsed .sidebar {
    width: min(320px, calc(100vw - 20px));
    padding: 20px;
    align-items: stretch;
  }

  body.sidebar-collapsed .sidebar-header {
    flex-direction: row;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 4px 0 12px;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .sidebar-section-label,
  body.sidebar-collapsed .nav-text,
  body.sidebar-collapsed .nav-dropdown-caret,
  body.sidebar-collapsed .user-card,
  body.sidebar-collapsed .theme-text,
  body.sidebar-collapsed .logout-text {
    display: initial;
  }

  body.sidebar-collapsed .nav-dropdown.open .nav-dropdown-menu {
    display: grid;
    padding-left: 34px;
  }

  body.sidebar-collapsed .nav-link,
  body.sidebar-collapsed .nav-dropdown-toggle {
    justify-content: flex-start;
    padding: 0 12px;
  }

  body.sidebar-collapsed .theme-toggle,
  body.sidebar-collapsed .logout-btn {
    padding: 0 15px;
  }

  .main-area {
    gap: 14px;
  }

  .topbar,
  .public-header {
    position: sticky;
    top: 10px;
    z-index: 20;
    padding: 14px;
    border-radius: 20px;
  }

  .topbar-heading {
    font-size: 18px;
  }

  .topbar-actions {
    display: none;
  }

  .dashboard-view,
  .dashboard-frame,
  .dashboard-canvas,
  .dashboard-embed {
    min-height: calc(100vh - 104px);
    height: calc(100vh - 104px);
  }

  body.dashboard-page .dashboard-frame,
  body.dashboard-page .dashboard-canvas,
  body.dashboard-page .dashboard-embed {
    min-height: calc(100vh - 20px);
    height: calc(100vh - 20px);
  }
}

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

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .seller-table {
    min-width: 760px;
  }
}

@media (max-width: 640px) {
  .hero-card,
  .content-card,
  .marketplace-group,
  .dashboard-empty,
  .panel-card,
  .table-card,
  .auth-card,
  .empty-state {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-title,
  .auth-title {
    font-size: 24px;
  }

  .hero-actions,
  .card-actions,
  .inline-actions,
  .public-header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn,
  .secondary-btn,
  .ghost-btn,
  .accent-btn,
  .danger-btn,
  .theme-toggle {
    width: 100%;
  }

  .seller-card-top {
    display: grid;
  }

  .footer-card {
    padding: 18px;
  }

  .file-picker-row {
    display: grid;
  }
}
