@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --orange: #ff5100;
  --orange-dark: #e04800;
  --orange-soft: #fff5f0;
  --gray: #494c4e;
  --gray-mid: #717171;
  --gray-light: #b4b4b4;
  --white: #ffffff;
  --bg: #ffffff;
  --cut: 32px;
  --radius: 12px;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 4px 24px rgba(73, 76, 78, 0.08);
  --max: 100%;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--gray);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

.chamfer {
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    0 100%
  );
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--orange-soft);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card .login-logo {
  display: block;
  height: 28px;
  width: 160px;
  margin: 0 auto 20px;
  background: url("../assets/logo-patriot.svg") left center / contain no-repeat;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--gray);
}

.login-card p {
  margin: 0 0 24px;
  text-align: center;
  color: var(--gray-mid);
  font-size: 0.9rem;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.875rem;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font: inherit;
  margin-bottom: 16px;
}

.login-card input:focus {
  outline: 2px solid var(--orange);
  border-color: var(--orange);
}

.login-error {
  color: var(--orange);
  font-size: 0.875rem;
  margin-bottom: 12px;
  min-height: 1.2em;
}

/* Site header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid #eee;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.dashboard-compact .site-header {
  padding: 4px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.dashboard-compact .site-header-inner {
  gap: 10px;
  padding: 0 8px;
}

.dashboard-compact .site-header img {
  height: 20px;
}

.dashboard-compact .site-header h1 {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 0;
}

.dashboard-compact .header-actions .btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.site-header-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-header img {
  height: 28px;
  width: auto;
}

.site-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray);
  line-height: 1.35;
  flex: 1;
  min-width: 200px;
}

.header-actions {
  margin-left: auto;
}

/* Hero */
.hero {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 32px 12px 24px;
}

.dashboard-compact .hero {
  display: none;
}

.dashboard-compact .dashboard-controls {
  width: 100%;
  margin-bottom: 4px;
  padding: 6px 8px;
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-compact .dashboard-controls .stats-grid {
  width: 100%;
  margin-bottom: 0;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-compact .dashboard-controls .filters {
  width: 100%;
  gap: 8px 10px;
  grid-template-columns:
    minmax(160px, 2.2fr)
    minmax(120px, 1.15fr)
    minmax(120px, 1.15fr)
    minmax(0, 1.25fr)
    minmax(0, 1.25fr)
    minmax(140px, 1fr);
  align-items: end;
}

.dashboard-compact .stats-grid {
  margin-bottom: 4px;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-compact .dashboard-controls .stats-grid {
  margin-bottom: 0;
}

.dashboard-compact .stat-card {
  padding: 4px 8px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 0;
  box-shadow: none;
}

.dashboard-compact .stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-compact .stat-label {
  font-size: 0.68rem;
  margin-top: 0;
  line-height: 1.2;
  color: var(--gray-mid);
}

.dashboard-compact .block-panel {
  margin-bottom: 4px;
  padding: 6px 8px;
}

.dashboard-compact .block-panel h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding-bottom: 0;
  border-bottom: none;
}

.dashboard-compact .main-wrap {
  width: 100%;
  padding: 4px 6px 4px;
}

.dashboard-compact .site-footer {
  display: none;
}

.dashboard-compact .filters {
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.dashboard-compact .dashboard-controls .filter-group-checkbox {
  min-height: 0;
  align-items: flex-end;
  padding-bottom: 2px;
}

.dashboard-compact .dashboard-controls .filter-group-checkbox .filter-checkbox {
  margin-bottom: 0;
  white-space: nowrap;
}

.dashboard-compact .dashboard-controls .filter-group-sku .sku-filter-control {
  min-height: 0;
}

@media (max-width: 1100px) {
  .dashboard-compact .dashboard-controls .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-compact .dashboard-controls .filter-group-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .dashboard-compact .dashboard-controls .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-compact .dashboard-controls .filters {
    grid-template-columns: 1fr;
  }
}

.dashboard-compact .filter-group label {
  font-size: 0.68rem;
  margin-bottom: 2px;
  font-weight: 600;
}

.dashboard-compact .filter-group input,
.dashboard-compact .filter-group select {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.dashboard-compact .filter-checkbox {
  font-size: 0.75rem;
  gap: 4px;
}

.dashboard-compact .filter-checkbox input {
  width: 14px;
  height: 14px;
}

.dashboard-compact .sku-filter-control {
  gap: 4px;
}

.dashboard-compact .table-panel-header {
  margin-bottom: 4px;
  gap: 6px 8px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.dashboard-compact .table-panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}

.dashboard-compact .table-panel-header h3 {
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-compact .table-coverage-hint {
  margin: 0;
  font-size: 0.72rem;
}

.dashboard-compact .table-export-toolbar {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dashboard-compact .export-actions-row {
  gap: 6px;
}

.dashboard-compact .export-checkbox {
  font-size: 0.75rem;
}

.dashboard-compact .comparison-table-shell {
  height: calc(100vh - 88px);
  min-height: 240px;
}

.dashboard-compact .block-panel:has(#comparison-table) {
  padding: 6px 4px 4px;
}

.dashboard-compact .block-panel:has(#comparison-table) h3 {
  margin: 0;
}

#comparison-table.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.hero h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--gray);
  line-height: 1.25;
}

.hero p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--gray-mid);
  max-width: 720px;
  line-height: 1.6;
}

/* Main */
.main-wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 8px 48px;
}

.block-panel {
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  margin-bottom: 28px;
}

.block-panel h3 {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--orange);
}

.table-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.table-panel-title {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}

.table-panel-header h3 {
  margin: 0;
}

.table-coverage-hint {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
}

.table-export-toolbar {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

.table-panel-header .comparison-table-paginator-top {
  grid-column: 3;
  justify-self: end;
}

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

.export-checkbox,
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gray);
  cursor: pointer;
  user-select: none;
}

