:root {
  color-scheme: light;
  --background: #f3f4f6;
  --surface: #ffffff;
  --surface-muted: #f8f8f9;
  --ink: #1c1c1f;
  --muted: #686970;
  --line: #dedfe3;
  --line-strong: #c8c9cf;
  --accent: #c8342f;
  --accent-dark: #a82521;
  --accent-soft: #fff0ef;
  --success: #247a52;
  --warning: #9b5d00;
  --sidebar: #202125;
  --sidebar-muted: #aeb0b7;
  --focus: #2767d8;
  --shadow: 0 18px 48px rgba(24, 24, 28, 0.11);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

@media (max-width: 900px) {
  .storage-columns { grid-template-columns: 1fr; }
  .storage-asset-row { grid-template-columns: 50px minmax(0, 1fr); }
  .storage-asset-row .storage-actions { grid-column: 2; }
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
}

button, input { font: inherit; }

button { min-width: 24px; min-height: 24px; }

button:focus-visible,
input:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid rgba(39, 103, 216, 0.42);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--focus);
  border-radius: 6px;
}

.skip-link:focus { top: 12px; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(480px, 1.1fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(48px, 7vw, 112px);
  color: #fff;
  background: var(--sidebar);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -130px;
  bottom: -130px;
  width: 360px;
  height: 360px;
  border: 70px solid rgba(200, 52, 47, 0.26);
  transform: rotate(22deg);
}

.brand-mark {
  width: max-content;
  padding: 8px 14px 6px;
  color: #fff;
  background: var(--accent);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.brand-panel p {
  margin: 18px 0 36px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.95;
}

.brand-panel span {
  max-width: 380px;
  color: #c7c8cc;
  font-size: 18px;
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background:
    radial-gradient(circle at 80% 10%, rgba(200, 52, 47, 0.08), transparent 28%),
    var(--background);
}

.auth-card { width: min(100%, 430px); }
.mobile-brand { display: none; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  max-width: 410px;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.auth-intro {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.field input:hover { border-color: #9b9ca2; }
.field input[aria-invalid="true"] { border-color: var(--accent); }

.password-field { position: relative; }
.password-field input { padding-right: 94px; }

.password-toggle {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.password-toggle:hover { color: var(--ink); background: var(--surface-muted); }

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: #fff;
  border: 1px solid var(--accent);
  background: var(--accent);
}

.primary-button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
}

.secondary-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }

.form-message {
  min-height: 22px;
  margin: -6px 0 12px;
  color: var(--accent-dark);
  font-size: 14px;
  line-height: 1.45;
}

.local-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  color: #fff;
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-logo {
  padding: 6px 8px 5px;
  background: var(--accent);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.sidebar-brand strong,
.sidebar-brand small,
.sidebar-footer strong,
.sidebar-footer small { display: block; }

.sidebar-brand strong { font-size: 16px; }
.sidebar-brand small, .sidebar-footer small { margin-top: 2px; color: var(--sidebar-muted); }

.main-nav {
  display: grid;
  gap: 4px;
  margin-top: 24px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 6px 10px;
  color: #d6d7da;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-item.is-active { color: #fff; background: rgba(200, 52, 47, 0.92); }
.nav-icon { font-size: 11px; font-weight: 800; opacity: 0.75; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px;
}

.environment-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5bc48a;
  box-shadow: 0 0 0 4px rgba(91, 196, 138, 0.12);
}

.workspace { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 100px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.breadcrumbs { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -0.025em; }

.user-area { display: flex; align-items: center; gap: 12px; }
.user-copy { text-align: right; }
.user-copy strong, .user-copy span { display: block; }
.user-copy strong { font-size: 14px; }
.user-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.user-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  border-radius: 50%;
  background: var(--sidebar);
  font-weight: 800;
}

.workspace-content { padding: 28px 32px 48px; }

.welcome {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.welcome h2 { margin: 0; font-size: 28px; letter-spacing: -0.035em; }
.welcome p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.status-pill {
  padding: 7px 10px;
  color: var(--success);
  border: 1px solid #b8ddca;
  border-radius: 999px;
  background: #eef9f3;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.metric-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.metric-card span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card strong { display: block; margin-top: 14px; font-size: 30px; line-height: 1; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); }

.section-heading { margin: 0 0 13px; font-size: 16px; }

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

.module-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 15px;
  min-height: 108px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.module-card:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(24, 24, 28, 0.07); }

.module-number {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
}

.module-copy strong, .module-copy span { display: block; }
.module-copy strong { margin-bottom: 6px; }
.module-copy span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.module-arrow { color: var(--muted); font-size: 20px; }

.placeholder-panel {
  min-height: 440px;
  padding: clamp(28px, 5vw, 60px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.placeholder-panel .step { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.placeholder-panel h2 { margin: 12px 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.04em; }
.placeholder-panel p { max-width: 660px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.roadmap-list {
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.roadmap-list li {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-muted);
}

.creation-lead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.creation-lead .step,
.library-panel .step { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.creation-lead h2, .library-panel h2 { margin: 8px 0; font-size: 30px; letter-spacing: -0.04em; }
.creation-lead p, .products-header p { margin: 0; color: var(--muted); line-height: 1.5; }

.compact-stats { display: flex; gap: 8px; }
.compact-stats div { min-width: 82px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.compact-stats strong, .compact-stats span { display: block; }
.compact-stats strong { font-size: 22px; }
.compact-stats span { margin-top: 4px; color: var(--muted); font-size: 11px; }

.source-workspace {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 14px;
}

.source-selector-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.source-selector-heading > div { font-size: 17px; font-weight: 800; }
.source-selector-heading small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }
.source-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  background: var(--surface-muted);
}
.source-toggle label { min-width: 0; cursor: pointer; }
.source-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.source-toggle span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
}
.source-toggle input:checked + span { color: var(--accent-dark); border-color: #e7aaa6; background: var(--surface); }
.source-toggle input:focus-visible + span { outline: 3px solid rgba(39, 103, 216, 0.3); outline-offset: 1px; }
.source-toggle input:disabled + span { cursor: wait; opacity: 0.6; }
.source-import-status { margin-top: auto; padding: 10px; border-radius: 5px; font-size: 12px; line-height: 1.4; }
.source-import-status strong, .source-import-status span { display: block; }
.source-import-status span { margin-top: 3px; }
.source-import-status.is-ready { color: var(--success); background: #eef9f3; }
.source-import-status.is-warning { color: var(--warning); background: #fff8e7; }

.source-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.source-card h3 { margin: 0; font-size: 17px; }
.source-card > p { min-height: 43px; margin: 8px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.source-card > label:not(.file-picker) { margin-bottom: 6px; font-size: 12px; font-weight: 750; }
.source-card input[type="url"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.download-button { margin-top: auto; text-decoration: none; }
.file-picker, .mini-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 10px;
  padding: 8px 12px;
  color: var(--ink);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.file-picker input,
.mini-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.source-card > input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.template-status { margin-top: auto; padding: 10px; color: var(--warning); border-radius: 5px; background: #fff8e7; font-size: 12px; line-height: 1.4; }
.template-status.is-ready { color: var(--success); background: #eef9f3; }
.compact-file-list { display: grid; gap: 6px; margin-top: 12px; }
.compact-file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.compact-file-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.compact-file-row small { color: var(--muted); }
.compact-file-actions, .storage-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.template-upload-fields { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(150px, 1fr); gap: 8px; margin-top: 10px; }

.storage-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #fafafb 100%);
}
.storage-lead-copy { min-width: 0; }
.storage-lead h2 { margin: 7px 0 6px; font-size: clamp(22px, 2.3vw, 30px); line-height: 1.08; text-wrap: balance; }
.storage-lead p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; text-wrap: pretty; }
.storage-summary { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 8px; }
.storage-summary-item { display: grid; min-width: 88px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.storage-summary-item strong { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.storage-summary-item span { margin-top: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.storage-panel { min-width: 0; margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.storage-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.storage-section-heading > div { min-width: 0; }
.storage-section-heading h2 { margin: 4px 0 5px; font-size: 18px; line-height: 1.2; text-wrap: balance; }
.storage-section-heading p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; text-wrap: pretty; }
.storage-eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.storage-count { display: grid; flex: 0 0 auto; min-width: 34px; min-height: 34px; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.storage-file-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 10px; }
.storage-file-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: border-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out; }
.storage-file-card:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(24, 24, 28, 0.07); transform: translateY(-1px); }
.template-preview-tile { display: grid; place-items: center; width: 76px; height: 106px; color: var(--accent); border: 1px solid var(--line); border-radius: 4px; outline: 1px solid rgba(0, 0, 0, 0.04); outline-offset: -1px; background: linear-gradient(145deg, #fff, #f2f3f5); font-size: 12px; font-weight: 850; letter-spacing: 0.05em; text-decoration: none; }
.storage-file-card > div:not(.storage-actions) { display: grid; gap: 5px; min-width: 0; }
.storage-file-card small, .storage-asset-row small { color: var(--muted); line-height: 1.4; }
.storage-actions { justify-content: flex-end; }
.storage-actions > * { min-height: 40px; }
.storage-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.storage-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.storage-uploader { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1.2fr); gap: 9px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.storage-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 750; }
.storage-field input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 9px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 400; }
.storage-field input[type="file"] { padding: 7px; }
.storage-uploader > button { grid-column: 1 / -1; justify-self: end; min-width: 120px; min-height: 40px; }
.storage-asset-list { display: grid; gap: 7px; max-height: 420px; margin-top: 12px; overflow: auto; scrollbar-gutter: stable; }
.storage-asset-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 7px 11px; align-items: center; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.storage-asset-row:hover { border-color: var(--line-strong); background: #fdfdfd; }
.storage-asset-row img { width: 64px; height: 50px; object-fit: contain; border-radius: 4px; outline: 1px solid rgba(0, 0, 0, 0.09); outline-offset: -1px; background: #fff; }
.storage-asset-placeholder { display: grid; width: 64px; height: 50px; place-items: center; padding: 4px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--surface-muted); font-size: 10px; line-height: 1.2; text-align: center; }
.storage-asset-row > div:not(.storage-actions) { display: grid; gap: 3px; min-width: 0; }
.storage-asset-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-asset-row .storage-actions { grid-column: 2; justify-content: flex-start; }
.storage-empty { grid-column: 1 / -1; margin: 0; padding: 22px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--surface-muted); font-size: 13px; line-height: 1.5; text-align: center; text-wrap: pretty; }

.action-message { min-height: 42px; margin: 14px 0; padding: 11px 13px; border-radius: 6px; font-size: 13px; line-height: 1.45; }
.action-message:empty { visibility: hidden; }
.action-message.is-info { color: #31547f; background: #eef5ff; }
.action-message.is-success { color: var(--success); background: #eaf7f0; }
.action-message.is-error { color: var(--accent-dark); background: var(--accent-soft); }

.products-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.products-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.products-header h2 { margin: 0 0 6px; font-size: 20px; }
.selected-counter { flex: 0 0 auto; padding: 7px 10px; color: var(--accent-dark); border-radius: 999px; background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.products-toolbar { display: flex; align-items: center; gap: 9px; padding: 12px 20px; background: var(--surface-muted); }
.filter-summary { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.products-toolbar input { min-width: 240px; min-height: 40px; flex: 1; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.text-button { min-height: 40px; padding: 0 8px; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.text-button:hover { color: var(--ink); }

.products-table-wrap { max-height: 560px; overflow: auto; }
.products-table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 12px; }
.products-table th { position: sticky; z-index: 3; top: 0; padding: 10px 12px; color: #fff; text-align: left; background: #3f4147; }
.products-table th:first-child { width: 64px; text-align: center; }
.table-sort-button { padding: 0; color: inherit; border: 0; background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.table-sort-button:hover, .table-sort-button:focus-visible { color: #ffe0e0; }
.products-table .table-filter-row th { z-index: 2; top: 38px; padding: 7px 6px; background: #53565d; }
.products-table .table-filter-row th:first-child,
.products-table .table-filter-row th:nth-child(2) { background: #53565d; }
.table-filter-row select { width: 100%; min-width: 108px; height: 32px; padding: 4px 24px 4px 7px; color: var(--ink); border: 1px solid #c8cad0; border-radius: 5px; background: #fff; font-size: 11px; }
.products-table td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid #ececf0; }
.products-table tbody tr:hover { background: #fffafa; }
.products-table td:first-child { text-align: center; }
.products-table .products-empty-state { padding: 28px 20px; color: var(--muted); text-align: center; }
.products-table td > strong, .products-table td > span { display: block; }
.products-table td > span { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.products-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.product-status { width: max-content; margin: 0 !important; padding: 5px 7px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.product-status.is-new { color: #31547f; background: #e9f2ff; }
.product-status.is-generated { color: var(--success); background: #e9f7ef; }
.scheme-status { display: block; margin-top: 0 !important; overflow-wrap: anywhere; }
.scheme-status.is-error { color: var(--accent-dark) !important; }
.scheme-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.scheme-actions .mini-upload { margin-top: 0; }
.scheme-delete-button { min-height: 32px; padding: 5px 8px; color: var(--accent-dark); border: 1px solid #efb5b5; border-radius: 5px; background: #fff7f7; font-size: 11px; font-weight: 700; cursor: pointer; }
.scheme-delete-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.scheme-delete-button:disabled { cursor: wait; opacity: .6; }
.mini-upload { min-height: 32px; margin-top: 7px; padding: 5px 8px; font-size: 11px; }
.without-scheme { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.without-scheme input { width: 14px !important; height: 14px !important; vertical-align: middle; }

.generation-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; }
.compact-primary { width: auto; }
.generation-results { margin: 0 20px 20px; padding: 16px; border: 1px solid #b8ddca; border-radius: 6px; background: #f2fbf6; }
.generation-results h3 { margin: 0 0 10px; color: var(--success); }
.download-list, .library-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.download-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #d8ebdf; }
.download-list a { color: #174f97; overflow-wrap: anywhere; }
.download-list span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

.library-shell {
  display: grid;
  gap: 10px;
}

.library-shell > .action-message:empty {
  display: none;
}

.library-filters,
.library-results-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.library-filters {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(200, 52, 47, 0.035), transparent 32%), var(--surface);
}

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

.library-filters-header h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.library-filters-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.library-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.library-zip-button {
  flex: 0 0 auto;
}

.library-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-period-button {
  min-height: 36px;
  padding: 8px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 750;
  cursor: pointer;
}

.library-period-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.library-period-button.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }

.library-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.library-filter-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.library-filter-grid input,
.library-filter-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.library-filter-grid input:disabled {
  color: var(--muted);
  background: #f4f4f6;
}

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

.library-metric {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.library-metric span { color: var(--muted); font-size: 12px; font-weight: 650; }
.library-metric strong { display: block; margin-top: 9px; font-size: 26px; line-height: 1; }
.library-metric small { display: block; margin-top: 7px; color: var(--muted); }

.library-results-panel {
  overflow: hidden;
  border-top: 3px solid #3f4147;
}

.library-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.library-results-header h2 {
  margin: 0;
  font-size: 18px;
}

.library-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.library-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.library-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 10px 12px;
  color: #fff;
  text-align: left;
  background: #3f4147;
}

.library-table th:first-child,
.library-table td:first-child {
  width: 48px;
  text-align: center;
}

.library-table td {
  padding: 11px 12px;
  vertical-align: top;
  border-bottom: 1px solid #ececf0;
}

.library-table tbody tr:hover { background: #fffafa; }
.library-table tbody tr.is-selected { background: #fff7f7; }
.library-table td > strong,
.library-table td > span { display: block; }
.library-table td > span { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.library-table a { width: max-content; text-decoration: none; }
.library-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.library-scheme {
  width: max-content;
  margin: 0 !important;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.library-scheme.is-ready {
  color: var(--success) !important;
  background: #e9f7ef;
}

.library-scheme.is-missing {
  color: var(--accent-dark) !important;
  background: var(--accent-soft);
}
.empty-state, .loading-state { color: var(--muted); }

.reports-shell {
  display: grid;
  gap: 10px;
}

.reports-shell > .action-message:empty {
  display: none;
}

.report-presets-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #3f4147;
  border-radius: 7px;
  background: var(--surface);
}

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

.report-presets-header h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.report-presets-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-preset-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.report-preset-form input[type="text"] {
  min-width: 220px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.report-preset-shared {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-preset-shared input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.report-presets-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.report-preset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.report-preset-card.is-active {
  border-color: #f0bbb7;
  background: var(--accent-soft);
}

.report-preset-main {
  min-width: 0;
  padding: 0;
  color: var(--ink);
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.report-preset-main strong,
.report-preset-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-preset-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.reports-filters,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.reports-filters {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(200, 52, 47, 0.035), transparent 32%), var(--surface);
}

.report-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-period-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 750;
  cursor: pointer;
}

.report-period-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.report-period-button.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(118px, 1fr));
  gap: 10px;
  align-items: end;
}

.report-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.report-filter-grid input,
.report-filter-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.report-filter-grid input:disabled {
  color: var(--muted);
  background: var(--surface-muted);
}

.report-export {
  width: auto;
  text-decoration: none;
}

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

.report-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.report-metric span { color: var(--muted); font-size: 12px; font-weight: 650; }
.report-metric strong { display: block; margin-top: 10px; font-size: 28px; line-height: 1; }
.report-metric small { display: block; margin-top: 7px; color: var(--muted); }

.reports-body {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  gap: 10px;
  align-items: start;
}

.report-panel {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.report-panel h2 {
  margin: -16px -16px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 16px;
}

.report-chart-panel,
.report-comparison-panel {
  border-top: 3px solid #3f4147;
}

.report-details-panel {
  border-top: 3px solid var(--accent);
}

.report-chart {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.report-chart-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.report-chart svg {
  width: 210px;
  height: 210px;
}

.report-pie-segment {
  cursor: pointer;
  opacity: 0.9;
}

.report-pie-segment:hover,
.report-pie-segment.is-active {
  opacity: 1;
  stroke-width: 20;
}

.report-pie-total {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.report-pie-label {
  fill: var(--muted);
  font-size: 7px;
  font-weight: 700;
}

.report-chart-empty {
  position: absolute;
  display: grid;
  gap: 4px;
  text-align: center;
}

.report-chart-empty strong { font-size: 18px; }
.report-chart-empty span { color: var(--muted); font-size: 12px; }

.report-legend {
  display: grid;
  gap: 6px;
}

.report-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.report-legend-item.is-active {
  border-color: #f0bbb7;
  background: var(--accent-soft);
}

.report-legend-marker {
  width: 10px;
  height: 24px;
  border-radius: 999px;
}

.report-legend-item strong,
.report-legend-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-legend-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.report-detail-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.report-detail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.report-detail-item strong,
.report-detail-item span,
.report-detail-item small {
  display: block;
}

.report-detail-item span {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.report-detail-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.report-detail-item a {
  width: auto;
  min-height: 34px;
  padding-inline: 12px;
  text-decoration: none;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-table th {
  padding: 10px;
  color: #fff;
  text-align: left;
  background: #3f4147;
}

.report-table td {
  padding: 10px;
  border-bottom: 1px solid #ececf0;
}

.report-table tbody tr:hover { background: #fffafa; }
.report-delta { font-weight: 800; }
.report-delta.is-plus { color: var(--success); }
.report-delta.is-minus { color: var(--accent-dark); }

.users-shell {
  display: grid;
  gap: 10px;
}

.users-shell > .action-message:empty {
  display: none;
}

.users-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.users-create-panel {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(200, 52, 47, 0.035), transparent 32%), var(--surface);
}

.users-accounts-panel {
  padding-top: 0;
  overflow: hidden;
  border-top: 3px solid #3f4147;
}

.users-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.users-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -16px 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.users-panel-header h2 {
  margin: 0;
}

.users-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.users-form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.users-form-grid input,
.users-form-grid select,
.users-table input,
.users-table select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.users-role-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.users-role-help article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.users-role-help strong,
.users-role-help span {
  display: block;
}

.users-role-help span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.users-table-wrap {
  overflow: auto;
  margin: 0 -16px -16px;
}

.users-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  font-size: 12px;
}

.users-table th {
  padding: 10px 12px;
  color: #fff;
  text-align: left;
  background: #3f4147;
}

.users-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid #ececf0;
}

.users-table tr.is-disabled {
  color: var(--muted);
  background: #fafafa;
}

.users-table td > strong,
.users-table td > span,
.users-role-note {
  display: block;
}

.users-table td > span,
.users-role-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.users-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--ink);
  font-weight: 750;
}

.users-active-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.password-control {
  position: relative;
  width: 100%;
}

.password-control input {
  padding-right: 82px;
}

.password-reveal-button {
  position: absolute;
  right: 5px;
  top: 5px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.password-reveal-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.users-actions {
  display: flex;
  gap: 7px;
}

.users-actions button {
  min-height: 36px;
  padding-inline: 10px;
}

.user-events-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.user-event-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.user-event-item strong,
.user-event-item span,
.user-event-item small {
  display: block;
}

.user-event-item span {
  margin-top: 4px;
  color: var(--muted);
}

.user-event-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.editor-shell {
  display: grid;
  gap: 12px;
}

.editor-product-picker {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
}

.editor-picker-header,
.editor-ready-heading,
.editor-board-top,
.editor-board-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-picker-header h2,
.editor-picker-header p,
.editor-board-heading strong,
.editor-board-heading small {
  margin: 0;
}

.editor-picker-header > div,
.editor-board-heading {
  display: grid;
  gap: 4px;
}

.editor-picker-header h2 {
  font-size: 21px;
}

.editor-picker-header p,
.editor-board-heading small,
.editor-ready-heading span {
  color: var(--muted);
  font-size: 12px;
}

.editor-step {
  width: fit-content;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-picker-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--accent);
  border: 1px solid #c9d9f5;
  border-radius: 999px;
  background: #f2f6fd;
  font-size: 11px;
  font-weight: 800;
}

.editor-search-wrap {
  position: relative;
  z-index: 20;
}

.editor-search-wrap > input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  font-size: 14px;
}

.editor-search-wrap > input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(39, 103, 216, 0.13);
  outline: none;
}

.editor-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 360px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(24, 24, 28, 0.16);
}

.editor-search-option,
.editor-ready-card {
  display: grid;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.editor-search-option {
  grid-template-columns: 110px minmax(180px, 1fr) minmax(150px, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 5px;
}

.editor-search-option:hover,
.editor-search-option.is-active,
.editor-search-option.is-selected,
.editor-ready-card:hover,
.editor-ready-card.is-selected {
  border-color: #c9d9f5;
  background: #f2f6fd;
}

.editor-search-option span,
.editor-ready-card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-search-option small,
.editor-ready-card small {
  color: var(--muted);
  font-size: 11px;
}

.editor-search-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.editor-label-list {
  max-height: 410px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  scrollbar-gutter: stable;
}

.editor-label-row {
  display: grid;
  grid-template-columns: 116px minmax(220px, 1fr) minmax(170px, 0.65fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 9px;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

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

.editor-label-row strong {
  color: var(--accent);
  font-size: 12px;
}

.editor-label-row span,
.editor-label-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-label-row span {
  font-size: 12px;
}

.editor-label-row small {
  color: var(--muted);
  font-size: 11px;
}

.editor-label-row:hover,
.editor-label-row.is-active,
.editor-label-row.is-selected {
  background: #f2f6fd;
}

.editor-label-row.is-selected {
  box-shadow: inset 3px 0 var(--accent);
}

.editor-ready-heading strong {
  font-size: 13px;
}

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

.editor-ready-card {
  align-content: start;
  gap: 5px;
  min-height: 92px;
  padding: 11px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.editor-ready-card strong {
  color: var(--accent);
  font-size: 13px;
}

.editor-shell > .action-message:empty {
  display: none;
}

.editor-context-panel,
.editor-copy-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.editor-context-panel {
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.9fr) auto;
  align-items: center;
  border-left: 4px solid var(--accent);
}

.editor-context-copy,
.editor-context-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.editor-context-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.editor-context-copy strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-context-copy small,
.editor-context-meta small,
.editor-copy-panel span {
  color: var(--muted);
  font-size: 12px;
}

.editor-status-badge {
  width: fit-content;
  padding: 5px 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 850;
}

.editor-status-badge.is-custom {
  color: #8f221d;
  border-color: #f0bbb7;
  background: var(--accent-soft);
}

.editor-status-badge.is-draft {
  color: #8a5a00;
  border-color: #f3d39a;
  background: #fff7e7;
}

.editor-status-badge.is-saved {
  color: var(--success);
  border-color: #bde4ce;
  background: #eaf7f0;
}

.editor-context-actions,
.editor-tool-actions,
.editor-copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.editor-copy-panel {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, auto);
  align-items: center;
}

.editor-copy-panel strong,
.editor-copy-panel span {
  display: block;
}

.editor-copy-panel strong {
  margin-bottom: 3px;
}

.editor-copy-actions select {
  min-width: 260px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(360px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.editor-save-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(220px, 1fr);
  gap: 8px;
  min-width: 0;
}

.editor-toolbar input {
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.editor-toolbar .secondary-button,
.editor-toolbar .primary-button {
  width: auto;
  white-space: nowrap;
}

.editor-board-heading {
  min-width: 220px;
}

.editor-board-heading strong {
  font-size: 15px;
}

.editor-board-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.editor-canvas-help {
  margin: 0;
  padding: 9px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
  font-size: 11px;
}

.editor-main {
  display: block;
}

.editor-board-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.editor-board-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.editor-product-select {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 220px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.editor-board-top select {
  min-width: 180px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.editor-preview-link {
  text-decoration: none;
}

.editor-stage {
  display: grid;
  justify-items: center;
  padding: clamp(18px, 4vw, 36px);
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(32, 33, 37, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(32, 33, 37, 0.04) 1px, transparent 1px),
    #eef0f3;
  background-size: 18px 18px;
}

.editor-canvas {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 5 / 7;
  min-width: 260px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff url('/label-template-preview.png') center / 100% 100% no-repeat;
  box-shadow: 0 16px 36px rgba(24, 24, 28, 0.16);
}

.editor-canvas.is-drop-active {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(39, 103, 216, 0.2), 0 16px 36px rgba(24, 24, 28, 0.16);
}

.editor-drop-hint {
  position: absolute;
  z-index: 5000;
  inset: 10px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 18px;
  color: var(--accent);
  border: 2px dashed var(--focus);
  border-radius: 6px;
  background: rgba(242, 246, 253, 0.96);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.editor-drop-hint span {
  color: var(--muted);
  font-size: 11px;
}

.editor-canvas.is-drop-active .editor-drop-hint {
  opacity: 1;
}

.editor-blocks-layer {
  position: absolute;
  inset: 0;
}

.editor-block {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 8px;
  min-height: 8px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: move;
  user-select: none;
}

.editor-block.is-text,
.editor-block.is-service {
  padding: 2px;
}

.editor-block.is-service[data-shape="badge"] {
  padding: 0;
  border-radius: 50%;
}

.editor-block.is-service[data-shape="badge"] > span {
  display: grid;
  place-items: center;
}

.editor-title-preview {
  white-space: pre-line;
  line-height: 1.05 !important;
}

.editor-quantity-breakdown {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #fff;
}

.editor-block.is-selected {
  border-color: var(--focus);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 2px rgba(39, 103, 216, 0.22);
}

.editor-block.is-locked {
  cursor: default;
  opacity: 0.72;
}

.editor-block span,
.editor-block small {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  line-height: 1.12;
}

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

.editor-image-placeholder {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.editor-line-preview {
  width: 100%;
  height: 2px;
  background: var(--ink);
}

.editor-block[data-dashed="true"] .editor-line-preview {
  height: 0;
  border-top: 2px dashed var(--ink);
  background: transparent;
}

.editor-barcode-preview {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 2px;
  width: 92%;
  height: 86%;
  align-items: end;
}

.editor-barcode-preview span {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px);
}

.editor-barcode-preview small {
  color: #111;
  font-size: 8px;
  letter-spacing: 0;
}

.editor-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--focus);
  border-left: 1px solid var(--focus);
  background: rgba(39, 103, 216, 0.16);
  cursor: nwse-resize;
}

.editor-block:not(.is-selected) .editor-resize-handle {
  opacity: 0;
}

.editor-inline-text {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  resize: none;
  color: inherit;
  border: 1px solid var(--focus);
  border-radius: 2px;
  outline: none;
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  text-align: inherit;
}

.editor-context-menu {
  position: fixed;
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 16px));
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(24, 24, 28, 0.24);
}

.editor-context-menu[hidden] {
  display: none;
}

.editor-context-menu-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.editor-context-menu-heading small {
  color: var(--muted);
  font-size: 10px;
}

.editor-context-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.editor-context-field textarea,
.editor-context-field select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
}

.editor-context-field textarea {
  resize: vertical;
}

.editor-context-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-context-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-context-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
}

.editor-side {
  display: grid;
  gap: 14px;
}

.editor-lock-action,
.editor-linked-text {
  grid-column: 1 / -1;
}

.editor-lock-action {
  width: 100%;
}

.editor-linked-text {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.editor-linked-text > span {
  color: var(--muted);
  font-size: 11px;
}

.editor-linked-text > strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.editor-linked-text button {
  width: fit-content;
}

.editor-panel {
  min-width: 0;
  padding: 14px;
}

.editor-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

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

.editor-properties-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.editor-properties-grid input,
.editor-properties-grid select {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
}

.editor-properties-grid input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  justify-self: start;
  accent-color: var(--accent);
}

.editor-layer-list,
.editor-version-list {
  display: grid;
  gap: 8px;
}

.editor-layer-item,
.editor-version-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.editor-layer-item.is-active,
.editor-version-item.is-active {
  color: var(--accent-dark);
  border-color: #f0bbb7;
  background: var(--accent-soft);
  font-weight: 800;
}

.editor-version-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.editor-version-card.is-active {
  border-color: #f0bbb7;
  background: var(--accent-soft);
}

.editor-version-header,
.editor-version-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-version-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-version-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: var(--accent-dark);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
}

.editor-version-card small,
.editor-version-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.editor-version-actions button {
  flex: 1;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
}

.editor-layer-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.editor-layer-actions button {
  flex: 1;
}

@media (max-width: 1180px) {
  .source-workspace { grid-template-columns: 1fr 1fr; }
  .source-card:first-child { grid-column: 1 / -1; }
  .library-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reports-body { grid-template-columns: 1fr; }
  .users-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-context-panel,
  .editor-copy-panel,
  .editor-toolbar { grid-template-columns: 1fr; }
  .editor-ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-context-actions,
  .editor-tool-actions,
  .editor-copy-actions { justify-content: flex-start; }
  .editor-main { grid-template-columns: 1fr; }
  .editor-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .mobile-brand { display: inline-block; margin-bottom: 38px; padding: 7px 9px 6px; color: #fff; background: var(--accent); font-weight: 900; }
  .mobile-brand span { margin-left: 6px; font-family: Georgia, serif; font-weight: 500; }
  .app-layout { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding: 20px 12px; }
  .sidebar-brand div, .nav-item > span:last-child, .sidebar-footer div { display: none; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .main-nav { justify-items: center; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; width: 52px; }
  .nav-icon { font-size: 12px; }
  .sidebar-footer { justify-content: center; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creation-lead { align-items: flex-start; flex-direction: column; }
  .source-workspace { grid-template-columns: 1fr; }
  .source-card:first-child { grid-column: auto; }
  .library-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-presets-header { align-items: flex-start; flex-direction: column; }
  .report-preset-form { justify-content: flex-start; width: 100%; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-chart { grid-template-columns: 1fr; }
  .users-form-grid,
  .users-role-help { grid-template-columns: 1fr; }
  .editor-side { grid-template-columns: 1fr; }
  .editor-save-fields { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .auth-panel { align-items: start; padding: 28px 20px; }
  .app-layout { display: block; }
  .sidebar {
    position: fixed;
    z-index: 20;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 70px;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .main-nav { grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 0; }
  .nav-item { width: 100%; min-height: 52px; padding: 4px; }
  .workspace { padding-bottom: 70px; }
  .topbar { align-items: flex-start; min-height: auto; padding: 18px 18px; }
  .topbar h1 { font-size: 21px; }
  .breadcrumbs, .user-copy { display: none; }
  .topbar .secondary-button { min-height: 40px; padding-inline: 14px; }
  .workspace-content { padding: 20px 16px 34px; }
  .welcome { align-items: flex-start; flex-direction: column; }
  .metrics-grid, .module-grid { grid-template-columns: 1fr; }
  .metric-card { padding: 15px; }
  .module-card { grid-template-columns: 42px 1fr; }
  .module-arrow { display: none; }
  .creation-lead h2 { font-size: 26px; }
  .compact-stats { width: 100%; }
  .compact-stats div { flex: 1; min-width: 0; }
  .products-header { align-items: flex-start; flex-direction: column; }
  .products-toolbar { align-items: stretch; flex-direction: column; }
  .products-toolbar input { min-width: 0; width: 100%; }
  .generation-actions { align-items: stretch; flex-direction: column; }
  .generation-actions button { width: 100%; }
  .download-list li, .library-list li { align-items: flex-start; flex-direction: column; }
  .library-filters-header,
  .library-results-header { align-items: flex-start; flex-direction: column; }
  .library-filter-grid,
  .library-metrics { grid-template-columns: 1fr; }
  .library-filter-grid button,
  .library-header-actions,
  .library-header-actions button { width: 100%; }
  .library-table { min-width: 760px; }
  .report-filter-grid,
  .report-metrics { grid-template-columns: 1fr; }
  .report-presets-list { grid-template-columns: 1fr; }
  .report-preset-form,
  .report-preset-form input,
  .report-preset-form button { width: 100%; }
  .report-detail-item { grid-template-columns: 1fr; }
  .report-detail-item a,
  .report-export { width: 100%; }
  .report-table { min-width: 520px; }
  .report-comparison-panel { overflow: auto; }
  .users-panel-header { align-items: flex-start; flex-direction: column; }
  .users-form-grid { grid-template-columns: 1fr; }
  .users-actions { flex-direction: column; }
  .users-actions button { width: 100%; }
  .editor-context-actions,
  .editor-tool-actions,
  .editor-copy-actions { flex-direction: column; }
  .editor-picker-header,
  .editor-ready-heading,
  .editor-board-top,
  .editor-board-actions { align-items: stretch; flex-direction: column; }
  .editor-picker-status { width: fit-content; }
  .editor-ready-grid { grid-template-columns: 1fr; }
  .editor-search-option {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .editor-label-list { max-height: 360px; }
  .editor-label-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 3px 8px;
  }
  .editor-label-row small { grid-column: 2; }
  .editor-context-actions button,
  .editor-tool-actions button,
  .editor-copy-actions button,
  .editor-copy-actions select { width: 100%; }
  .editor-toolbar { align-items: stretch; flex-direction: column; }
  .editor-toolbar input,
  .editor-toolbar button { width: 100%; }
  .editor-board-top { align-items: stretch; flex-direction: column; }
  .editor-board-top select,
  .editor-board-top button,
  .editor-board-top a { width: 100%; }
  .editor-canvas { min-width: 0; width: min(100%, 330px); }
  .editor-properties-grid { grid-template-columns: 1fr; }
  .editor-context-selects { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 900px) {
  .storage-lead { grid-template-columns: minmax(0, 1fr); }
  .storage-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .storage-columns { grid-template-columns: minmax(0, 1fr); }
  .storage-columns > *, .storage-panel { min-width: 0; }
  .storage-lead { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .storage-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .storage-summary-item { min-width: 0; padding-inline: 8px; }
  .storage-summary-item span { overflow: hidden; text-overflow: ellipsis; }
  .storage-uploader { grid-template-columns: minmax(0, 1fr); }
  .storage-uploader input, .storage-uploader button { width: 100%; min-width: 0; }
  .storage-asset-row { grid-template-columns: 48px minmax(0, 1fr); }
  .storage-asset-row .storage-actions { grid-column: 2; }
  .storage-file-grid { grid-template-columns: minmax(0, 1fr); }
  .storage-file-card { grid-template-columns: 64px minmax(0, 1fr); }
  .storage-file-card .storage-actions { grid-column: 2; justify-content: flex-start; }
  .template-preview-tile { width: 64px; height: 90px; }
  .template-upload-fields { grid-template-columns: minmax(0, 1fr); }
  .compact-file-row { align-items: flex-start; flex-direction: column; }
}
