/* Dark until data-theme; avoid bare :root palette so html[data-theme=light] wins */
html:not([data-theme]),
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #6eb5ff;
  --accent-dim: #4a8fd4;
  --border: #2d3a4d;
}

html {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5c6b80;
  --accent: #1565c0;
  --accent-dim: #0d47a1;
  --border: #dce3ed;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* В тёмной теме — иконка солнца (переключить на светлую); в светлой — луна (на тёмную) */
html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.with-sidebar .site-main {
  max-width: min(96rem, calc(100vw - 17rem));
  margin-left: 16rem;
}

html[data-sidebar="collapsed"] .with-sidebar .site-main {
  margin-left: 4.25rem;
  max-width: min(96rem, calc(100vw - 5.5rem));
}

.sidebar {
  position: fixed;
  top: 4.25rem;
  left: 0;
  bottom: 0;
  width: 16rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-action {
  margin: 0;
}

.side-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.side-btn:hover {
  border-color: var(--border);
}

.side-icon-arrow {
  color: var(--muted);
}

html[data-sidebar="collapsed"] .with-sidebar .sidebar {
  width: 4.25rem;
  padding: 0.75rem;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.side-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: 0 0 auto;
}

.side-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.side-label {
  white-space: nowrap;
}

.side-item:hover {
  border-color: var(--border);
}

.side-item.is-active {
  border-color: var(--accent-dim);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

html[data-sidebar="collapsed"] .with-sidebar .side-item {
  justify-content: center;
  padding: 0.6rem 0.25rem;
}

html[data-sidebar="collapsed"] .with-sidebar .side-btn {
  justify-content: center;
  padding: 0.6rem 0.25rem;
}

html[data-sidebar="collapsed"] .with-sidebar .side-label {
  display: none;
}

html[data-sidebar="collapsed"] .with-sidebar .side-icon-arrow {
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .with-sidebar .site-main {
    margin-left: 0;
  }
  .sidebar {
    transform: translateX(0);
    width: 16rem;
    z-index: 10;
  }
  html[data-sidebar="collapsed"] .with-sidebar .sidebar {
    transform: translateX(-105%);
  }
}

.site-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.site-header-start {
  justify-self: start;
  min-width: 0;
}

.site-header-center {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.site-header-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.shop-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.shop-nav__link {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.shop-nav__link:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}

.shop-nav__link.is-active {
  background: var(--accent);
  color: #fff;
}

.shop-nav__link.is-active:hover {
  filter: brightness(1.05);
  color: #fff;
}

.site-header-end a {
  color: var(--accent);
  text-decoration: none;
}

.site-header-end a:hover {
  text-decoration: underline;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

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

.brand-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--accent);
}

.site-main {
  max-width: 82rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.page-center {
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.page-center--products {
  max-width: none;
  width: 100%;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0.25rem 0.15rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.list-pagination-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

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

.list-pagination-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}

.list-pagination-size:hover {
  border-color: var(--accent);
}

.list-pagination-size.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-weight: 600;
}

.list-pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.list-pagination-summary {
  font-size: 0.85rem;
}

.list-pagination-btn {
  text-decoration: none;
}

.users-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.users-toolbar .hero {
  flex: 1 1 14rem;
  min-width: 0;
  margin: 0;
}

.users-toolbar .hero h1 {
  margin-bottom: 0.35rem;
}

.users-toolbar .lead {
  margin: 0;
}

.users-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
}

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

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: center;
}

.users-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.users-search-input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.users-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.products-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.35rem;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--border) 40%, transparent);
}

.products-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.products-filter-field--search {
  flex: 1 1 20rem;
  min-width: min(100%, 16rem);
}

.products-filter-field:not(.products-filter-field--search) {
  flex: 1 1 10.5rem;
  max-width: 16rem;
}

.products-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.products-filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.products-filter-input,
.products-filter-select,
.products-list-filters .users-search-input {
  font-size: 1rem;
  line-height: 1.35;
  min-height: 2.75rem;
}

.products-filter-select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.products-list-filters .users-search-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.products-filter-select:focus,
.products-list-filters .users-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.products-filter-reset {
  font-size: 0.95rem;
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .products-filter-actions {
    margin-left: 0;
    width: 100%;
  }
}

.category-panel {
  padding: 0.25rem 0;
}