.export-checkbox input,
.filter-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.filter-group-checkbox {
  display: flex;
  align-items: flex-end;
  min-height: 58px;
}

.filter-group-checkbox .filter-checkbox {
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text);
}


.filter-group-sku .sku-filter-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.sku-filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.85rem;
}

.btn-text:hover {
  color: var(--orange);
}

.btn-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.sku-filter-modal-content {
  max-width: 560px;
}

.sku-filter-textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 16px;
}

.sku-filter-textarea:focus {
  outline: 2px solid var(--orange);
  border-color: var(--orange);
}

.sku-filter-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Job titles */
.radio-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-card:hover {
  border-color: rgba(255, 81, 0, 0.4);
}

.radio-card:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--orange);
}

.custom-title-field {
  margin-top: 12px;
}

.custom-title-field input {
  width: 100%;
  max-width: 480px;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font: inherit;
}

/* Work section — big visual block */
.scope-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid #eee;
  border-radius: var(--radius);
}

.scope-toolbar--bottom {
  margin-top: 8px;
  margin-bottom: 28px;
}

.scope-save-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-mid);
  flex: 1;
  min-width: 200px;
}

.work-block {
  margin-bottom: 40px;
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.work-block-banner {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--orange-soft);
}

.work-block-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.work-block-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(73, 76, 78, 0.75) 0%, rgba(73, 76, 78, 0.2) 100%);
}

.work-block-title-wrap {
  position: absolute;
  left: 24px;
  bottom: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-block-title-wrap .wb-icon {
  font-size: 1.75rem;
}

.work-block-title-wrap h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.work-block-body {
  padding: 24px 24px 20px;
}

.work-block-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Item cards */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.item-card {
  display: block;
  cursor: pointer;
  margin: 0;
}

.item-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.item-card-inner {
  height: 100%;
  padding: 18px 18px 16px;
  border: 2px solid #ececec;
  border-radius: var(--radius);
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card:hover .item-card-inner {
  border-color: rgba(255, 81, 0, 0.35);
}

.item-card input:checked + .item-card-inner {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: 0 0 0 1px var(--orange);
}

.item-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.item-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.item-card h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray);
  line-height: 1.3;
}

.item-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-mid);
  line-height: 1.45;
}

.item-check {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--orange);
  opacity: 0;
}

.item-card input:checked + .item-card-inner .item-check {
  opacity: 1;
}

.item-check::before {
  content: "✓ Включено в предложение";
}

/* Offer */
.offer-panel {
  margin-top: 16px;
  padding: 32px 32px 28px;
  background: var(--white);
  border: 2px solid var(--orange);
  box-shadow: var(--shadow);
}

.offer-panel h3 {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray);
}

