:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --accent: #000000;
  --accent-soft: rgba(191, 255, 0, 0.18);
  --t2-black: #000000;
  --t2-pink: #ff1b8d;
  --t2-lime: #bfff00;
  --t2-turquoise: #20cdff;
  --btn-primary: var(--t2-lime);
  --btn-secondary: var(--t2-turquoise);
  --btn-danger: var(--t2-pink);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --sheet-radius: clamp(20px, 4vw, 36px);
  --sheet-tail: var(--sheet-radius);
  --crm-sticky-offset: 72px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.price-page { min-height: 100vh; }

/* --- CRM shell (T2-style) --- */
.crm-site-head {
  position: sticky;
  top: 0;
  z-index: 32;
  background: var(--t2-black);
}

.crm-topbar {
  background: var(--t2-black);
  padding: 10px 0 0;
}

.crm-topbar-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.crm-brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.crm-brand-logo-video {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(100%, 280px);
  object-fit: contain;
}

.crm-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.crm-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.crm-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.crm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--t2-lime);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

.crm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crm-avatar-initials {
  letter-spacing: 0.02em;
}

.crm-profile-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-logout-form {
  margin: 0;
}

.crm-logout-btn {
  border: 0;
  background: none;
  color: var(--t2-lime);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.crm-promo-bar {
  background: var(--t2-pink);
  color: #fff;
  width: 100%;
  padding: 12px 24px 16px;
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
}

.crm-intro-stack {
  position: relative;
  background: var(--t2-black);
}

.crm-intro-stack--with-hero .crm-promo-bar::after {
  content: "";
  display: block;
  height: var(--sheet-tail);
  background: var(--t2-pink);
}

.crm-promo-bar-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.crm-promo-bar-inner {
  text-align: center;
}

.crm-promo-text {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.crm-page-hero {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--sheet-tail));
  padding: 0 24px;
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  background: var(--t2-black);
  overflow: visible;
}