.category-branch {
  border-bottom: 1px solid var(--border);
}

.category-branch:last-child {
  border-bottom: none;
}

.category-parent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
}

.category-parent-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.category-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

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

.category-delete-btn,
.users-delete-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #b00020;
  cursor: pointer;
}

.category-delete-btn:hover,
.users-delete-open:hover {
  background: color-mix(in srgb, #b00020 15%, transparent);
}

.category-delete-icon {
  display: block;
}

.category-delete-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  color: var(--muted);
  opacity: 0.45;
  cursor: not-allowed;
}

dialog.confirm-dialog:not([open]) {
  display: none !important;
}

.confirm-dialog {
  box-sizing: border-box;
  margin: auto;
  width: min(92vw, 40rem);
  max-width: min(92vw, 40rem);
  min-width: min(16rem, 92vw);
  max-height: min(88vh, 36rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(0.9rem, 2.8vw, 1.35rem) clamp(1rem, 3vw, 1.5rem);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1rem 2.5rem color-mix(in srgb, #000 35%, transparent);
  overflow: hidden;
}

.confirm-dialog::backdrop {
  background: color-mix(in srgb, #000 50%, transparent);
}

.confirm-dialog-form {
  margin: 0;
}

.confirm-dialog-form.confirm-dialog-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 2vw, 1rem);
  min-height: 0;
  max-height: min(calc(88vh - 2.75rem), 33rem);
}

.confirm-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 22rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

.confirm-dialog-message {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.confirm-dialog-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.category-expand-btn {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 6px;
}

.category-expand-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.category-expand-placeholder {
  flex: 0 0 2rem;
  width: 2rem;
  display: inline-block;
}

.category-name-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.category-name-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.category-children {
  margin: 0 0 0 0.5rem;
  padding: 0 0 0.75rem 2.25rem;
  list-style: none;
  border-left: 2px solid var(--border);
}

.category-children li {
  padding: 0;
}

.category-child-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.category-child-link {
  color: var(--accent);
  text-decoration: none;
}

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

.category-child-text {
  color: var(--text);
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.sort-link:hover {
  color: var(--accent);
}

.sort-arrow {
  font-size: 0.8em;
  opacity: 0.9;
}

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

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}

/* Login: compact card — stack-form fields are width:100% of a narrow column */
.panel-login {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.panel-login h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

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

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

/* Products list: fit panel width, no horizontal scrollbar */
.products-table-wrap {
  overflow-x: visible;
}

.data-table--products {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 0.95rem;
}

.data-table--products th,
.data-table--products td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.55rem 0.55rem;
}

.data-table--products th:nth-child(1),
.data-table--products td:nth-child(1) {
  width: 7%;
}

.data-table--products th:nth-child(2),
.data-table--products td:nth-child(2) {
  width: 14%;
}

.data-table--products th:nth-child(3),
.data-table--products td:nth-child(3) {
  width: 14%;
}

.data-table--products th:nth-child(4),
.data-table--products td:nth-child(4) {
  width: 25%;
}

.data-table--products th:nth-child(5),
.data-table--products td:nth-child(5) {
  width: 9%;
}

.data-table--products th:nth-child(6),
.data-table--products td:nth-child(6) {
  width: 6%;
}

.data-table--products th:nth-child(7),
.data-table--products td:nth-child(7) {
  width: 13%;
}

.data-table--products th:nth-child(8),
.data-table--products td:nth-child(8) {
  width: 12%;
  min-width: 2.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  overflow: visible;
  text-overflow: clip;
}

.data-table--products .sort-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  background: var(--bg);
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.data-table tbody tr.user-row,
.data-table tbody tr.product-row,
.data-table tbody tr.tag-row {
  cursor: pointer;
}

/* Product tags combobox */
.product-tags-picker {
  min-width: 0;
}

.product-tags-picker .product-tags-control {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-tags-picker .product-tags-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.product-tags-picker .product-tags-selected {
  display: contents;
}

.product-tags-picker .product-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.15rem 0.35rem 0.15rem 0.55rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 0.875rem;
  line-height: 1.3;
}

.product-tags-picker .product-tag-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tags-picker .product-tag-chip__remove {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.product-tags-picker .product-tag-chip__remove:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.product-tags-picker .product-tags-search {
  flex: 1 1 8rem;
  min-width: 6rem;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.2rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
}

.product-tags-picker .product-tags-search:focus {
  border: none;
  box-shadow: none;
}

.product-tags-picker .product-tags-search::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.product-tags-picker .product-tags-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.product-tags-picker .product-tags-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 22%, transparent);
}

.product-tags-picker .product-tags-suggestion {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
}

.product-tags-picker .product-tags-suggestion:hover,
.product-tags-picker .product-tags-suggestion.is-active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.product-tags-picker .product-tags-suggestion--create {
  color: var(--accent);
  font-weight: 500;
}

.product-tags-picker .product-tags-suggestion-empty {
  margin: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.product-tags-picker > .field-hint {
  margin-top: 0.35rem;
}

.product-tag-create-title {
  margin-bottom: 0.75rem;
}

.product-tag-create-error {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.htmx-slot {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
  margin-bottom: 0.75rem;
}

.htmx-mt {
  margin-top: 0.75rem;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
}

.greeting {
  margin: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0;
}

.inline-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.inline-form input[type="text"] {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  min-width: 12rem;
}

.tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.task form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.task-done span {
  text-decoration: line-through;
  color: var(--muted);
}

.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

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

.stack-form {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.stack-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stack-form .field-hint {
  margin: -0.25rem 0 0.25rem;
  font-size: 0.8rem;
}

.stack-form input[type="text"],
.stack-form input[type="password"],
.stack-form input[type="email"],
.stack-form input[type="tel"],
.stack-form select,
.stack-form textarea {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: min(28rem, 100%);
  min-width: 0;
  box-sizing: border-box;
  outline: none;
}

.stack-form textarea {
  min-height: 6rem;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.stack-form input[type="text"]:focus,
.stack-form input[type="password"]:focus,
.stack-form input[type="email"]:focus,
.stack-form input[type="tel"]:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Product & user forms: full-width fields + paired rows */
.product-form.stack-form {
  padding: 0.35rem 0.5rem 0.15rem;
  gap: 0.65rem;
}

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

.product-form .product-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.product-form .product-form-field > .field-hint {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.product-form.stack-form input[type="text"],
.product-form.stack-form input[type="password"],
.product-form.stack-form input[type="email"],
.product-form.stack-form input[type="tel"],
.product-form.stack-form select,
.product-form.stack-form textarea {
  max-width: none;
  width: 100%;
}

.product-form-row {
  display: grid;
  gap: 0.75rem 1rem;
  align-items: start;
  min-width: 0;
}

.product-form-row--price {
  grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 9rem);
}

.product-form-row--meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .product-form-row--price,
  .product-form-row--meta {
    grid-template-columns: 1fr;
  }
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.alert-error {
  border-color: #b00020;
  background: color-mix(in srgb, #b00020 10%, var(--surface));
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}

a.btn:hover,
a.btn:focus-visible {
  text-decoration: none;
  color: inherit;
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus-visible {
  color: #fff;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-save-and-new {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}

.btn-save-and-new:hover {
  border-color: var(--accent-dim);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}

.btn-danger {
  border-color: #b00020;
  background: color-mix(in srgb, #b00020 88%, transparent);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.06);
}

.deactivate-form {
  margin: 0;
}

.td-actions,
.th-actions {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

code {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--bg);
}

.htmx-request .btn {
  opacity: 0.6;
  pointer-events: none;
}

/* Product photos gallery */
.product-photos-field {
  gap: 0.5rem;
}

.product-photos-add-btn {
  align-self: flex-start;
}

.product-photos-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.product-photos-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--border) 25%, var(--surface));
}

.product-photos-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-photos-item .product-photos-thumb {
  cursor: zoom-in;
}

.product-photos-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #000 55%, transparent);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-photos-remove:hover {
  background: color-mix(in srgb, #b00020 85%, #000);
}

.product-photos-error {
  margin: 0.25rem 0 0;
}

.product-photos-viewer {
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  border: none;
  max-width: min(96vw, 56rem);
  max-height: min(92vh, 48rem);
  width: max-content;
  background: transparent;
  overflow: visible;
}

.product-photos-viewer::backdrop {
  background: color-mix(in srgb, #000 72%, transparent);
}

.product-photos-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  touch-action: pan-y pinch-zoom;
}

.product-photos-viewer-img {
  display: block;
  max-width: min(calc(96vw - 7rem), 52rem);
  max-height: min(88vh, 44rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 1rem 2.5rem color-mix(in srgb, #000 45%, transparent);
  user-select: none;
  -webkit-user-drag: none;
}

.product-photos-viewer-nav {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #000 55%, transparent);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-photos-viewer-nav:hover:not(:disabled) {
  background: color-mix(in srgb, #000 75%, transparent);
}

.product-photos-viewer-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.product-photos-viewer-counter {
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 1px 4px color-mix(in srgb, #000 80%, transparent);
}

.product-photos-viewer-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #000 55%, transparent);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-photos-viewer-close:hover {
  background: color-mix(in srgb, #000 75%, transparent);
}

.page-center--with-comments {
  max-width: min(96rem, 100%);
}

.entity-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  gap: 1.25rem;
  align-items: start;
}

.entity-edit-layout--panel-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.entity-edit-main {
  min-width: 0;
}

.entity-comments-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
  overflow: hidden;
}

.entity-comments-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.entity-comments-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.entity-edit-toolbar {
  margin-bottom: 1.5rem;
}

.entity-comments-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.entity-comments-icon-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.entity-comments-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.entity-comments-show-btn[hidden] {
  display: none;
}

.entity-comments-toggle {
  flex-shrink: 0;
}

.comments-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.comments-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.comments-tab.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.comments-tab-panel {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.comments-tab-panel.is-active {
  display: flex;
}

.comments-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.15rem;
}

.comments-list--system {
  max-height: none;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-item {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.comment-item--system {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}

.comment-reply {
  margin-left: 1rem;
  border-style: dashed;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  color: var(--muted);
}

.comment-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-body--pre {
  white-space: pre-wrap;
}

.comment-reply-btn {
  margin-top: 0.4rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.comment-reply-btn:hover {
  text-decoration: underline;
}

.comments-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}

.comments-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.comments-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.comments-compose-error {
  margin: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.comments-empty {
  margin: 0;
  font-size: 0.88rem;
}

.comments-reply-hint {
  margin: 0;
  font-size: 0.82rem;
}

.page-center--requests {
  max-width: min(96rem, 100%);
}

.request-contact-picker {
  position: relative;
  flex: 1 1 14rem;
  min-width: 0;
}

.request-contact-selected {
  margin-bottom: 0.35rem;
}

.request-contact-open-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  max-width: none;
  min-height: 5.5rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  color: var(--accent);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.request-contact-open-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  box-shadow: 0 0.15rem 0.5rem color-mix(in srgb, var(--accent) 12%, transparent);
}

.request-contact-open-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.request-contact-open-btn[hidden] {
  display: none;
}

.request-contact-open-btn__icon {
  width: 1.65rem;
  height: 1.65rem;
  opacity: 0.9;
}

.request-contact-open-btn__text {
  font-size: 0.95rem;
  font-weight: 600;
}

.request-contact-open-btn__hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

.request-contact-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%,
    var(--surface) 55%
  );
  box-shadow: 0 0.15rem 0.55rem color-mix(in srgb, #000 8%, transparent);
}

.request-contact-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem 0.75rem;
}

.request-contact-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 85%, #fff) 0%,
    var(--accent-dim) 100%
  );
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 0.15rem 0.45rem color-mix(in srgb, var(--accent) 35%, transparent);
}

.request-contact-card__heading {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.1rem;
}

.request-contact-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.request-contact-card__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
}

.request-contact-card__phone[hidden] {
  display: none;
}

.request-contact-card__meta-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.request-contact-card__edit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.request-contact-card__edit svg {
  width: 0.9rem;
  height: 0.9rem;
}

.request-contact-card__edit:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.request-contact-card__edit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.request-contact-card__edit[hidden] {
  display: none;
}

.request-contact-card__socials {
  margin: 0;
  padding: 0.55rem 0.65rem 0.7rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.request-contact-card__socials[hidden] {
  display: none;
}

.request-contact-card__social-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.45rem 0.3rem 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.request-contact-card__social-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.85rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--muted);
}

.request-contact-card__social-row--telegram .request-contact-card__social-badge {
  background: #229ed9;
}

.request-contact-card__social-row--whatsapp .request-contact-card__social-badge {
  background: #25d366;
}

.request-contact-card__social-row--instagram .request-contact-card__social-badge {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
}

.request-contact-card__social-row--vk .request-contact-card__social-badge {
  background: #0077ff;
}

.request-contact-card__social-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-contact-card__social-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  text-decoration: none;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.request-contact-card__social-write:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  transform: translateY(-1px);
}

.request-contact-card__social-write:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.request-contact-picker-dialog {
  width: min(92vw, 52rem);
  max-width: min(92vw, 52rem);
  max-height: min(90vh, 40rem);
}

.request-contact-picker-dialog__stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  max-height: min(calc(90vh - 2.5rem), 37rem);
}

.request-contact-picker-dialog__title {
  margin: 0;
}

.request-contact-picker-search {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

.request-contact-picker-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.request-contact-picker-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(50vh, 22rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.request-contact-picker-table {
  margin: 0;
}

.request-contact-picker-row {
  cursor: pointer;
}

.request-contact-picker-row:hover,
.request-contact-picker-row:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  outline: none;
}

.request-contact-picker-empty {
  margin: 0;
  text-align: center;
}

.request-contact-picker-dialog__actions {
  padding-top: 0.25rem;
}

.request-contact-picker-dialog__actions .btn {
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
}

.store-token-form-panel .stack-form.product-form.store-token-form {
  padding: 0.35rem 0.5rem 0.15rem;
  gap: 0.65rem;
  max-width: 28rem;
}

.store-token-form-panel .store-token-form input[type="text"],
.store-token-form-panel .store-token-form input[type="number"] {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

.store-token-form-panel .store-token-form input[type="number"] {
  max-width: 10rem;
}

.store-token-form-panel .store-token-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.store-token-form-panel .store-token-form input[type="text"]:focus,
.store-token-form-panel .store-token-form input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.store-token-form-panel .store-token-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.store-token-created-panel {
  max-width: 40rem;
}

.store-token-created-lead {
  margin: 0 0 1rem;
  line-height: 1.5;
}

.store-token-reveal {
  margin-bottom: 1rem;
}

.store-token-reveal__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.store-token-copy-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.store-token-plaintext {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, var(--surface));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.4;
}

.store-token-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  white-space: nowrap;
}

.store-token-copy-btn--inline {
  padding: 0.35rem 0.55rem;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.store-token-copy-btn__text {
  font-size: 0.9rem;
}

.store-token-copy-feedback {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.store-token-auth-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, var(--surface));
  font-size: 0.88rem;
}

.store-token-auth-code {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
  font-size: 0.82rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.request-contact-create-dialog {
  width: min(92vw, 36rem);
  max-width: min(92vw, 36rem);
}

.request-contact-create-dialog .confirm-dialog-form.stack-form {
  gap: 0;
}

.request-contact-create-dialog .confirm-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(62vh, 30rem);
  padding-right: 0.35rem;
}

.request-contact-create-dialog .product-form-row {
  width: 100%;
}

.request-contact-create-dialog .product-form-field {
  width: 100%;
}

.request-contact-create-dialog .product-form-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.request-contact-create-dialog input[type="text"],
.request-contact-create-dialog input[type="email"],
.request-contact-create-dialog input[type="tel"],
.request-contact-create-dialog textarea {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

.request-contact-create-dialog textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.45;
}

.request-contact-create-dialog input[type="text"]:focus,
.request-contact-create-dialog input[type="email"]:focus,
.request-contact-create-dialog input[type="tel"]:focus,
.request-contact-create-dialog textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.request-contact-create-dialog .confirm-dialog-actions .btn {
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
}

.request-contact-create-dialog .alert-error {
  margin: 0;
}

.request-contact-create-title {
  margin-bottom: 0.25rem;
}

.request-products-picker {
  width: 100%;
}

.request-products-search-row {
  position: relative;
}

.request-products-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 22%, transparent);
}