.offer-panel-hint {
  margin: -8px 0 16px;
  font-size: 0.9rem;
  color: var(--gray-mid);
}

.offer-preview {
  background: #fafafa;
  border-left: 4px solid var(--orange);
  padding: 24px 28px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gray);
  min-height: 160px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.offer-preview.is-ready {
  border-left-width: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 81, 0, 0.12);
}

.offer-doc h4 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gray);
}

.offer-doc > p {
  margin: 0 0 16px;
}

.offer-role {
  margin: 0 0 20px;
  padding: 18px 20px;
  background: var(--white);
  border: 2px solid var(--orange);
  border-radius: var(--radius);
}

.offer-role-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin-bottom: 8px;
}

.offer-role strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray);
  line-height: 1.35;
}

.offer-intro {
  margin: 0 0 20px !important;
  font-weight: 500;
}

.offer-duties-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-mid);
}

.offer-section-block {
  margin-bottom: 16px;
}

.offer-section-block h5 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray);
}

.offer-section-block ul {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
}

.offer-section-block li {
  position: relative;
  padding: 4px 0 4px 20px;
  font-size: 0.92rem;
}

.offer-section-block li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 800;
}

.offer-empty {
  padding: 14px 16px;
  background: #fff8f4;
  border-radius: var(--radius);
  color: var(--gray-mid);
  font-size: 0.92rem;
  margin: 0 0 16px;
}

.offer-outro-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
}

.offer-outro-block h5 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
}

.offer-signature {
  margin: 16px 0 0 !important;
  font-weight: 600;
}

.offer-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.offer-params-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray);
}

.offer-params-grid input {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font: inherit;
}

.offer-params-toolbar {
  margin-top: 12px;
  margin-bottom: 0;
}

.offer-params-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--gray-mid);
  line-height: 1.45;
}

.offer-doc--formal {
  font-size: 0.95rem;
  line-height: 1.65;
}

.offer-doc-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.offer-company-full {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.9rem;
}

.offer-company-short {
  margin: 0 0 16px;
  font-weight: 700;
}

.offer-doc-type {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.offer-doc-date {
  margin: 0;
  color: var(--gray-mid);
}

.offer-greeting {
  font-weight: 600;
  margin-bottom: 12px !important;
}

.offer-tasks-title {
  margin: 16px 0 8px !important;
}

.offer-tasks-list {
  margin: 0 0 16px;
  padding: 0 0 0 8px;
  list-style: none;
}

.offer-tasks-list li {
  position: relative;
  padding: 4px 0 4px 20px;
}

.offer-tasks-list li::before {
  content: "−";
  position: absolute;
  left: 0;
  font-weight: 700;
}

.offer-validity {
  margin-top: 16px !important;
}

.offer-email-line {
  color: var(--orange);
  word-break: break-all;
}

.offer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-dark);
}

.btn-secondary {
  background: var(--gray);
  color: #fff;
}

.btn-outline {
  background: var(--white);
  color: var(--gray);
  border: 1px solid #ddd;
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* Sticky CTA */
.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 16px 24px 20px;
  background: linear-gradient(to top, #fff 75%, transparent);
}

.cta-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.cta-bar .btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.05rem;
}

.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 12px 22px;
  background: var(--gray);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--gray-light);
  border-top: 1px solid #eee;
}

.screen-only {
  /* visible on screen */
}

.print-only {
  display: none;
}

.offer-print-head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--orange);
}

.offer-print-head img {
  height: 32px;
  width: auto;
  margin-bottom: 8px;
}

.offer-print-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray-mid);
}

.offer-candidate {
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.offer-candidate strong {
  color: var(--gray);
}

@media print {
  @page {
    margin: 18mm 16mm;
    size: A4;
  }

  body {
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .login-screen,
  .screen-only,
  .no-print-params,
  .toast,
  #login-screen {
    display: none !important;
  }

  #app.hidden {
    display: block !important;
  }

  .print-only {
    display: block !important;
  }

  .main-wrap {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .offer-panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    clip-path: none !important;
  }

  .offer-preview {
    border: none;
    background: #fff;
    padding: 0;
    min-height: 0;
  }

  .offer-role {
    page-break-inside: avoid;
  }

  .offer-section-block {
    page-break-inside: avoid;
  }
}

