:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5d6b82;
  --blue: #1264ff;
  --blue-dark: #0d4fd1;
  --line: #cfe0ff;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
  --radius: 8px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

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

.container {
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
}

.table-page .main-area .container {
  width: calc(100vw - 48px);
  max-width: none;
}

.amortization-page .main-area .container {
  width: calc(100vw - 48px);
  max-width: 1500px;
}

.amortization-panel > h1,
.amortization-sticky-controls > h1 {
  text-align: center;
}

.amortization-sticky-controls {
  position: sticky;
  z-index: 35;
  top: 0;
  padding: 1px 0 10px;
  background: #ffffff;
}

.amortization-sticky-controls.is-stuck {
  box-shadow: 0 8px 12px rgba(10, 35, 75, 0.1);
}

.amortization-table-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.amortization-table-toolbar h2 {
  grid-column: 2;
  margin: 0;
  text-align: center;
}

.amortization-table-toolbar .button {
  grid-column: 3;
  justify-self: end;
}

.investment-section {
  margin: 24px 0 36px;
}

.investment-section h2 {
  text-align: center;
}

.investment-table {
  width: 900px;
  min-width: 820px;
  margin: 0 auto;
  table-layout: fixed;
}

.admin-table.investment-table th,
.admin-table.investment-table td {
  padding: 7px 8px;
  text-align: center;
}

.investment-table th:nth-child(1),
.investment-table th:nth-child(3) {
  width: 230px;
}

.investment-table th:nth-child(2),
.investment-table th:nth-child(4) {
  width: 145px;
}

.investment-table th:nth-child(5) {
  width: 90px;
}

.investment-table input {
  width: 100%;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  text-align: center;
}

.investment-table tfoot {
  border-top: 3px solid var(--blue);
}

.investment-table tfoot th {
  background: #f7fbff;
  font-size: 19px;
}

.investment-row--new td {
  background: #bff3e9;
}

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

.investment-row--editing td {
  background: #fffbea;
}

.site-header {
  border-bottom: 2px solid var(--blue);
  background: var(--panel);
}

.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

body:not(.admin-page):not(.login-page) .header-inner {
  justify-content: center;
}

body:not(.admin-page):not(.login-page) .brand {
  width: 100%;
  text-align: center;
}

body:not(.admin-page):not(.login-page) .top-nav:empty {
  display: none;
}

body.public-admin-nav .site-header .header-inner {
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 14px;
}

body.public-admin-nav .site-header .top-nav {
  width: 100%;
  order: -1;
  justify-content: center;
  gap: clamp(4px, 0.5vw, 8px);
  margin-left: 0;
  padding-bottom: 2px;
}

body.public-admin-nav .site-header .nav-link {
  min-height: 48px;
  min-width: 0;
  padding: 0 clamp(7px, 0.65vw, 10px);
  font-size: clamp(13px, 1.2vw, 17px);
}

body.public-admin-nav .main-brand-row {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  text-align: center;
}

body.public-admin-nav .main-brand-row .brand {
  width: 100%;
  font-size: 38px;
}

.brand {
  color: var(--text);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.top-nav {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  margin-left: auto;
}

.nav-link {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  padding: 0 16px;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-message-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e42323;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(145, 15, 15, 0.35);
}

.nav-message-badge[hidden] {
  display: none;
}

.nav-link--active {
  background: var(--blue);
  color: #ffffff;
}

.admin-page .header-inner {
  justify-content: center;
}

.admin-page .site-header .top-nav {
  width: 100%;
  justify-content: center;
  gap: clamp(4px, 0.5vw, 8px);
  margin-left: 0;
}

.admin-page .site-header .nav-link {
  min-height: 52px;
  min-width: 0;
  padding: 0 clamp(7px, 0.65vw, 10px);
  font-size: clamp(13px, 1.2vw, 17px);
}

@media (max-width: 860px) {
  body.public-admin-nav .site-header .top-nav,
  .admin-page .site-header .top-nav {
    flex-wrap: wrap;
  }
}

.product-card__title-link {
  color: inherit;
  text-decoration: none;
}

.product-card__title-link:hover,
.product-card__title-link:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

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

.yandex-statistics-heading h1,
.yandex-statistics-heading .eyebrow {
  margin-bottom: 0;
}

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

.yandex-statistics-periods .button.is-active {
  background: var(--blue);
  color: #fff;
}

.yandex-statistics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.yandex-statistics-summary article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef5ff;
}