.request-products-search {
  width: 100%;
  max-width: none;
}

.request-products-table-wrap {
  margin-bottom: 0.75rem;
  overflow-x: auto;
}

.request-products-table {
  margin: 0;
}

.request-products-table__photo {
  width: 3.25rem;
}

.request-product-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: var(--bg);
}

.request-product-thumb--empty {
  display: inline-block;
  background-color: color-mix(in srgb, var(--muted) 18%, var(--surface));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9bb4' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5a2 2 0 0 0-2.8 0L5 18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.35rem;
}

.request-products-table .request-product-row td {
  vertical-align: middle;
}

.requests-view-actions {
  flex-wrap: wrap;
}

.requests-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.55rem;
  min-width: 2.5rem;
  margin-right: 0.25rem;
}

.requests-view-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.requests-view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.requests-view-icon[hidden] {
  display: none;
}

.requests-view-icon-svg {
  display: block;
}

.requests-list-filters {
  margin-bottom: 1.25rem;
}

.requests-kanban-notice {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.requests-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(14rem, 1fr));
  gap: 0.75rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 14rem;
  max-height: calc(100vh - 14rem);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.kanban-column--drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.kanban-column-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.kanban-column-count {
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 1.25rem;
  text-align: right;
}

.kanban-column-body {
  flex: 1;
  min-height: 4rem;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: grab;
  transition: box-shadow 0.15s ease;
}