@media (max-width: 640px) {
  .site-header h1 {
    font-size: 0.9rem;
  }

  .work-block-banner {
    height: 120px;
  }

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

  .block-panel,
  .offer-panel {
    padding: 20px 16px;
  }
}

/* --- PATRIOT Competitor Service (extends petrpatriot.ru) --- */

.header-actions.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  padding: 18px 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--orange);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin-top: 4px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: 2px solid var(--orange);
  border-color: var(--orange);
}

.comparison-table-shell {
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.comparison-table-paginator-top {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.comparison-table-shell .comparison-table-paginator-top {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 4px 12px rgba(73, 76, 78, 0.06);
}

.comparison-table-hscroll-top {
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  background: #f3f4f6;
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 #f3f4f6;
}

.comparison-table-hscroll-top::-webkit-scrollbar {
  height: 10px;
}

.comparison-table-hscroll-top::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 6px;
}

.comparison-table-hscroll-top-inner {
  height: 1px;
  pointer-events: none;
}

.comparison-table-paginator-top .tabulator-footer-contents,
#comparison-table .tabulator-footer .tabulator-footer-contents {
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--gray);
}

.comparison-table-paginator-top .tabulator-page-counter,
#comparison-table .tabulator-footer .tabulator-page-counter {
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}

.comparison-table-paginator-top .tabulator-paginator,
#comparison-table .tabulator-footer .tabulator-paginator {
  flex: 1;
  text-align: right;
  font-weight: 600;
  color: var(--gray);
}

.comparison-table-paginator-top .tabulator-page-size,
#comparison-table .tabulator-footer .tabulator-page-size {
  border: 1px solid #aaa;
  border-radius: 3px;
  display: inline-block;
  margin: 0 5px;
  padding: 2px 5px;
  font: inherit;
}

.comparison-table-paginator-top .tabulator-pages,
#comparison-table .tabulator-footer .tabulator-pages {
  margin: 0 7px;
}

.comparison-table-paginator-top .tabulator-page,
#comparison-table .tabulator-footer .tabulator-page {
  background: hsla(0, 0%, 100%, 0.2);
  border: 1px solid #aaa;
  border-radius: 3px;
  display: inline-block;
  margin: 0 2px;
  padding: 2px 5px;
  font: inherit;
  cursor: pointer;
}

.comparison-table-paginator-top .tabulator-page.active,
#comparison-table .tabulator-footer .tabulator-page.active {
  color: #d00;
}

@media (max-width: 1200px) {
  .table-panel-header {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title title"
      "export paginator";
  }

  .table-panel-title {
    grid-area: title;
  }

  .table-export-toolbar {
    grid-area: export;
    justify-self: center;
  }

  .table-panel-header .comparison-table-paginator-top {
    grid-area: paginator;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .table-panel-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "export"
      "paginator";
  }

  .table-export-toolbar,
  .table-panel-header .comparison-table-paginator-top {
    justify-self: stretch;
  }
}

.comparison-table-paginator-top .tabulator-page:disabled,
#comparison-table .tabulator-footer .tabulator-page:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .comparison-table-paginator-top .tabulator-page:not(:disabled):hover,
  #comparison-table .tabulator-footer .tabulator-page:not(:disabled):hover {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
  }
}

#comparison-table {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

#comparison-table .tabulator {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

#comparison-table .tabulator-tableholder {
  flex: 1 1 auto;
  min-height: 0;
}

#comparison-table .tabulator-footer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--white);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(73, 76, 78, 0.08);
}


.block-panel:has(#comparison-table) {
  padding: 16px 8px 8px;
  overflow: hidden;
}

.price-lower {
  background: #ff4444 !important;
  color: white !important;
  font-weight: 700;
}

.price-higher {
  background: #44bb44 !important;
  color: white !important;
  font-weight: 700;
}

.analog-status-yes .analog-icon {
  color: #2e9e4a;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.analog-status-no .analog-icon {
  color: #d63b3b;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.cheapest-cell {
  text-align: left;
  line-height: 1.2;
}

.cheapest-brand {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cheapest-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cheapest-name {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--gray);
  cursor: pointer;
}

.cheapest-name.multiline-name-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.28;
  white-space: normal;
  word-break: break-word;
}

.cheapest-thumb {
  flex: 0 0 auto;
  cursor: pointer;
  margin-top: 2px;
}