.yandex-statistics-summary span,
.yandex-statistics-summary strong {
  display: block;
}

.yandex-statistics-summary span {
  color: var(--muted);
}

.yandex-statistics-summary strong {
  margin-top: 8px;
  font-size: 28px;
}

.yandex-statistics-table th:nth-child(n + 3),
.yandex-statistics-table td:nth-child(n + 3) {
  text-align: center;
}

.messages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 12px;
}

.messages-table th:first-child,
.messages-table td:first-child {
  width: 34px;
  padding-right: 0;
  text-align: center;
}

.message-row--unread td {
  background: #fff8e7;
  font-weight: 700;
}

.message-unread-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  background: #e42323;
  box-shadow: 0 0 0 3px rgba(228, 35, 35, 0.12);
}

.message-title-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.message-delete-button {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ef4444;
  border-radius: 50%;
  background: #fff;
  color: #dc2626;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.message-delete-button::before,
.message-delete-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.message-delete-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.message-delete-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.message-delete-button:hover,
.message-delete-button:focus-visible {
  background: #dc2626;
  color: #fff;
}

.message-open-button {
  min-height: 36px;
  padding: 0 14px;
}

.message-detail {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.message-detail__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.message-detail__heading h2,
.message-detail__heading .eyebrow {
  margin-bottom: 0;
}

.message-detail__fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.message-detail__fields div {
  min-width: 0;
}

.message-detail__fields dt {
  color: var(--muted);
  font-size: 13px;
}

.message-detail__fields dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.message-detail__text p {
  margin-bottom: 0;
  white-space: normal;
}

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

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

  .messages-toolbar,
  .message-detail__heading {
    align-items: stretch;
    flex-direction: column;
  }

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

body:not(.admin-page):not(.login-page):not(.public-admin-nav) .top-nav a[href="/"] {
  display: none;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px;
}

.account-tabs {
  margin: 14px 0 20px;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.profile-summary div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.profile-summary span {
  color: var(--muted);
}

.profile-summary strong {
  font-size: 18px;
}

.main-area {
  flex: 1;
  padding: 42px 0;
}

.work-panel {
  min-height: 360px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.work-panel h1 {
  margin: 0 0 12px;
  font-size: 34px;
}

.work-panel p {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.button {
  border: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.button--secondary {
  border: 1px solid var(--blue);
  background: var(--panel);
  color: var(--blue);
}

.button--danger-light {
  border: 1px solid #f2b8b8;
  background: #fff1f1;
  color: #dc2626;
}

.button:hover,
.nav-link:hover {
  box-shadow: 0 0 0 4px rgba(18, 100, 255, 0.12);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 16px;
}

.form-stack,
.add-user-form {
  display: grid;
  gap: 16px;
  max-width: 520px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.admin-table input,
.admin-table select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.field [hidden] {
  display: none;
}

.field textarea {
  resize: vertical;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 18px;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: var(--line);
  background: #eef5ff;
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hint {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: #eef5ff;
  color: var(--blue-dark);
  font-weight: 700;
}

.notice--error {
  border-color: #ef4444;
  background: #fff1f2;
  color: #b91c1c;
}

.auth-panel {
  max-width: 680px;
}

.login-page .main-area .container {
  min-height: calc(100vh - 240px);
  display: grid;
  place-items: center;
}

.login-page .auth-panel {
  width: min(680px, 100%);
  min-height: 0;
}

.login-page .auth-panel h1 {
  text-align: center;
  margin-bottom: 24px;
}

.login-page .form-stack {
  margin: 0 auto;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 22px;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-panel h1,
.showcase-section h1 {
  margin: 0;
}

.hero-text {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  color: var(--blue);
  font-weight: 900;
}

.hero-text p {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.button--hero {
  min-height: 42px;
  padding: 0 22px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #f07818;
  font-size: 15px;
  white-space: nowrap;
}

.button--hero:hover {
  border-color: transparent;
  background: transparent;
  color: #d65f00;
  text-decoration: underline;
  transform: none;
}

.hero-actions {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.social-square {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
  overflow: hidden;
}

.social-square img,
.social-icon-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
}

a.social-square:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.social-square--vk {
  background: #0077ff;
}

.social-square--max {
  background: #6b4eff;
}

.social-square--disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.45;
}

.account-tabs .nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.social-settings-grid {
  align-items: stretch;
}

.social-editor {
  height: 100%;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  grid-template-rows: auto auto 1fr;
}

.social-icon-editor {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.social-icon-preview-column {
  width: 110px;
  display: grid;
  gap: 8px;
}

.social-icon-file-button {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
  font-size: 13px;
  cursor: pointer;
}

.social-icon-preview {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: #ffffff;
  font-size: 30px;
  font-weight: 900;
  cursor: default;
  user-select: none;
}

.social-crop-modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.social-crop-preview {
  position: relative;
  width: min(320px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #eef5ff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.social-crop-preview.is-dragging {
  cursor: grabbing;
}

.social-crop-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.social-crop-actions {
  margin-bottom: 0;
}

.social-icon-controls {
  display: grid;
  gap: 12px;
}

.social-icon-controls output {
  color: var(--muted);
  font-weight: 700;
}

.showcase-section {
  margin-top: 28px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.product-card {
  display: grid;
  gap: 10px;
  grid-template-rows: auto 3em 8.8em auto;
  align-content: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 15px;
  text-align: center;
  justify-items: stretch;
}

.product-card > h2,
.product-card > p,
.product-card > strong {
  width: 100%;
  justify-self: center;
  text-align: center;
}

.product-card__gallery {
  aspect-ratio: 4 / 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.product-card__gallery--single {
  grid-template-columns: 1fr;
}

.product-card__media {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: #eef5ff;
}

.product-card__media--main {
  grid-row: 1 / -1;
}

.product-card__media--empty {
  aspect-ratio: 4 / 3;
}

.product-card__media img,
.product-placeholder {
  width: 100%;
  height: 100%;
}

.product-card__media img {
  display: block;
  object-fit: cover;
  transform-origin: center;
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 48px;
  font-weight: 900;
}

.product-card__body {
  display: grid;
  gap: 10px;
}

.product-card h2 {
  margin: 0;
  min-height: 3em;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  border-top: 1px solid #000000;
  border-bottom: 1px solid #000000;
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
}

.product-card h2 a {
  color: inherit;
  text-decoration: none;
}

.product-card h2 a:hover {
  color: var(--blue);
}

.product-card__detail-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card__photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
  text-align: inherit;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.product-card__material {
  min-height: 1.4em;
  overflow: hidden;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-card__details {
  display: grid;
  grid-template-rows: 1.4em 7.4em;
  gap: 0;
}

.product-card strong {
  font-size: 20px;
  text-align: center;
}

.product-card__price {
  min-height: 1.5em;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.product-card__price-row {
  min-height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.product-card__price-row .product-card__price {
  width: auto;
  margin: 0;
}

.product-card__price-row .product-price-edit {
  flex: 0 0 26px;
}

.product-price-modal,
.product-edit-card-modal {
  width: min(520px, calc(100vw - 32px));
}

.product-card__avito {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.product-card__avito-logo {
  position: relative;
  width: 22px;
  height: 24px;
  flex: 0 0 22px;
  overflow: hidden;
}

.product-card__avito-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-card__avito--disabled {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}

.product-card__buy {
  margin-top: 2px;
}

.product-characteristic {
  display: grid;
  grid-template-rows: 1.5em minmax(0, 1fr);
  gap: 5px;
  min-height: 6.4em;
  max-height: 6.4em;
  overflow: hidden;
  color: var(--text);
}

.product-characteristic span {
  color: var(--muted);
  font-weight: 700;
}

.product-characteristic p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
  white-space: pre-line;
  color: var(--text);
}

.product-card__details .product-characteristic {
  min-height: 7.4em;
  max-height: 7.4em;
}

.product-card__details .product-characteristic p {
  -webkit-line-clamp: 5;
  line-height: 1.15;
}

.product-card .button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 13px;
}

.product-author {
  font-size: 14px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.button--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.showcase-section .section-title-row {
  justify-content: center;
  text-align: center;
}

.empty-state {
  margin-top: 18px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
}

.products-table-wrap {
  overflow-y: visible;
}

.table-panel {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

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

.table-toolbar h1 {
  margin: 0;
}

.products-table-sticky-controls {
  position: sticky;
  z-index: 35;
  top: 0;
  padding: 1px 0 10px;
  background: #ffffff;
}

.products-table-sticky-controls.is-stuck {
  box-shadow: 0 8px 12px rgba(10, 35, 75, 0.1);
}

.products-table-sticky-controls h1 {
  margin-bottom: 14px;
}

.product-title-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-title-search input {
  width: min(360px, 48vw);
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.table-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-filters select,
.table-filters .button {
  min-height: 42px;
}

.table-filters select {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #eef5ff;
}

.amortization-table {
  min-width: 1340px;
  table-layout: fixed;
}

.amortization-table caption {
  padding: 0 0 16px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.amortization-table th,
.amortization-table td {
  text-align: center;
}

.amortization-product-link {
  width: 100%;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  line-height: inherit;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.amortization-product-link:hover,
.amortization-product-link:focus-visible {
  color: var(--blue-dark);
}

.nowrap {
  white-space: nowrap;
}

.amortization-table th:first-child {
  width: 54px;
}

.amortization-table th:nth-child(2) {
  width: 190px;
}

.amortization-table th:nth-child(3) {
  width: 135px;
}

.amortization-plastic-cell {
  line-height: 1.3;
}

.amortization-plastic-line {
  display: block;
}

.amortization-table th:nth-child(4),
.amortization-table th:nth-child(5) {
  width: 125px;
}

.amortization-table th:nth-child(6) {
  width: 155px;
}

.amortization-table th:nth-child(7) {
  width: 165px;
}

.amortization-table th:nth-child(8) {
  width: 170px;
}

.amortization-table th:nth-child(9),
.amortization-table th:last-child {
  width: 105px;
}

.amortization-table select,
.amortization-table input {
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.amortization-table td:nth-child(9) input {
  text-align: center;
}

.amortization-editable-cell {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.amortization-editable-cell:not(.is-editing) .amortization-inline-field {
  pointer-events: none;
}

.amortization-editable-cell.is-editing {
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.amortization-editable-cell.is-saving {
  opacity: 0.68;
}

.amortization-editable-cell.is-saved {
  background: #ecfdf3;
  box-shadow: inset 0 0 0 2px #22c55e;
}

.amortization-editable-cell.is-save-error {
  background: #fff1f1;
  box-shadow: inset 0 0 0 2px #ef4444;
}

.common-data-table {
  min-width: 0;
  table-layout: fixed;
}

.plastic-table {
  min-width: 940px;
}

.common-data-table th,
.common-data-table td {
  padding: 7px 10px;
}

.common-data-table th:first-child,
.common-data-table td:first-child {
  width: 48px;
}

.common-data-table .data-name-cell,
.common-data-table .data-price-cell {
  width: 40%;
}

.common-data-table .data-active-cell,
.common-data-table th:last-child {
  width: 170px;
}

.common-data-table input {
  min-height: 34px;
  padding: 6px 10px;
}

.readonly-value {
  display: block;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbff;
  color: var(--text);
}

.plastic-table .data-name-cell {
  width: 22%;
}

.plastic-table .plastic-price-cell {
  width: 140px;
}

.enter-price-input[readonly] {
  cursor: pointer;
  background: #f7fbff;
}

.enter-price-input.is-editing {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(28, 105, 212, 0.12);
}

.common-row--new td {
  background: #c9f3ea;
}

.common-total-row {
  border-top: 3px solid var(--blue);
}

.common-total-row th {
  text-align: center;
  background: #f7fbff;
}

.investment-summary-table {
  width: 620px;
  min-width: 520px;
  margin: 0 auto;
}

.admin-table.investment-summary-table th,
.admin-table.investment-summary-table td {
  text-align: center;
}

.printer-table .data-name-cell,
.printer-table .data-price-cell {
  width: calc((100% - 218px) / 2);
}

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

.admin-table input.active-check {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  accent-color: var(--blue);
}

.icon-delete {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f3b1b1;
  border-radius: 6px;
  background: #fff1f1;
  color: #dc2626;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.icon-edit {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.icon-edit:hover {
  background: #dbeafe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.icon-delete:hover {
  background: #ffe1e1;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.products-table-wrap {
  padding-bottom: 8px;
}

.products-table-scrollbar {
  position: fixed;
  z-index: 15;
  bottom: 0;
  height: 18px;
  overflow-x: scroll;
  overflow-y: hidden;
  border-top: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 -2px 8px rgba(10, 35, 75, 0.12);
}

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

.products-table-scrollbar__spacer {
  height: 1px;
}

.products-table-fixed-head,
.amortization-table-fixed-head {
  position: fixed;
  z-index: 30;
  overflow: hidden;
  box-shadow: 0 5px 10px rgba(10, 35, 75, 0.18);
}

.products-table-fixed-head {
  pointer-events: auto;
}

.amortization-table-fixed-head {
  pointer-events: none;
}

.products-table-fixed-head[hidden],
.amortization-table-fixed-head[hidden] {
  display: none;
}

.products-table-fixed-head .products-table,
.amortization-table-fixed-head .amortization-table {
  margin: 0;
}

.journal-filters {
  margin: 0 0 14px;
}

.journal-page {
  max-width: none;
}

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

.journal-table th:nth-child(1),
.journal-table td:nth-child(1) {
  width: 120px;
}

.journal-table th:nth-child(2),
.journal-table td:nth-child(2) {
  width: 100px;
}

.journal-table th:nth-child(3),
.journal-table td:nth-child(3) {
  width: 190px;
}

.journal-table th:nth-child(5),
.journal-table td:nth-child(5) {
  width: 180px;
  text-align: center;
}

.journal-table form {
  margin: 0;
}

.journal-restore-button {
  min-height: 36px;
  padding: 7px 12px;
}

.journal-restored {
  color: #15803d;
  font-weight: 800;
}

.journal-no-backup {
  color: var(--muted);
}

.products-table {
  min-width: 1240px;
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0 12px;
}

.products-table th,
.products-table td {
  padding: 4px 3px;
  text-align: center;
  vertical-align: middle;
}

.products-table th {
  line-height: 1.15;
}

.products-table .row-select {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--blue);
}

.product-record__row td {
  position: relative;
  min-width: 76px;
  height: 64px;
  padding: 32px 3px 4px;
  background: #ffffff;
}

.product-record__row--first td:not(.product-photo-cell) {
  border-bottom: 0;
}

.product-record__row--second td {
  border-top-style: dashed;
}

.product-photo-cell {
  width: 120px;
  min-width: 120px !important;
  padding: 32px 4px 4px !important;
  background: #f8fbff !important;
}

.product-index-cell,
.avito-cell {
  width: 66px;
  min-width: 66px !important;
}

.product-index-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.table-select-head {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.table-select-head .icon-edit {
  width: 28px;
  height: 28px;
}

.table-select-head .icon-edit:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

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

.product-edit-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.product-edit-photo-thumbs {
  min-height: 76px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.product-edit-photo-thumb {
  position: relative;
  width: 88px;
  height: 68px;
  flex: 0 0 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef5ff;
  cursor: grab;
  user-select: none;
}

.product-edit-photo-thumb.is-main {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(18, 100, 255, 0.2);
}

.product-edit-photo-thumb.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.product-edit-photo-thumb.is-drag-over {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 255, 0.28);
}

.product-edit-photo-main-badge {
  position: absolute;
  z-index: 2;
  left: 3px;
  bottom: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(18, 100, 255, 0.92);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
}

.product-edit-photo-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-edit-photo-remove {
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #dc2626;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.product-edit-photo-add {
  width: 88px;
  height: 68px;
  flex: 0 0 88px;
  padding: 0;
  border: 2px dashed #9dbcf8;
  border-radius: 6px;
  background: #ffffff;
  color: var(--blue);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.product-edit-photo-add:hover,
.product-edit-photo-remove:hover {
  border-color: var(--blue);
}

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

.product-photo-meta {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  right: 10px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
}

.product-photo-meta label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.thumb-frame {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef5ff;
}

.table-thumbs {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.table-thumb-frame {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #eef5ff;
  cursor: pointer;
}

.table-thumb-frame:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(18, 100, 255, 0.18);
}

.thumb-placeholder {
  color: var(--muted);
  font-weight: 700;
}

.product-cell-label,
.product-cell-value {
  display: block;
  text-align: center;
}

.product-cell-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: normal;
}

.product-cell-value {
  color: var(--text);
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-date-time {
  display: grid;
  gap: 1px;
  white-space: nowrap;
}

.products-empty-cell {
  text-align: center !important;
}

.characteristic-cell {
  min-width: 174px !important;
  max-width: 190px;
}

.characteristic-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.characteristic-preview {
  min-width: 0;
  max-width: 138px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
}

.characteristic-preview--empty {
  color: var(--muted);
}

/* Однострочная таблица изделий */
.products-table {
  min-width: 2075px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

.products-table th,
.products-table td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}

.products-table th:last-child,
.products-table td:last-child {
  border-right: 1px solid var(--line) !important;
  box-shadow: inset -1px 0 0 var(--line);
}

.products-table thead th {
  position: relative;
  height: 42px;
  background: #000000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: normal;
}

.products-column-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 3;
  width: 11px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.products-column-resizer::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.34);
}

.products-column-resizer:hover::after,
.products-column-resizer.is-resizing::after {
  background: #63a5ff;
}

body.is-resizing-products-column,
body.is-resizing-products-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

.products-table tbody td {
  height: 88px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.products-table tbody tr.is-search-match td {
  background: #fff3a3;
  box-shadow: inset 0 2px 0 #f0b400, inset 0 -2px 0 #f0b400;
}

.products-table .col-number { width: 64px; }
.products-table .col-photo { width: 70px; }
.products-table .col-author { width: 105px; }
.products-table .col-title { width: 105px; }
.products-table .col-date { width: 110px; }
.products-table .col-printer { width: 105px; }
.products-table .col-plastic { width: 80px; }
.products-table .col-color { width: 65px; }
.products-table .col-characteristic { width: 240px; }
.products-table .col-spool-price { width: 85px; }
.products-table .col-usage { width: 60px; }
.products-table .col-time { width: 60px; }
.products-table .col-wear { width: 90px; }
.products-table .col-power { width: 80px; }
.products-table .col-tariff { width: 120px; }
.products-table .col-weight { width: 60px; }
.products-table .col-markup { width: 80px; }
.products-table .col-material { width: 85px; }
.products-table .col-electricity { width: 90px; }
.products-table .col-amortization { width: 95px; }
.products-table .col-total { width: 130px; }
.products-table .col-quantity { width: 65px; }
.products-table .col-with-markup { width: 95px; }
.products-table .col-avito { width: 70px; }

.product-index-cell,
.product-photo-cell,
.avito-cell {
  min-width: 0 !important;
}

.product-photo-cell {
  padding: 6px !important;
  background: #f8fbff !important;
}

.product-index-actions,
.two-line-value {
  display: grid;
  align-items: center;
  justify-items: center;
}

.product-index-actions {
  grid-template-columns: auto 28px;
  grid-template-rows: 28px;
  justify-content: center;
  gap: 7px;
}

.product-index-actions strong {
  grid-row: 1;
}

.product-index-actions .product-row-edit {
  grid-column: 2;
  grid-row: 1;
  width: 28px;
  height: 28px;
}

.products-delete-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
}

.product-delete-list-wrap {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-delete-list {
  min-width: 0;
}

.product-delete-list th,
.product-delete-list td {
  text-align: left;
}

.product-delete-list th:first-child,
.product-delete-list td:first-child {
  width: 82px;
  text-align: center;
}

.product-delete-list .product-delete-select {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--blue);
}

.two-line-value {
  gap: 2px;
}

.product-title-cell {
  padding-right: 10px !important;
  padding-left: 10px !important;
}

.product-title-cell,
.product-printer-cell {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.table-main-photo {
  width: 48px;
  height: 48px;
  display: block;
  overflow: hidden;
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #eef5ff;
  cursor: pointer;
}

.table-main-photo:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 255, 0.18);
}

.characteristic-cell {
  min-width: 0 !important;
  max-width: none;
}

.characteristic-inline {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 6px;
}

.characteristic-content {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.characteristic-preview {
  width: 100%;
  max-width: none;
  -webkit-line-clamp: 3;
  line-height: 1.2;
  text-align: center;
}

.characteristic-avito-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border: 1px solid #16a34a;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.table-heading-short {
  display: none;
}

.avito-cell .avito-form {
  right: 42px;
  left: auto;
}

@media (max-width: 1600px) {
  .table-heading-full {
    display: none;
  }

  .table-heading-short {
    display: inline;
  }
}

.avito-editor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.avito-editor summary {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.avito-editor summary::-webkit-details-marker {
  display: none;
}

.avito-editor--linked summary {
  border-color: #16a34a;
  background: #ecfdf3;
  color: #15803d;
}

.avito-cell .avito-form {
  right: auto;
  left: 42px;
}

.avito-form {
  position: absolute;
  z-index: 1000;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  width: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 68, 255, 0.22), 0 0 0 4px rgba(0, 84, 255, 0.08);
}

.avito-form input {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.avito-form .button {
  min-height: 38px;
  padding: 0 12px;
}

.mini-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--blue);
  font-weight: 700;
}

.password-mask {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.add-user-form {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.users-table-actions {
  align-items: center;
}

.user-login-presence.is-online {
  border-color: #22c55e;
  background: #ecfdf5;
  color: #15803d;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.add-user-form h2 {
  margin: 0;
}

.settings-card {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-card:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-card h2 {
  margin: 0;
}

.social-settings-grid .settings-card.social-editor {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.card-title-row,
.section-title-row,
.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title-row {
  margin-bottom: 10px;
}

.button--square {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.small-tool {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  color: var(--blue);
  font-weight: 800;
}

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

.settings-grid__wide {
  grid-column: 1 / -1;
}

.analytics-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.analytics-status {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f7f9fc;
  font-weight: 700;
}

.analytics-status--ok {
  border-color: #8ed5aa;
  color: #18713c;
  background: #effbf3;
}

.analytics-settings-form .settings-card {
  align-content: start;
}

.analytics-settings-form > .settings-card:nth-of-type(2) {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.analytics-settings-card--wide {
  grid-column: 1 / -1;
}

.settings-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.product-detail {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.product-detail__back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.product-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.product-detail__body {
  display: grid;
  gap: 16px;
}

.product-detail__body h1,
.product-detail__body p {
  margin: 0;
}

.product-detail__material {
  color: var(--muted);
}

.product-detail__price {
  font-size: 30px;
}

.electricity-settings-page {
  min-height: 360px;
}

.electricity-setting-row {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 40px;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.electricity-setting-name,
.electricity-setting-tariff {
  display: grid;
  gap: 5px;
}

.electricity-setting-name > span,
.electricity-setting-tariff > span {
  color: var(--muted);
  font-size: 14px;
}

.electricity-setting-name small {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.electricity-setting-tariff strong {
  font-size: 20px;
}

.electricity-setting-edit {
  width: 40px;
  height: 40px;
}

.electricity-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.electricity-mode-options legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-weight: 800;
}

.electricity-mode-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.electricity-mode-options input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.electricity-mode-options span {
  font-weight: 700;
}

.electricity-settings-page .modal-form .button {
  width: 100%;
}

.inline-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.inline-add-form input {
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.common-table-actions {
  align-items: center;
}

.common-table-actions input {
  flex: 0 1 260px;
}

#printers-add-form input,
#plastic-add-form input {
  flex: 0 1 260px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

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

.modal-window {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.product-photo-viewer {
  position: relative;
  width: min(1400px, 100%);
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.product-photo-viewer__arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 52px;
  height: 72px;
  display: grid;
  place-items: center;
  padding: 0 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(20, 36, 64, 0.64);
  color: #ffffff;
  font-size: 54px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.product-photo-viewer__arrow:hover,
.product-photo-viewer__arrow:focus-visible {
  background: rgba(18, 100, 255, 0.9);
}

.product-photo-viewer__arrow--prev {
  left: 18px;
}

.product-photo-viewer__arrow--next {
  right: 18px;
}

.product-photo-viewer__main {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f6fb;
}

.product-photo-viewer__main img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

.product-photo-viewer .modal-title-row {
  position: relative;
  justify-content: center;
  min-height: 42px;
  padding: 0 48px;
  text-align: center;
}

.product-photo-viewer .modal-title-row h2 {
  width: 100%;
  margin: 0;
  text-align: center;
}

.product-photo-viewer .modal-title-row .icon-delete {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.product-photo-viewer__strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  margin-top: 12px;
  padding: 4px;
}

.product-photo-viewer__thumb {
  width: 72px;
  height: 58px;
  flex: 0 0 72px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #eef5ff;
  cursor: pointer;
}

.product-photo-viewer__thumb:hover,
.product-photo-viewer__thumb.is-active {
  border-color: var(--blue);
}

.product-photo-viewer__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain !important;
  object-position: center !important;
  background: #eef5ff;
}

.modal-title-row {
  margin-bottom: 14px;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.calculator-panel {
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 20px;
}

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

.calculator-top {
  display: grid;
  grid-template-columns: minmax(240px, 360px) repeat(3, minmax(170px, 190px));
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.calculator-title {
  width: 100%;
  max-width: 360px;
}

.calculator-title input,
.calculator-top__button {
  min-height: 46px;
}

.calculator-title input {
  text-align: center;
}

.calculator-title input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.calculator-top__button {
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
}

.photo-control {
  display: grid;
  gap: 4px;
}

.photo-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.photo-control__button {
  min-height: 46px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  white-space: normal;
  cursor: pointer;
}

.photo-control__button,
.calculator-top__button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.photo-control__button.is-attached {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.photo-control__button.is-error {
  border-color: #ef4444;
  background: #fff1f2;
  color: #b91c1c;
}

.photo-control__hint {
  display: none;
  color: var(--muted);
  font-size: 14px;
}

.photo-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

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

.photo-editor__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.photo-editor__item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 34px 7px 7px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: default;
}

.photo-editor__item.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 255, 0.1);
}

.photo-editor__item-thumb {
  width: 64px;
  height: 52px;
  overflow: hidden;
  border-radius: 6px;
  background: #e8f0ff;
}

.photo-editor__item-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
}

.photo-editor__item-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.photo-editor__item-text strong,
.photo-editor__item-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-editor__item-text small {
  color: var(--muted);
}

.photo-editor__remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #f3b1b1;
  border-radius: 50%;
  background: #fff1f1;
  color: #c81e1e;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.photo-editor__workspace {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(240px, 1fr);
  gap: 18px;
  align-items: center;
}

.photo-editor__dialog {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(17, 32, 58, 0.62);
  backdrop-filter: blur(2px);
}

.photo-editor__dialog[hidden] {
  display: none;
}

.photo-editor__dialog-window {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #b9d0ff;
  border-radius: 14px;
  background: #f8fbff;
  box-shadow: 0 24px 70px rgba(17, 32, 58, 0.32);
}

body.photo-editor-dialog-open {
  overflow: hidden;
}

.photo-editor__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  background: #e8f0ff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.photo-editor__stage.is-dragging {
  cursor: grabbing;
}

.photo-editor__stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
  pointer-events: none;
}

.photo-editor__controls {
  display: grid;
  gap: 14px;
}

.photo-editor__controls > strong {
  font-size: 22px;
}

.photo-editor__controls p {
  margin: 0;
  font-size: 15px;
}

.photo-zoom {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.photo-zoom input {
  width: 100%;
  min-height: 28px;
  padding: 0;
}

.photo-zoom output {
  text-align: right;
}

.photo-editor__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#photo-metadata {
  display: none;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.calculator-grid .field {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 122px;
  justify-content: stretch;
  align-content: space-between;
  gap: 10px;
  padding: 14px 12px 12px;
  border-right: 1px solid var(--line);
}

.calculator-grid .calculator-auto-field input[readonly] {
  border-color: #c4c9d1;
  background: #dfe3e8;
  color: #4b5563;
}

.calculator-auto-input {
  position: relative;
}

.calculator-auto-input input {
  padding-top: 15px;
}

.calculator-auto-badge {
  position: absolute;
  z-index: 1;
  top: 5px;
  right: 7px;
  color: #dc2626;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.calculator-grid .field:nth-child(5n) {
  border-right: 0;
}

.calculator-grid .field:nth-child(n + 6) {
  border-top: 1px solid var(--line);
}

.calculator-grid .field span {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.calculator-grid .field input {
  min-height: 48px;
  font-size: 18px;
  text-align: center;
}

.calculator-grid .field select {
  width: 100%;
  min-height: 48px;
  text-align: center;
  text-align-last: center;
}

.calculator-results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf4ff;
}

.calculator-results div {
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.calculator-results span {
  color: var(--muted);
  font-size: 15px;
}

.calculator-results b,
.calculator-results strong {
  color: var(--text);
  font-size: 20px;
}

.calculator-results .result-main {
  grid-column: 1 / -1;
  display: grid;
  justify-content: start;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0 0 8px;
}

.calculator-results .result-main strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1.05;
}

.calculator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.calculator-error {
  display: none;
  padding: 10px 12px;
  border: 1px solid #ef4444;
  border-radius: var(--radius);
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 700;
}

.calculator-error.is-visible {
  display: block;
}

@media (max-width: 1000px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 0;
  }

  .brand {
    font-size: 34px;
    white-space: normal;
  }

  body:not(.admin-page):not(.login-page) .header-inner {
    align-items: center;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .admin-page .site-header .top-nav {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .product-detail__grid,
  .calculator-top,
  .calculator-grid,
  .calculator-results {
    grid-template-columns: 1fr;
  }

  .analytics-settings-card--wide {
    grid-column: auto;
  }

  .social-icon-editor {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .electricity-setting-row,
  .electricity-mode-options {
    grid-template-columns: 1fr;
  }

  .electricity-setting-edit {
    justify-self: start;
  }

  .calculator-title {
    max-width: none;
  }

  .calculator-grid .field {
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .calculator-grid .field:first-child {
    border-top: 0;
  }

  .photo-editor__list,
  .photo-editor__workspace {
    grid-template-columns: 1fr;
  }

  .calculator-results .result-main {
    grid-column: auto;
    align-items: flex-start;
    flex-direction: column;
  }
}