.crm-page-hero .crm-sidebar-rail-btn {
  position: absolute;
  left: calc(var(--crm-sidebar-width, 240px) - 18px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.crm-shell.is-sidebar-collapsed .crm-page-hero .crm-sidebar-rail-btn {
  left: 16px;
}

.crm-page-hero-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  min-height: calc(76px + var(--sheet-tail));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(6px + var(--sheet-tail)) 0 calc(8px + var(--sheet-tail));
  padding-left: calc(var(--crm-sidebar-width, 240px) + 28px);
  transition: padding-left 0.22s ease;
}

.crm-shell.is-sidebar-collapsed .crm-page-hero-inner {
  padding-left: 56px;
}

.crm-page-title {
  margin: 0;
  font-size: clamp(26px, 4.5vw, 40px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.crm-page-subtitle {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  max-width: 720px;
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.45;
}

.crm-page-hero-inner--with-meta {
  gap: 8px;
}

.crm-page-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.crm-page-hero-inner--with-meta .crm-page-subtitle {
  margin-top: 0;
}

.crm-page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 22px;
  flex: 1 1 auto;
  min-width: 0;
}

.crm-page-hero-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.crm-page-hero-meta-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.crm-page-hero-meta-value {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.crm-page-hero-actions {
  margin-top: 10px;
}

.crm-page-hero-back-link {
  display: inline-flex;
  align-items: center;
  color: var(--t2-lime, #c8ff00);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

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

@media (max-width: 980px) {
  .crm-page-hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .crm-page-hero-meta {
    justify-content: flex-start;
    width: 100%;
  }
}

.crm-page-hero::after {
  content: "";
  display: block;
  height: var(--sheet-tail);
  background: var(--t2-black);
  margin-bottom: calc(-1 * var(--sheet-tail));
}

.price-main {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--sheet-tail));
  padding-top: calc(16px + var(--sheet-tail));
  background: var(--bg);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  min-height: 40vh;
}

.price-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.price-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.price-sidebar {
  position: sticky;
  top: var(--crm-sticky-offset);
  align-self: start;
  max-height: calc(100vh - var(--crm-sticky-offset) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

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

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

.price-nav-block {
  display: grid;
  gap: 0;
}

.price-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}

.price-nav-item.has-subnav.is-active {
  cursor: pointer;
}

.price-nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.price-nav-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s ease;
  margin-top: -3px;
}

.price-nav-block.is-active:has(.price-nav-sub.is-open:not([hidden])) .price-nav-chevron {
  transform: rotate(225deg);
  margin-top: 3px;
}

.price-nav-item:hover {
  background: #f9fafb;
  border-color: var(--line);
}

.price-nav-item.is-active {
  background: var(--accent-soft);
  border-color: var(--t2-lime);
}

.price-nav-title {
  font-weight: 600;
}

.price-nav-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.price-sidebar-label--sub {
  margin-top: 20px;
}

.price-nav-sub {
  margin: 0 0 4px;
  padding: 0 0 4px 10px;
  border-left: 2px solid var(--line);
}

.price-nav-sub-label {
  margin: 4px 0 8px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.price-subnav {
  display: grid;
  gap: 2px;
}

.price-subnav-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-subnav-item:hover {
  background: #f9fafb;
  color: var(--text);
}

.price-section + .price-section {
  border-top: 8px solid var(--bg);
}

.price-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.price-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.price-section-count {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.price-table--compact th,
.price-table--compact td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.is-image {
  width: 72px;
}

.price-product-img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid var(--line);
}

.price-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.price-group-head {
  padding: 24px 24px 0;
}

.price-group-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
}

.price-group-desc {
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.price-table-wrap {
  overflow: auto;
  padding: 16px 24px 24px;
}

.price-products-grid-wrap {
  overflow-x: auto;
  padding: 0;
}

.price-products-grid {
  --products-grid-columns: minmax(240px, 1.4fr) 120px 110px 130px minmax(320px, 1fr);
  min-width: 1100px;
}

.price-products-grid--selectable {
  --products-grid-columns: 32px 90px minmax(240px, 1.4fr) 120px 110px 130px minmax(320px, 1fr);
}

.price-products-header,
.price-product-row {
  display: grid;
  grid-template-columns: var(--products-grid-columns);
  align-items: center;
  column-gap: 16px;
  padding: 0 18px;
}

.price-products-header {
  min-height: 46px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.price-product-row {
  min-height: 52px;
  border-bottom: 1px solid #edf0f4;
}

.price-product-row:hover {
  background: #fbfdff;
}

.price-products-cell {
  min-width: 0;
  display: flex;
  align-items: center;
}

.cell-center,
.price-products-cell.cell-center {
  justify-content: center;
  text-align: center;
}

.cell-left,
.price-products-cell.cell-left {
  justify-content: flex-start;
  text-align: left;
}

.cell-checkbox {
  justify-content: center;
}

.cell-action {
  justify-content: center;
}

.cell-price {
  font-weight: 700;
  white-space: nowrap;
}

.cell-width {
  white-space: nowrap;
}

.cell-mount {
  color: #374151;
  line-height: 1.35;
  white-space: normal;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: 6px;
}

.price-products-cell.cell-left:not(.cell-mount) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-products-grid .price-edit-item-btn {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 10px;
  white-space: nowrap;
}

.price-products-grid--selectable .price-product-row:has(.price-row-select:checked) {
  background: #fef2f2;
}

.price-mount-subsection .price-products-grid-wrap {
  padding: 0;
}

.price-mount-subsection .price-products-grid {
  border-top: 1px solid var(--line);
}

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

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

.price-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.price-table tbody tr:hover {
  background: #fafafa;
}

.price-table tbody tr:last-child td {
  border-bottom: 0;
}

.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

.is-money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.price-currency {
  margin-left: 4px;
  font-weight: 600;
  color: var(--muted);
}

.price-subnav-item--nested {
  padding-left: 18px;
  font-size: 13px;
}

.price-mount-subsection {
  border-top: 1px solid var(--line);
}

.price-mount-subsection-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  background: #fafafa;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  transition:
    transform 200ms cubic-bezier(0.2, 0, 0, 1),
    background 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.price-mount-subsection-summary::-webkit-details-marker {
  display: none;
}

.price-group-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.group-row__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  justify-content: flex-start;
}

.group-row__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.price-group-chevron {
  flex-shrink: 0;
  width: 12px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.price-mount-subsection[open] > .price-mount-subsection-summary .price-group-chevron {
  display: inline-block;
  transform: rotate(90deg);
}

.price-mount-subsection-title,
.group-title {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.price-group-title-block {
  min-width: 0;
  flex: 0 1 auto;
}

.price-group-title-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.price-group-title-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(720px, 100%);
}

.price-group-rename-products {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #6b7280);
  flex: 1 1 100%;
}

.price-group-rename-products input {
  margin-top: 2px;
}

.price-group-rename-hint {
  margin: 0;
  flex: 1 1 100%;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted, #6b7280);
}

.price-group-title-edit[hidden] {
  display: none !important;
}

.price-group-title-input,
.group-title-input {
  width: 320px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  flex-shrink: 1;
}

.price-group-rename-btn,
.price-group-title-save,
.price-group-title-cancel {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.price-group-rename-btn {
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.price-group-title-save,
.price-group-title-cancel {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
}

.price-group-title-save:hover,
.price-group-title-cancel:hover,
.price-group-rename-btn:hover {
  filter: brightness(0.95);
}

.price-group-sortable,
.price-groups-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 180ms ease;
}

.price-groups-list.is-sorting {
  background: rgba(124, 92, 255, 0.03);
  border-radius: 18px;
  padding: 6px;
  margin: -6px;
}

.price-sortable-item {
  position: relative;
  transition:
    transform 200ms cubic-bezier(0.2, 0, 0, 1),
    background 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.price-groups-list.is-sorting .price-sortable-item:not(.price-group-row--ghost):not(.price-group-row--drag):not(.price-group-row--chosen) {
  background: rgba(255, 255, 255, 0.6);
}

.price-group-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.price-group-drag-handle:hover {
  background: #eef2ff;
  color: #7c5cff;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.price-group-drag-handle:active,
.price-is-group-sorting .price-group-drag-handle {
  cursor: grabbing;
}

/* Выбранная строка перед перетаскиванием */
.price-sortable-item.price-group-row--chosen > .price-mount-subsection-summary {
  background: #f4f0ff;
  border: 1px solid #7c5cff;
  border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

/* Перетаскиваемый элемент */
.price-sortable-item.price-group-row--drag {
  opacity: 0.95;
  z-index: 50;
}

.price-sortable-item.price-group-row--drag > .price-mount-subsection-summary,
.price-group-row.is-dragging {
  opacity: 0.95;
  transform: scale(1.015) rotate(-1deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  border: 2px solid #7c5cff;
  border-radius: 14px;
  cursor: grabbing;
}

/* Placeholder — место вставки */
.price-sortable-item.price-group-row--ghost {
  height: 52px !important;
  min-height: 52px;
  margin: 6px 0;
  border: 2px dashed #7c5cff;
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.08);
  opacity: 1 !important;
  overflow: hidden;
  box-sizing: border-box;
}

.price-sortable-item.price-group-row--ghost > * {
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}

.price-sortable-item.price-group-row--ghost::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #7c5cff;
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.price-sortable-item.price-group-row--ghost::after {
  content: "Вставить сюда";
  visibility: visible;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c5cff;
  font-weight: 700;
  font-size: 14px;
  z-index: 1;
}

.price-group-placeholder {
  height: 52px;
  border: 2px dashed #7c5cff;
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.08);
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c5cff;
  font-weight: 700;
}

.price-group-insert-line {
  height: 3px;
  background: #7c5cff;
  border-radius: 999px;
  margin: 4px 0;
  position: relative;
}

.price-group-insert-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #7c5cff;
  border-radius: 50%;
  transform: translateY(-50%);
}

body.price-is-group-sorting {
  cursor: grabbing;
}

body.price-is-group-sorting * {
  user-select: none;
}

body.price-is-group-sorting .price-group-drag-handle {
  user-select: none;
}

.price-mount-subsection-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.price-add-product-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--t2-turquoise);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.price-add-product-btn:hover {
  filter: brightness(0.96);
}

.price-delete-section-btn,
.price-delete-tab-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--t2-pink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.price-delete-section-btn:hover,
.price-delete-tab-btn:hover {
  filter: brightness(0.94);
}

.price-mount-subsection .price-table-wrap {
  padding-top: 0;
}

.price-mount-subsection-group {
  border-top: 1px solid var(--line);
}

.price-mount-subsection--nested > .price-mount-subsection-summary {
  padding-left: 36px;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
}

.price-mount-subsection--nested .price-table-wrap {
  background: #fff;
}

.price-empty,
.price-empty-block {
  padding: 32px 24px;
  color: var(--muted);
}

.price-flash {
  max-width: 1280px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 14px;
}

.price-tools {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.price-tool-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  display: grid;
  gap: 8px;
}

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

.price-tool-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.price-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--btn-primary);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.price-tool-btn:hover {
  filter: brightness(0.96);
}

.price-tool-btn--secondary {
  background: var(--btn-secondary);
  color: var(--accent);
  border: 0;
}

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

.price-tool-upload {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.price-tool-upload input[type="file"] {
  width: 100%;
  font-size: 12px;
}

.price-tool-groups summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.price-tool-group-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.price-tool-group-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.price-tool-group-list a {
  color: var(--accent);
  text-decoration: none;
}

.price-tool-group-list a:hover {
  text-decoration: underline;
}

.price-tool-group-list span {
  color: var(--muted);
  white-space: nowrap;
}

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

  .price-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .price-nav {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .crm-topbar-meta {
    align-items: flex-start;
  }

  .crm-user-menu {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .price-layout,
  .crm-topbar-inner,
  .crm-promo-bar,
  .crm-page-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .crm-page-hero-inner {
    min-height: calc(64px + var(--sheet-tail));
    padding-top: calc(4px + var(--sheet-tail));
    padding-bottom: calc(6px + var(--sheet-tail));
  }

  .crm-shell.is-sidebar-collapsed .crm-page-hero-inner {
    padding-left: 48px;
  }

  .price-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .crm-brand-logo-video {
    height: 44px;
    max-width: min(100%, 220px);
  }

  .crm-topbar {
    padding: 8px 0 4px;
  }

  .crm-profile-name {
    max-width: 96px;
  }

  :root {
    --crm-sticky-offset: 64px;
  }
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-page-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 380px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: grid;
  gap: 16px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-label {
  font-size: 13px;
  color: var(--muted);
}

.login-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.login-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--btn-primary);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-btn:hover {
  filter: brightness(0.96);
}

/* Inline price edit */
.is-editable-price {
  cursor: pointer;
  outline: none;
}

.is-editable-price:hover {
  box-shadow: inset 0 0 0 1px var(--t2-turquoise);
  background: rgba(32, 205, 255, 0.08);
}

.is-editable-price.is-editing,
.is-editable-price.is-saving {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--t2-turquoise);
}

.is-editable-price.is-saved {
  background: #ecfdf5;
}

.is-editable-price.is-error {
  background: #fef2f2;
  box-shadow: inset 0 0 0 1px #fca5a5;
}

.price-inline-input {
  width: 100%;
  min-width: 72px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: inherit;
  padding: 0;
}

.align-right .price-inline-input {
  text-align: right;
}

.price-flash--hidden {
  display: none;
}

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

.price-tool-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}

.price-tool-field select,
.price-tool-field input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.price-tool-field--hidden {
  display: none;
}

.price-bulk-checkboxes {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.price-bulk-checkboxes--compact {
  max-height: 120px;
}

.price-bulk-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.price-bulk-check input {
  margin-top: 2px;
}

.price-delete-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.price-delete-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.price-tool-btn--danger {
  background: var(--btn-danger);
  color: #fff;
}

.price-tool-btn--danger:hover {
  filter: brightness(0.94);
}

.price-tool-btn--danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.price-tool-btn--tab {
  margin-left: auto;
  background: #7c5cff;
  color: #fff;
}

.price-tool-btn--tab:hover {
  filter: brightness(0.94);
}

.price-group-empty {
  padding: 28px 24px 32px;
  text-align: center;
  background: #fafafa;
  border-top: 1px solid var(--line);
}

.price-group-empty-text {
  margin: 0 0 16px;
  color: var(--muted, #6b7280);
  font-size: 14px;
}

.price-modal-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #6b7280);
}

.price-modal-subtitle {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111827);
}

.price-modal-mount-block {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  display: grid;
  gap: 12px;
}

.price-tab-key-warning {
  color: #b45309;
  font-weight: 600;
}

.price-modal-field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}

.price-modal-field--checkbox input {
  margin-top: 3px;
}

.price-select-col {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.price-select-col input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.price-table--selectable tbody tr:has(.price-row-select:checked) {
  background: #fef2f2;
}

.price-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.price-modal[hidden] {
  display: none;
}

.price-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.price-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 14px;
}

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

.price-modal-title {
  margin: 0;
  font-size: 18px;
}

.price-modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.price-modal-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.price-modal-context {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

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

.price-modal-field[hidden],
.price-modal-field.hidden {
  display: none !important;
}

.price-actions-col {
  width: 88px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.price-edit-item-btn {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--t2-turquoise);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.price-edit-item-btn:hover {
  filter: brightness(0.96);
}

.price-modal-fields {
  display: grid;
  gap: 10px;
}

.price-modal-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.price-modal-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.price-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.price-image-upload {
  display: grid;
  gap: 10px;
}

.price-image-preview-box {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f9fafb;
  position: relative;
}

.price-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.price-image-preview[hidden],
.price-image-empty[hidden] {
  display: none !important;
}

.price-image-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}

.price-image-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.price-image-file-label {
  cursor: pointer;
}

.price-image-clear {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.price-image-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.price-image-hint.is-error {
  color: #b91c1c;
}

.price-image-hint.is-loading {
  color: var(--t2-turquoise);
}

/* Profile modal */
.crm-profile-card {
  width: min(100%, 420px);
}

.crm-profile-avatar-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.crm-profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--t2-lime);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
}

.crm-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crm-profile-avatar-actions {
  display: grid;
  gap: 8px;
}

/* --- CRM shell (sidebar + workspace) --- */
.crm-app {
  min-height: 100vh;
  background: var(--bg);
}

.crm-shell {
  --crm-sidebar-width: 240px;
  min-height: calc(100vh - var(--crm-sticky-offset));
  position: relative;
}

.crm-shell.is-sidebar-collapsed {
  --crm-sidebar-width: 0px;
}

.crm-shell-row {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--crm-sticky-offset));
}

.crm-sidebar {
  width: var(--crm-sidebar-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
  position: sticky;
  top: var(--crm-sticky-offset);
  align-self: flex-start;
  max-height: calc(100vh - var(--crm-sticky-offset));
  overflow: hidden;
}

.crm-shell.is-sidebar-collapsed .crm-sidebar {
  width: 0;
  border-right-width: 0;
  opacity: 0;
  pointer-events: none;
}

.crm-sidebar-rail-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--t2-lime);
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: left 0.22s ease;
}

.crm-sidebar-rail-icon {
  display: block;
  margin-top: -1px;
}

.crm-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.crm-sidebar-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.crm-sidebar-nav {
  display: grid;
  gap: 2px;
  padding: 10px 8px 16px;
  overflow-y: auto;
}

.crm-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.crm-sidebar-item:hover {
  background: #f9fafb;
  border-color: var(--line);
}

.crm-sidebar-item.is-active {
  background: var(--accent-soft);
  border-color: var(--t2-lime);
}

.crm-sidebar-item--sub {
  padding-left: 28px;
  font-size: 13px;
  font-weight: 600;
}

.crm-sidebar-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.crm-sidebar-group.is-open .crm-sidebar-chevron {
  transform: rotate(225deg);
}

.crm-sidebar-sub {
  display: none;
  gap: 2px;
  padding-left: 8px;
}

.crm-sidebar-sub.is-open {
  display: grid;
}

.crm-workspace {
  flex: 1;
  min-width: 0;
  position: relative;
}

.crm-module-placeholder {
  padding: 24px;
}

.crm-module-placeholder-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  max-width: 720px;
}

.crm-module-placeholder-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
}

.crm-module-placeholder-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .crm-sidebar {
    position: fixed;
    left: 0;
    top: var(--crm-sticky-offset);
    bottom: 0;
    z-index: 25;
    max-height: none;
    box-shadow: var(--shadow);
    width: 240px;
  }

  .crm-shell.is-sidebar-collapsed .crm-sidebar {
    transform: translateX(-100%);
    width: 240px;
    opacity: 1;
  }

  .crm-shell.is-sidebar-collapsed .crm-page-hero .crm-sidebar-rail-btn {
    left: 12px;
  }

  .crm-shell.is-sidebar-collapsed .crm-page-hero-inner {
    padding-left: 48px;
  }
}