.cheapest-name:hover,
.cheapest-thumb:hover {
  opacity: 0.85;
}

.cell-muted {
  color: var(--gray-light);
}

.toast.show,
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.product-thumb {
  max-height: 56px;
  max-width: 72px;
  object-fit: contain;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: white;
  padding: 2px;
}

.product-thumb:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(255, 81, 0, 0.25);
}

.no-photo {
  font-size: 0.75rem;
  color: var(--gray-light);
}

.btn-photo-compare {
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.btn-photo-compare:hover {
  background: var(--orange);
  color: white;
}

.btn-match-ai {
  padding: 4px 8px;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-match-ai.is-loading {
  opacity: 0.55;
  cursor: wait;
}

.btn-match-wrong {
  border-color: #c62828;
  background: #ffebee;
  color: #b71c1c;
}

.btn-match-wrong:hover:not(:disabled) {
  background: #c62828;
  color: #fff;
}

.btn-match-find {
  border-color: #1565c0;
  background: #e3f2fd;
  color: #0d47a1;
}

.btn-match-find:hover:not(:disabled) {
  background: #1565c0;
  color: #fff;
}

.match-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-match-assign {
  color: #0d9488;
  border-color: rgba(13, 148, 136, 0.45);
}

.btn-match-assign:hover:not(:disabled) {
  background: rgba(13, 148, 136, 0.12);
}

.assign-match-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 14px;
}

.btn-match-row {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.btn-match-row:hover:not(:disabled) {
  background: var(--orange);
  color: #fff;
}

.photo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(73, 76, 78, 0.75);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-modal.active {
  display: flex;
}

/* Поверх окна сравнения (тот же .photo-modal z-index 400, но ниже в DOM) */
#rematch-reason-modal {
  z-index: 520;
}

.photo-modal-content {
  background: white;
  max-width: min(98vw, 1920px);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}

.photo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: -24px;
  z-index: 6;
  margin: -24px -24px 8px;
  padding: 24px 24px 10px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #f0f0f0;
  backdrop-filter: blur(6px);
}

.photo-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
}

.photo-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--gray-mid);
  padding: 4px 8px;
  flex-shrink: 0;
}

.photo-modal-hint {
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin-bottom: 20px;
}

.photo-modal-empty {
  margin: 0 0 16px;
  color: var(--gray-mid);
  font-size: 0.95rem;
}

.photo-modal-grid {
  display: block;
}

.photo-hscroll {
  display: flex;
  flex-direction: row;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scroll-snap-type: x proximity;
}

.photo-hcol {
  flex: 0 0 min(210px, 18vw);
  min-width: 180px;
  max-width: 240px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.photo-hcol-ours {
  flex: 0 0 min(210px, 19vw);
  border: 2px solid var(--orange);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--orange-soft);
}

.photo-hcol-rival {
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 8px;
  background: #fafafa;
}

.photo-spec-block--under {
  margin-top: 8px;
  flex: 1 1 auto;
}

.photo-compare-layout {
  --compare-cols: 2;
}

.photo-compare-cards {
  display: grid;
  grid-template-columns: repeat(var(--compare-cols), minmax(180px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scroll-snap-type: x proximity;
}

.photo-compare-col {
  scroll-snap-align: start;
  min-width: 0;
}

.photo-spec-block--matrix {
  margin-top: 0;
}

.photo-specs-matrix {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-spec-row-h {
  display: grid;
  grid-template-columns: repeat(var(--compare-cols), minmax(180px, 1fr));
  gap: 14px;
  min-height: 2.25rem;
  align-items: stretch;
}

.photo-spec-row-h > .photo-spec-cell {
  min-width: 0;
}

.photo-spec-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 5px 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #ececec;
  min-width: 0;
  overflow: hidden;
}

.photo-spec-cell-ours {
  background: #fffaf5;
  border-color: #f0dcc8;
}

.photo-compare-actions {
  display: grid;
  grid-template-columns: repeat(var(--compare-cols), minmax(180px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.photo-action-cell {
  min-width: 0;
}

.photo-add-analog-panel {
  margin-top: 20px;
  padding: 16px 18px;
  background: #f8f9fb;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
}

.photo-add-analog-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
  margin-bottom: 6px;
}

.photo-add-analog-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.45;
}

.photo-add-analog-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.photo-add-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.photo-add-field-grow {
  flex: 1 1 280px;
  min-width: 220px;
}

.photo-add-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.photo-add-brand,
.photo-add-reference {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
}

.photo-add-reference {
  width: 100%;
}

.photo-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.photo-add-analog-done {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--gray-mid);
  text-align: center;
}

.photo-spec-val-ours {
  color: var(--orange-dark);
}

.photo-spec-block {
  margin-top: 12px;
}

.photo-spec-block--compare {
  margin-top: 0;
}

.photo-spec-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
  margin-bottom: 8px;
}

.photo-spec-brief {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-spec-brief li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 5px 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #ececec;
}

.photo-spec-label {
  color: var(--gray-mid);
  flex: 0 1 42%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-spec-val {
  font-weight: 700;
  color: var(--gray);
  text-align: right;
  flex: 1 1 58%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.photo-spec-table th,
.photo-spec-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #ececec;
  text-align: left;
}

.photo-spec-table thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-mid);
  font-weight: 700;
  background: #f7f7f7;
}