.kanban-card:hover {
  box-shadow: 0 0.2rem 0.65rem color-mix(in srgb, #000 12%, transparent);
}

.kanban-card--dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.kanban-card-link {
  display: block;
  padding: 0.55rem 0.65rem;
  color: inherit;
  text-decoration: none;
}

.kanban-card-id {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.kanban-card-contact {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}

.kanban-card-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.data-table--requests tbody tr {
  cursor: pointer;
}

@media (max-width: 1200px) {
  .requests-kanban {
    grid-template-columns: repeat(3, minmax(14rem, 1fr));
  }
}

@media (max-width: 960px) {
  .requests-kanban {
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
  }

  .entity-edit-layout {
    grid-template-columns: 1fr;
  }

  .entity-comments-panel {
    position: static;
    max-height: none;
  }

  .comments-list,
  .comments-list--system {
    max-height: 16rem;
  }
}

.request-exchange-panel {
  margin-bottom: 1.25rem;
}

.request-order-panel {
  margin-bottom: 1.25rem;
}

.request-order-panel .panel-subtitle {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.request-delivery-compact {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.request-exchange-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.request-exchange-panel .panel-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.request-exchange-message {
  white-space: pre-wrap;
  margin: 0.25rem 0 0;
}

.request-exchange-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.request-exchange-photo {
  display: block;
  width: 6rem;
  height: 6rem;
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

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

.related-requests-panel {
  margin-top: 1.25rem;
}

.related-requests-panel__title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.related-requests-panel__empty {
  margin: 0;
}

.data-table--related-requests tbody tr.related-request-row {
  cursor: pointer;
}

.data-table--related-requests tbody tr.related-request-row:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.related-request-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

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

.request-product-create-dialog {
  width: min(92vw, 42rem);
  max-width: min(92vw, 42rem);
  max-height: min(92vh, 48rem);
  overflow: hidden;
}

.request-product-create-dialog[open] {
  display: flex;
  flex-direction: column;
}

.request-product-create-title {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.request-product-create-dialog .confirm-dialog-form.confirm-dialog-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  gap: 0;
}

.request-product-create-dialog .confirm-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.request-product-create-actions {
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.request-product-create-dialog .product-form-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.request-product-create-dialog input[type="text"],
.request-product-create-dialog input[type="file"],
.request-product-create-dialog textarea,
.request-product-create-dialog select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.request-product-create-dialog .product-form-row--price,
.request-product-create-dialog .product-form-row--meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

@media (max-width: 520px) {
  .request-product-create-dialog .product-form-row--price,
  .request-product-create-dialog .product-form-row--meta {
    grid-template-columns: 1fr;
  }
}

.request-product-create-dialog input[type="text"],
.request-product-create-dialog textarea,
.request-product-create-dialog select {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

.request-product-create-dialog textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.request-product-create-dialog input[type="text"]:focus,
.request-product-create-dialog textarea:focus,
.request-product-create-dialog select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.request-product-create-dialog .confirm-dialog-actions .btn {
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
}

.request-product-photos-field {
  gap: 0.35rem;
}

.request-product-photos-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.request-product-photos-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  padding: 1.1rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.request-product-photos-upload:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

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

.request-product-photos-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.request-product-photos-upload-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.request-product-photos-count {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}

.request-exchange-header .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.request-product-import-photos {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}

.request-product-import-photos input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.request-product-create-dialog .alert-error {
  margin: 0;
}