.photo-spec-table tbody th {
  font-weight: 600;
  color: var(--gray-mid);
  width: 38%;
}

.photo-spec-ours {
  font-weight: 700;
  color: var(--orange);
  width: 31%;
}

.photo-spec-theirs {
  font-weight: 700;
  color: var(--gray);
  width: 31%;
}

.photo-spec-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray-light);
}

.photo-rival-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-rival-actions .btn-match-ai {
  width: 100%;
  min-width: 0;
}

.btn-match-delete {
  border-color: #757575;
  background: #f5f5f5;
  color: #424242;
}

.btn-match-delete:hover:not(:disabled) {
  background: #616161;
  color: #fff;
}

.rematch-reason-content {
  max-width: 520px;
  margin: 10vh auto;
}

.rematch-reason-textarea {
  width: 100%;
  min-height: 120px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.rematch-reason-textarea:focus {
  outline: 2px solid rgba(255, 81, 0, 0.35);
  border-color: #ff5100;
}

.settings-modal-content {
  max-width: 720px;
  width: min(96vw, 720px);
}

.settings-section-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}

.activity-bell-wrap {
  position: relative;
}

.activity-bell-btn {
  position: relative;
  min-width: 42px;
  padding-left: 10px;
  padding-right: 10px;
}

.activity-bell-icon {
  display: block;
}

.activity-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5100;
  box-shadow: 0 0 0 2px #fff;
}

.activity-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: min(92vw, 380px);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
}

.activity-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.activity-panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.activity-panel-day {
  font-size: 0.78rem;
  color: #6b7280;
}

.activity-block {
  margin-bottom: 14px;
}

.activity-block h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.activity-stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.activity-stats li strong {
  color: #111827;
}

.activity-quiet {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #6b7280;
}

.activity-alert {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.88rem;
}

.activity-events {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.activity-event {
  font-size: 0.82rem;
  line-height: 1.35;
}

.activity-event-meta {
  color: #6b7280;
  font-size: 0.75rem;
}

.activity-event-msg {
  color: #111827;
  word-break: break-word;
}

.activity-brands {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 0.82rem;
  color: #374151;
}

.settings-add-form {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.settings-field {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}

.settings-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}

.settings-list-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.settings-competitors-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.settings-competitor-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
}

.settings-competitor-card h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.settings-competitor-card .settings-site {
  color: #6b7280;
  font-size: 0.82rem;
  word-break: break-all;
}

.settings-competitor-card .settings-meta {
  margin-top: 8px;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.settings-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.settings-status--pending,
.settings-status--running {
  background: #fef3c7;
  color: #92400e;
}

.settings-status--done {
  background: #d1fae5;
  color: #065f46;
}

.settings-status--error {
  background: #fee2e2;
  color: #991b1b;
}

.settings-error {
  margin-top: 8px;
  color: #991b1b;
  font-size: 0.8rem;
}

.cell-multiline-name .multiline-name-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.28;
  white-space: normal;
  word-break: break-word;
}

#comparison-table .tabulator-cell.cell-multiline-ttx,
#comparison-table .tabulator-cell.cell-multiline-summary {
  vertical-align: top;
  white-space: normal;
  line-height: 1.32;
  padding-top: 6px;
  padding-bottom: 6px;
}

.cell-multiline-ttx .multiline-cell-text,
.cell-multiline-summary .multiline-cell-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.32;
  font-size: 0.78rem;
}

.cell-multiline-ttx .multiline-cell-text {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.cell-multiline-summary .multiline-cell-text {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

#comparison-table .tabulator-cell.cell-multiline-name.cell-compare-open:hover {
  background: rgba(255, 81, 0, 0.08) !important;
}

#comparison-table .tabulator-cell.cell-multiline-name.cell-compare-open .multiline-name-text {
  color: var(--patriot-orange, #ff5100);
}

#comparison-table .tabulator-cell.cell-compare-open {
  cursor: pointer;
}

/* Цветовые ячейки (мин. цена): сохраняем красный/зелёный, без оранжевой «бежевой» подложки */
#comparison-table .tabulator-cell.cell-compare-open.price-lower:hover {
  background: #e62e2e !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.14);
}

#comparison-table .tabulator-cell.cell-compare-open.price-higher:hover {
  background: #36a636 !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.14);
}

#comparison-table .tabulator-cell.cell-compare-open:not(.price-lower):not(.price-higher):hover {
  background: rgba(255, 81, 0, 0.08) !important;
}

@media (max-width: 900px) {
  .photo-hcol {
    flex: 0 0 160px;
    min-width: 150px;
  }
}

.photo-card {
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  background: #fafafa;
}

.photo-card-ours {
  border: 2px solid var(--orange);
  background: var(--orange-soft);
}

.photo-card-brand {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-mid);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.photo-card-ours .photo-card-brand {
  color: var(--orange);
}

.photo-card-img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 8px;
}

.photo-card-empty {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-light);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.photo-card-name {
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--gray);
}

.photo-card-battery {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #174f7a;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.photo-card-battery--conflict {
  background: #ffe7e3;
  color: #a62b1f;
  box-shadow: inset 0 0 0 1px #e8a097;
}

.photo-card-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.photo-card-link:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.photo-card-price {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray);
  padding: 4px 8px;
  border-radius: 4px;
}

.photo-card-price-ours {
  color: var(--orange);
}

.photo-card-price.price-lower {
  background: #ff4444;
  color: #fff;
}

.photo-card-price.price-higher {
  background: #44bb44;
  color: #fff;
}

.candidate-card {
  min-width: 300px;
  max-width: 420px;
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  border: 1px solid #ff7a32;
  border-radius: 12px;
  padding: 14px;
  background: #fffaf7;
  box-shadow: 0 5px 18px rgba(146, 62, 18, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(146, 62, 18, 0.12);
}

.candidate-card-actions {
  margin-top: auto;
  padding-top: 14px;
}

.btn-candidate-promote {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(244, 91, 22, 0.22);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.btn-candidate-promote:hover:not(:disabled) {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(244, 91, 22, 0.3);
}

.btn-candidate-promote:focus-visible {
  outline: 3px solid rgba(244, 91, 22, 0.3);
  outline-offset: 2px;
}

.btn-candidate-promote:disabled,
.btn-candidate-promote.is-loading {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.tabulator .tabulator-header {
  background: var(--orange) !important;
  color: white !important;
  border: none !important;
}

.tabulator .tabulator-col {
  background: var(--orange) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.tabulator .tabulator-col-title {
  color: white !important;
  font-weight: 700 !important;
}

.tabulator-row.tabulator-row-even {
  background: var(--orange-soft) !important;
}

.tabulator-row.row-not-found {
  opacity: 0.55;
  font-style: italic;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .header-actions.toolbar {
    width: 100%;
    margin-left: 0;
  }

  .site-header-inner {
    flex-wrap: wrap;
  }
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--orange-soft) 0%, var(--white) 55%);
}

.auth-card {
  width: min(420px, 100%);
  padding: 32px 28px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-logo {
  display: block;
  margin: 0 auto 20px;
}

.auth-card h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.5rem;
}

.auth-subtitle {
  margin: 0 0 24px;
  text-align: center;
  color: var(--gray-mid);
}

.auth-form label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  font: inherit;
}

.auth-error {
  margin: 12px 0 0;
  color: #c62828;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
  margin-top: 20px;
}

.header-user {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-right: 8px;
}

.users-page .users-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.users-table th,
.users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.users-table th {
  font-weight: 700;
  color: var(--gray);
}

.users-actions {
  white-space: nowrap;
}
