:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --text: #17191c;
  --muted: #6f747b;
  --line: #e4e6e9;
  --dark: #17191c;
  --dark-2: #222529;
  --accent: #b8242a;
  --accent-dark: #8f1c21;
  --accent-soft: #f7e9ea;
  --success: #2f7a50;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(18, 21, 25, .08);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { display:block; width: 220px; max-width: 38vw; height: auto; object-fit: contain; flex: 0 0 auto; }
.brand-copy { min-width: 0; }
.brand-name { font-weight: 900; letter-spacing: .03em; font-size: 13px; }
.brand-subtitle { font-size: 12px; color: #aeb3ba; margin-top: 3px; }

.top-actions { display: flex; gap: 8px; align-items: center; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 76px); }

.sidebar {
  background: #1d2024;
  padding: 20px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav { display: grid; gap: 7px; }

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 7px 10px;
  background: transparent;
  color: #b8bdc4;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  min-height: 52px;
}

.nav-item:hover { background: #282c31; color: #fff; transform: translateX(2px); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.nav-icon {
  background: rgba(7,9,12,.35);
}
.nav-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}
.nav-icon--paving img,
.nav-icon--fbs img {
  padding: 4px;
}
.nav-item > span:last-child {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}
.nav-item.active .nav-icon {
  box-shadow: 0 0 0 1px rgba(255,255,255,.28), 0 4px 12px rgba(0,0,0,.24);
}

.sidebar-note {
  background: #25292e;
  border: 1px solid #31363c;
  border-radius: 14px;
  padding: 14px;
}
.sidebar-note-title { font-weight: 800; font-size: 13px; }
.sidebar-note-text { font-size: 12px; line-height: 1.5; color: #aeb3ba; margin-top: 6px; }

.main { padding: 30px; overflow: hidden; }

.page { display: none; }
.page.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-heading {
  display: flex; justify-content: space-between; gap: 20px; align-items: end;
  margin-bottom: 24px;
}
.page-heading.compact { margin-bottom: 18px; }
.page-heading h1 { margin: 5px 0 7px; font-size: 34px; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); max-width: 760px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  font-weight: 900;
  font-size: 11px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.project-strip {
  padding: 18px;
  display: flex;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.project-status {
  min-width: 240px;
  padding: 0 4px 11px;
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #c29325; }
.status-dot.saved { background: var(--success); }

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

.module-card {
  min-height: 170px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: .18s ease;
}
.module-card:hover { transform: translateY(-3px); border-color: #cdd0d4; }
.module-card strong { font-size: 19px; }
.module-card span:last-child { color: var(--muted); line-height: 1.5; font-size: 14px; }
.module-card.accent { background: var(--dark); color: #fff; border-color: var(--dark); }
.module-card.accent span:last-child { color: #bfc4cb; }
.module-kicker { font-weight: 900; color: var(--accent); font-size: 12px; }

.workspace.two-columns {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.right-stack { display: grid; gap: 18px; }

.form-card, .result-card, .plan-card { padding: 20px; }

h2 { margin: 0 0 16px; font-size: 20px; }
h3 { margin: 0; font-size: 14px; }

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

.field { display: flex; flex-direction: column; gap: 7px; }
.field.grow { flex: 1; }
.field label { font-size: 12px; font-weight: 800; color: #555b62; }

input, select {
  width: 100%;
  height: 42px;
  border: 1px solid #d9dce0;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  outline: none;
  transition: .16s ease;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,36,42,.10);
}

.btn {
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--dark); color: #fff; }
.btn-ghost { background: #25292e; color: #d8dce1; border: 1px solid #353a40; }
.btn-ghost:hover { background: #2d3238; color: #fff; }
.btn-ghost-dark { background: #f1f2f4; color: #33373c; }
.btn-small { min-height: 34px; font-size: 12px; padding: 0 11px; }
.btn.full { width: 100%; margin-top: 18px; }

.file-button input { display: none; }

.section-line { height: 1px; background: var(--line); margin: 20px 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.obstacle-list { display: grid; gap: 10px; }
.obstacle-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: var(--panel-2);
}
.obstacle-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, .8fr) auto;
  gap: 8px;
  align-items: end;
}
.obstacle-grid .field label { font-size: 10px; }
.obstacle-remove {
  width: 34px; height: 42px;
  border: 0; border-radius: 9px;
  background: #efe7e7; color: var(--accent);
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
}
.stat-label { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.stat-value { font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.stat.accent .stat-value { color: var(--accent); }

.plan-card { overflow: hidden; }
.plan-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.plan-header h2 { margin-bottom: 5px; }
.plan-header p { margin: 0; color: var(--muted); font-size: 12px; }
.legend { color: var(--muted); font-size: 11px; display: flex; gap: 7px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-main { background: #8b8d91; }
.legend-accent { background: #8f332f; }
.plan-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
#pavingCanvas { cursor: default; touch-action: none; user-select: none; }
#pavingCanvas.is-draggable { cursor: grab; }
#pavingCanvas.is-dragging { cursor: grabbing; }
.obstacle-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,36,42,.08); }
.obstacle-item input.drag-updated { border-color: var(--accent); background: #fff9f9; }


canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 650px;
  background: #f5f6f7;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.hint {
  margin-top: 14px;
  padding: 12px 13px;
  background: #f5f6f7;
  border-radius: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.check-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.check-row label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.check-row input { width: auto; height: auto; }

.result-table { width: 100%; border-collapse: collapse; }
.result-table th, .result-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.result-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.result-table td:last-child, .result-table th:last-child { text-align: right; }
.result-total { margin-top: 14px; font-weight: 900; }

.summary-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.summary-head h2 { margin: 4px 0 0; }
#summaryContent { padding: 20px; }
.summary-section { margin-bottom: 22px; }
.summary-section h3 { margin-bottom: 10px; color: var(--accent); }
.empty-state { color: var(--muted); padding: 18px 0; }

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace.two-columns { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { height: auto; padding: 14px; flex-wrap: wrap; gap: 12px; }
  .top-actions { flex-wrap: wrap; }
  .main { padding: 16px; }
  .module-grid { grid-template-columns: 1fr; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .obstacle-grid { grid-template-columns: 1fr 1fr; }
}

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

  html, body {
    background: #fff !important;
    color: #111 !important;
  }

  .topbar, .sidebar, .btn, .module-grid, .project-strip,
  .sidebar-note, .top-actions { display: none !important; }

  .layout { display: block !important; min-height: 0 !important; }
  .main { padding: 0 !important; overflow: visible !important; }

  /* Печатаем только открытую в данный момент вкладку. */
  .page { display: none !important; }
  .page.active { display: block !important; animation: none !important; }

  .page-heading { margin-bottom: 5mm !important; }
  .page-heading h1 { font-size: 22pt !important; }
  .page-heading p { color: #555 !important; }

  .card {
    box-shadow: none !important;
    border: 1px solid #d8d8d8 !important;
    break-inside: avoid;
  }

  .workspace.two-columns {
    grid-template-columns: 38% 62% !important;
    gap: 5mm !important;
    align-items: start !important;
  }

  .right-stack { gap: 5mm !important; }
  .form-card, .result-card, .plan-card { padding: 4mm !important; }

  input, select {
    border: 1px solid #bfc2c6 !important;
    background: #fff !important;
    color: #111 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  canvas {
    max-width: 100% !important;
    max-height: 145mm !important;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .stat, .hint, .slab-alert, .result-table,
  .legend, .obstacle-item {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .summary-head .btn { display: none !important; }
}

/* v3 — формы участка */
.shape-type-field { margin-bottom: 14px; }
.shape-controls {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fa;
}
.shape-controls.hidden { display: none; }
.shape-controls-title { font-size: 12px; font-weight: 900; margin-bottom: 11px; color: #383d43; }
.full-span { grid-column: 1 / -1; }
.polygon-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.polygon-status {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.polygon-status.drawing { color: var(--accent); font-weight: 800; }
#pavingCanvas.polygon-drawing { cursor: crosshair; }

.slab-alert {
  margin: 0 0 14px; padding: 13px 14px; border-radius: 12px;
  background: #fff1f1; border: 1px solid #efc9cb; color: #7f2025;
  font-size: 12px; line-height: 1.55; font-weight: 700;
}
.slab-alert > div + div { margin-top: 6px; }
.slab-ok {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: #edf7f1; border: 1px solid #cde6d6; color: #2f6b48;
  font-size: 12px; line-height: 1.5; font-weight: 700;
}
.table-sub { color: var(--muted); font-size: 11px; }
.slab-result-table { margin-top: 14px; }
.slab-stats { margin-bottom: 6px; }


/* V6 — NOVABLOC Paving Studio */
.paving-workspace { grid-template-columns: minmax(390px, 470px) minmax(0, 1fr) !important; }

.reserve-badge {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}
.micro-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 10px !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
}
.micro-check input { width: auto; height: auto; }

.pattern-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}
.pattern-heading h3 { font-size: 15px; }
.pattern-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pattern-selected-label {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.pattern-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
}
.pattern-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.pattern-card:hover {
  transform: translateY(-2px);
  border-color: #c4c8cd;
  box-shadow: 0 8px 20px rgba(18,21,25,.08);
}
.pattern-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,36,42,.09);
}
.pattern-card.active::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.pattern-card:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.pattern-preview {
  width: 100%;
  height: 68px;
  max-height: none;
  border: 0;
  border-radius: 8px;
  background: #f0f1f2;
  margin-bottom: 7px;
}
.pattern-name { display: block; font-size: 12px; font-weight: 900; color: var(--text); }
.pattern-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.pattern-format-note {
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px dashed #d6dade;
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.pattern-format-note.hidden { display: none; }

.frame-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fafafa, #f5f6f7);
}
.frame-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.frame-switch > input { display: none; }
.frame-switch-ui {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cfd3d7;
  position: relative;
  transition: .18s ease;
  flex: 0 0 auto;
}
.frame-switch-ui::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: .18s ease;
}
.frame-switch > input:checked + .frame-switch-ui { background: var(--accent); }
.frame-switch > input:checked + .frame-switch-ui::after { transform: translateX(16px); }
.frame-switch strong { display: block; font-size: 12px; }
.frame-switch small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.frame-options {
  margin-top: 12px;
  opacity: .45;
  pointer-events: none;
  transition: .18s ease;
}
.frame-panel.enabled .frame-options { opacity: 1; pointer-events: auto; }

.premium-plan {
  background:
    radial-gradient(circle at 20% 0%, rgba(184,36,42,.035), transparent 33%),
    #fff;
}
.premium-plan canvas {
  background: #eef0f2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}
.legend-frame { background: #3d3f42; }
.plan-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}
.stat.pattern-stat .stat-value { font-size: 14px; }

@media (max-width: 1180px) {
  .paving-workspace { grid-template-columns: 1fr !important; }
}

@media (max-width: 560px) {
  .pattern-gallery { grid-template-columns: 1fr; }
  .pattern-heading, .plan-footer { align-items: start; flex-direction: column; }
}

@media print {
  .pattern-gallery { grid-template-columns: repeat(4, 1fr) !important; gap: 2mm !important; }
  .pattern-card { min-height: 26mm !important; padding: 1.5mm !important; box-shadow: none !important; }
  .pattern-preview { height: 14mm !important; }
  .pattern-card:not(.active) { display: none !important; }
  .pattern-card.active { grid-column: 1 / span 2; }
  .frame-panel { break-inside: avoid; }
}

/* ===== V7: premium wall blocks calculator ===== */
.blocks-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .85fr);
  gap: 18px;
  align-items: start;
}

.blocks-form-card,
.blocks-result-card { padding: 22px; }

.blocks-form-header,
.blocks-result-head,
.blocks-result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.blocks-form-header { margin-bottom: 18px; }
.blocks-form-header h2,
.blocks-result-head h2 { margin-bottom: 5px; }
.blocks-form-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.blocks-badge,
.result-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(184,36,42,.16);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
}
.result-pill.neutral {
  background: #f0f2f4;
  color: #555b62;
  border-color: #dfe2e5;
}

.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.span-2 { grid-column: span 2; }
.blocks-main-grid { margin-bottom: 18px; }

.blocks-toggle-list { display: grid; gap: 12px; }
.blocks-toggle-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfbfc, #f6f7f8);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.blocks-toggle-panel.expanded {
  border-color: rgba(184,36,42,.32);
  box-shadow: 0 7px 20px rgba(18,21,25,.055);
  background: #fff;
}
.blocks-toggle-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  cursor: pointer;
  user-select: none;
}
.blocks-toggle-head > input { display: none; }
.blocks-toggle-head strong { display: block; font-size: 13px; }
.blocks-toggle-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.blocks-check-ui {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  border: 1px solid #cfd3d7;
  background: #fff;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  transition: .18s ease;
  flex: 0 0 auto;
}
.blocks-toggle-head > input:checked + .blocks-check-ui {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.blocks-collapsible {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .28s ease, opacity .22s ease;
}
.blocks-toggle-panel.expanded .blocks-collapsible {
  grid-template-rows: 1fr;
  opacity: 1;
}
.blocks-collapsible-inner {
  min-height: 0;
  overflow: hidden;
  border-top: 0 solid var(--line);
  padding: 0 15px;
  transition: padding .28s ease, border-top-width .28s ease;
}
.blocks-toggle-panel.expanded .blocks-collapsible-inner {
  padding: 15px;
  border-top-width: 1px;
}
.subsection-label {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.doors-label { margin-top: 15px; }
.partition-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 13px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f2f3f5;
}
.partition-info strong { font-size: 12px; }
.partition-info span { color: var(--muted); font-size: 10px; }
.compact-grid { max-width: 520px; }

.blocks-fixed-note {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--dark);
  color: #fff;
}
.blocks-fixed-note strong { font-size: 11px; white-space: nowrap; color: #fff; }
.blocks-fixed-note span { font-size: 10px; color: #bfc4cb; line-height: 1.45; }
.blocks-calc-button { margin-top: 14px !important; min-height: 46px; }

.blocks-result-card { position: sticky; top: 94px; }
.blocks-result-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.blocks-results { display: grid; gap: 18px; margin-top: 17px; }
.blocks-result-section { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.blocks-result-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.blocks-result-title-row { align-items: center; margin-bottom: 11px; }
.blocks-result-title-row h3 { font-size: 13px; }
.blocks-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.blocks-stat-grid .stat-value { font-size: 16px; }
.primary-result-section {
  padding: 15px;
  border: 1px solid rgba(184,36,42,.16) !important;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fffafa);
}
.blocks-big-result { display: grid; gap: 7px; }
.blocks-big-result > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 11px;
  border-radius: 10px;
  background: #f7f8f9;
}
.blocks-big-result span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.blocks-big-result strong { font-size: 17px; white-space: nowrap; }
.blocks-big-result > div:first-child {
  background: var(--accent);
  color: #fff;
}
.blocks-big-result > div:first-child span { color: #f9dfe0; }
.blocks-big-result > div:first-child strong { color: #fff; }
.compact-result-table { margin-top: 10px; }
.result-note {
  padding: 10px 11px;
  border-radius: 10px;
  background: #f4f5f6;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.warning-note {
  margin-top: 10px;
  background: #fff5e8;
  color: #805c22;
  border: 1px solid #f0dbb9;
}

@media (max-width: 1250px) {
  .blocks-workspace { grid-template-columns: 1fr; }
  .blocks-result-card { position: static; }
}
@media (max-width: 900px) {
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .form-grid.cols-4,
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .blocks-form-header,
  .blocks-result-head,
  .blocks-result-title-row { flex-direction: column; align-items: stretch; }
  .blocks-stat-grid { grid-template-columns: 1fr; }
}

@media print {
  #page-blocks .blocks-workspace { display: block !important; }
  #page-blocks .blocks-form-card,
  #page-blocks .blocks-result-card { box-shadow: none !important; margin-bottom: 5mm !important; }
  #page-blocks .blocks-result-card { position: static !important; }
  #page-blocks .blocks-toggle-panel:not(.expanded) { display: none !important; }
  #page-blocks .blocks-collapsible { grid-template-rows: 1fr !important; opacity: 1 !important; }
  #page-blocks .blocks-collapsible-inner { padding: 3mm !important; border-top-width: 1px !important; }
  #page-blocks .blocks-calc-button { display: none !important; }
}

/* V7 requirement: wall-block calculator uses the full content width; result stays below the form. */
.blocks-workspace {
  grid-template-columns: minmax(0, 1fr) !important;
}
.blocks-result-card {
  position: static !important;
  top: auto !important;
}
.blocks-result-card .blocks-stat-grid {
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width: 900px) {
  .blocks-result-card .blocks-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .blocks-result-card .blocks-stat-grid { grid-template-columns: 1fr; }
}

.legend i { border: 1px solid rgba(0,0,0,.18); }
canvas.is-draggable { cursor: grab; }
canvas.is-dragging { cursor: grabbing; }
.obstacle-item.selected { outline: 2px solid rgba(184,36,42,.45); }

.collapsible-card .card-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.collapsible-card .card-collapse-header h2 { margin: 0; }
.collapse-toggle {
  border: 1px solid var(--line);
  background: #f7f8fa;
  color: var(--text);
  min-height: 38px;
  border-radius: 10px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.collapse-toggle:hover { background: #eef0f3; }
.collapse-arrow { font-size: 16px; line-height: 1; transition: transform .18s ease; }
.collapsible-card.collapsed .collapse-arrow { transform: rotate(-90deg); }
.collapsible-card.collapsed .collapse-label::after { content: ' параметры'; }
.card-collapse-body { transition: opacity .18s ease, transform .18s ease; }
.collapsible-card.collapsed .card-collapse-body {
  display: none;
}
@media print {
  .collapsible-card.collapsed { padding-bottom: 16px; }
}

/* ===== V8.5: корректная печать Paving Studio на A4 ===== */
@media print {
  /* Устраняем переполнение 38% + 62% + gap на A4. */
  #page-paving .paving-workspace {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Если параметры были свернуты пользователем — на бумагу их не выводим. */
  #page-paving #pavingParamsCard.collapsed {
    display: none !important;
  }

  /* Если параметры раскрыты, печатаем их отдельным полным блоком. */
  #page-paving #pavingParamsCard:not(.collapsed) {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 5mm 0 !important;
  }

  #page-paving .right-stack,
  #page-paving .result-card,
  #page-paving .plan-card,
  #page-paving .premium-plan {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #page-paving .right-stack {
    display: block !important;
  }

  #page-paving .result-card {
    margin: 0 0 5mm 0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  #page-paving .plan-card {
    margin: 0 !important;
    overflow: visible !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  #page-paving .plan-header,
  #page-paving .plan-footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #page-paving #pavingCanvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 128mm !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
  }

  /* Статистика не должна расширять карточку за ширину листа. */
  #page-paving .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  #page-paving .stat {
    min-width: 0 !important;
  }
}

/* V8.6 — экспорт PDF/JPG/PNG */
.export-menu-wrap { position: relative; }
.export-menu-button { min-width: 105px; }
.export-caret { font-size: 11px; opacity: .8; }
.export-format-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 270px;
  padding: 7px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e1e4e8;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  z-index: 100;
}
.export-format-menu.open { display: grid; gap: 4px; }
.export-format-menu button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  color: #17191c;
  display: grid;
  gap: 3px;
}
.export-format-menu button:hover { background: #f3f4f6; }
.export-format-menu strong { font-size: 13px; }
.export-format-menu span { color: #737980; font-size: 11px; line-height: 1.35; }

@media (max-width: 900px) { .brand-logo { width: 170px; max-width: 46vw; } .brand-copy { display:none; } }
@media print { .brand-logo { width: 190px !important; max-width:none !important; } }

/* V8.8: safe compact corporate logo */
.topbar { overflow: visible; }
.brand { height: 58px; display:flex; align-items:center; gap:12px; min-width:0; }
.brand-logo { height: 46px !important; width:auto !important; max-width: 165px !important; object-fit:contain !important; display:block; border-radius:6px; flex:0 0 auto; }
.brand-copy { min-width:0; }
.brand-name { white-space:nowrap; font-size:12px; }
.novabloc-toast { position:fixed; right:22px; bottom:22px; z-index:99999; background:#17191c; color:#fff; padding:13px 17px; border-radius:12px; box-shadow:0 12px 35px rgba(0,0,0,.22); font-weight:700; font-size:13px; opacity:0; transform:translateY(10px); transition:.2s ease; pointer-events:none; }
.novabloc-toast.show { opacity:1; transform:none; }
.novabloc-toast.success { border-left:4px solid #2f7a50; }
.novabloc-toast.error { border-left:4px solid #b8242a; }
@media (max-width:900px) { .brand-logo { height:40px !important; max-width:145px !important; } .brand-copy { display:none; } }

/* Logistics module */
.logistics-layout { display:grid; grid-template-columns:minmax(430px, 520px) minmax(0,1fr); gap:18px; align-items:start; }
.logistics-left,.logistics-right { display:grid; gap:18px; min-width:0; }
.logistics-goal-badge { font-size:11px; font-weight:900; color:var(--accent); background:var(--accent-soft); border-radius:999px; padding:7px 10px; }
.vehicle-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.vehicle-choice { position:relative; border:1px solid var(--line); border-radius:13px; padding:13px; background:#f8f9fa; display:flex; flex-direction:column; gap:6px; cursor:pointer; min-height:92px; }
.vehicle-choice input { position:absolute; opacity:0; pointer-events:none; }
.vehicle-choice strong { font-size:13px; }
.vehicle-choice span { font-size:11px; color:var(--muted); line-height:1.4; }
.vehicle-choice.active { border-color:var(--accent); box-shadow:0 0 0 2px rgba(184,36,42,.10); background:#fff; }
.vehicle-choice.active::after { content:'✓'; position:absolute; right:10px; top:8px; color:var(--accent); font-weight:900; }
.vehicle-readout { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.vehicle-readout > div { border:1px solid var(--line); background:#fff; border-radius:11px; padding:11px; }
.vehicle-readout span { display:block; font-size:10px; color:var(--muted); margin-bottom:5px; }
.vehicle-readout strong { font-size:14px; }
.custom-vehicle-fields { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.form-grid.cols-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.logistics-order-heading p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.stacking-control { display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:14px; align-items:center; padding:13px; border:1px solid var(--line); border-radius:13px; background:#f8f9fa; margin-bottom:12px; }
.stack-height-field.disabled { opacity:.45; }
.logistics-note { padding:11px 13px; border-radius:11px; background:#f7eeee; color:#6d292c; font-size:12px; line-height:1.5; margin-bottom:14px; }
.logistics-product-group { margin-top:14px; }
.logistics-product-group-title { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:900; margin:0 0 7px; }
.logistics-table { width:100%; border-collapse:separate; border-spacing:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.logistics-table th,.logistics-table td { padding:8px 9px; border-bottom:1px solid var(--line); font-size:12px; text-align:left; vertical-align:middle; }
.logistics-table tr:last-child td { border-bottom:0; }
.logistics-table th { background:#f4f5f6; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }
.logistics-table td:nth-child(2),.logistics-table th:nth-child(2) { width:92px; }
.logistics-table td:nth-child(3),.logistics-table th:nth-child(3) { width:84px; text-align:center; }
.logistics-table input[type=number] { height:34px; border-radius:8px; text-align:center; padding:0 6px; }
.logistics-table input[type=checkbox] { width:16px; height:16px; }
.logistics-table .stack-disabled { opacity:.25; pointer-events:none; }
.product-sub { display:block; color:var(--muted); font-size:10px; margin-top:2px; }
.logistics-calc-btn { min-height:48px; }
.calculated-weight-note { font-size:10px; color:var(--muted); }
.logistics-stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
.logistics-warning { display:none; margin-top:12px; padding:11px 13px; border-radius:10px; background:#fff4dd; color:#755515; font-size:12px; line-height:1.5; }
.logistics-warning.show { display:block; }
.trip-tabs { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:12px; }
.trip-tab { border:1px solid var(--line); background:#f3f4f6; min-height:34px; border-radius:9px; padding:0 11px; font-weight:800; font-size:11px; }
.trip-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }
#logisticsCanvas { min-height:260px; max-height:none; }
.trip-manifest { margin-top:14px; }
.trip-manifest-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.trip-manifest-item { padding:10px 11px; border:1px solid var(--line); background:#f8f9fa; border-radius:10px; font-size:12px; display:flex; justify-content:space-between; gap:10px; }
.trip-manifest-item strong { white-space:nowrap; }
.logistics-reference-card { padding:20px; }
.logistics-reference-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.logistics-reference-grid > div { border:1px solid var(--line); border-radius:11px; padding:12px; display:flex; gap:10px; align-items:flex-start; font-size:12px; color:var(--muted); line-height:1.45; }
.logistics-reference-grid strong { color:var(--accent); font-size:16px; }

@media (max-width: 1180px) {
  .logistics-layout { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .vehicle-choice-grid,.vehicle-readout,.form-grid.cols-3,.logistics-reference-grid { grid-template-columns:1fr; }
  .stacking-control { grid-template-columns:1fr; }
  .logistics-stats,.trip-manifest-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media print {
  #page-logistics .logistics-left { display:none !important; }
  #page-logistics .logistics-layout { display:block !important; }
  #page-logistics .logistics-right { display:block !important; }
  #page-logistics .logistics-reference-card { display:none !important; }
  #page-logistics .trip-tabs { display:none !important; }
}

.custom-vehicle-fields.hidden { display:none !important; }
.logistics-order-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.logistics-order-card.collapsed .logistics-order-heading { margin-bottom:0; }

.auto-stack-badge { display:inline-flex; align-items:center; justify-content:center; min-width:42px; padding:4px 7px; border-radius:999px; background:#eef0f2; color:#555b62; font-size:10px; font-weight:900; }
.stack-not-available { color:#a9adb2; font-weight:800; }

/* ===== FBS logistics ===== */
.fbs-log-layout { display:grid; grid-template-columns:minmax(360px, 470px) minmax(0,1fr); gap:18px; align-items:start; }
.fbs-log-left, .fbs-log-right { display:grid; gap:18px; }
.fbs-vehicle-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.fbs-vehicle-readout { grid-template-columns:repeat(4,minmax(0,1fr)); }
.fbs-gap-field { margin-top:16px; }
.fbs-gap-field small { color:var(--muted); line-height:1.45; }
.fbs-log-order-card .card-collapse-body { padding-top:2px; }
.fbs-log-product-group { margin-top:14px; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.fbs-log-product-group-title { padding:10px 12px; background:#f4f5f7; font-size:12px; font-weight:900; letter-spacing:.04em; text-transform:uppercase; color:#555b62; }
.fbs-log-table { width:100%; border-collapse:collapse; }
.fbs-log-table th, .fbs-log-table td { border-top:1px solid var(--line); padding:9px 10px; text-align:left; vertical-align:middle; }
.fbs-log-table th { font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); background:#fbfbfc; }
.fbs-log-table td { font-size:12px; }
.fbs-log-table .fbs-dim { color:var(--muted); font-size:11px; display:block; margin-top:2px; }
.fbs-log-table input { height:36px; min-width:72px; }
.fbs-log-plan-card canvas { min-height:300px; }
.fbs-layer-legend { display:flex; gap:12px; flex-wrap:wrap; color:var(--muted); font-size:11px; }
.fbs-layer-legend span { display:inline-flex; align-items:center; gap:6px; }
.fbs-layer-legend i { width:14px; height:10px; border-radius:2px; border:1px solid #444; display:inline-block; }
.fbs-layer-legend .lower { background:#d8dadd; }
.fbs-layer-legend .upper { background:#f2d7d8; border-style:dashed; }

@media (max-width:1180px) {
  .fbs-log-layout { grid-template-columns:1fr; }
  .fbs-vehicle-grid { grid-template-columns:1fr 1fr 1fr; }
}
@media (max-width:820px) {
  .fbs-vehicle-grid, .fbs-vehicle-readout { grid-template-columns:1fr; }
}
@media print {
  #page-fbs-logistics .fbs-log-left { display:none !important; }
  #page-fbs-logistics .fbs-log-layout { display:block !important; }
  #page-fbs-logistics .fbs-log-right { display:block !important; }
  #page-fbs-logistics .fbs-log-right > .card { margin-bottom:12mm !important; }
  #page-fbs-logistics canvas { width:100% !important; height:auto !important; max-height:none !important; }
}


/* V10.1 — читаемая визуализация ярусов ФБС */
#fbsLogTripTabs .trip-tab { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.fbs-trip-checks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.fbs-trip-checks > div { border:1px solid var(--line); background:#f8f9fa; border-radius:10px; padding:10px 12px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.fbs-trip-checks span { color:var(--muted); font-size:11px; }
.fbs-trip-checks strong { font-size:12px; white-space:nowrap; }
@media (max-width:760px){ .fbs-trip-checks{grid-template-columns:1fr;} }

/* ===== V11: compact project/order/client metadata ===== */
.calc-meta-line {
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(130px,.55fr) minmax(220px,1.25fr);
  gap:10px;
  margin-bottom:12px;
  max-width:900px;
}
.calc-meta-field {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:5px 9px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.calc-meta-field span {
  color:var(--accent);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  white-space:nowrap;
}
.calc-meta-field input {
  height:28px;
  padding:0 4px;
  border:0;
  border-radius:0;
  box-shadow:none !important;
  background:transparent;
  font-size:12px;
  font-weight:700;
  min-width:0;
}
.calc-meta-field input:focus { outline:none; }
@media (max-width:900px) {
  .calc-meta-line { grid-template-columns:1fr; }
}
@media print {
  .calc-meta-line { grid-template-columns:1fr 1fr 1fr !important; gap:3mm !important; max-width:none !important; }
  .calc-meta-field { min-height:9mm !important; padding:1.5mm 2mm !important; border-color:#cfd2d5 !important; }
  .calc-meta-field input { font-size:9pt !important; color:#111 !important; }
  .calc-meta-field span { font-size:7pt !important; }
}

/* ===== V12: compact one-page print layouts ===== */
.print-only { display: none; }

@media print {
  @page { size: A4 portrait; margin: 6mm; }

  .print-only { display: block !important; }
  html, body { width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .page.active {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    zoom: .88;
  }

  .page-heading { margin: 0 0 2.2mm !important; }
  .page-heading.compact { margin-bottom: 2.2mm !important; }
  .page-heading h1 { font-size: 18pt !important; line-height: 1.05 !important; margin: 1.2mm 0 1mm !important; }
  .page-heading p { font-size: 8.3pt !important; line-height: 1.25 !important; margin: 0 !important; }
  .eyebrow { font-size: 6.8pt !important; }

  .calc-meta-line {
    grid-template-columns: 1fr .72fr 1.15fr !important;
    gap: 2mm !important;
    margin: 0 0 2mm !important;
  }
  .calc-meta-field {
    min-height: 7mm !important;
    padding: .8mm 1.5mm !important;
    border-radius: 2mm !important;
  }
  .calc-meta-field span { font-size: 6pt !important; }
  .calc-meta-field input { height: 5mm !important; font-size: 8pt !important; }

  .print-param-summary {
    border: 1px solid #d8dadd;
    border-radius: 2.5mm;
    padding: 2mm 2.5mm;
    margin: 0 0 2.5mm;
    background: #fafafa !important;
    break-inside: avoid;
  }
  .print-param-title {
    color: #b8242a;
    font-size: 6.5pt;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 1.3mm;
  }
  .print-param-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 1.3mm 2mm;
  }
  .print-param-item { min-width: 0; }
  .print-param-item span {
    display: block;
    color: #777;
    font-size: 5.7pt;
    line-height: 1.1;
    margin-bottom: .5mm;
  }
  .print-param-item strong {
    display: block;
    color: #111;
    font-size: 7.2pt;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .print-param-wide { grid-column: span 2; }

  /* На печати вместо громоздких форм показываем компактную сводку исходных данных. */
  #page-paving > .paving-workspace > #pavingParamsCard,
  #page-piles .workspace > .form-card,
  #page-fbs .workspace > .form-card,
  #page-slabs .workspace > .form-card,
  #page-blocks .blocks-form-card {
    display: none !important;
  }

  #page-paving .paving-workspace,
  #page-piles .workspace.two-columns,
  #page-fbs .workspace.two-columns,
  #page-slabs .workspace.two-columns,
  #page-blocks .blocks-workspace {
    display: block !important;
    width: 100% !important;
  }

  .right-stack { display: block !important; }
  .right-stack > .card { margin: 0 0 2.5mm !important; }
  .card { break-inside: auto !important; box-shadow: none !important; }
  .result-card, .plan-card { padding: 2.5mm !important; }
  .result-card h2, .plan-card h2 { font-size: 12pt !important; margin-bottom: 1.5mm !important; }
  .section-title-row { margin-bottom: 1.5mm !important; }

  .stats-grid,
  .blocks-stat-grid,
  .logistics-stats {
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
    gap: 1.5mm !important;
  }
  .stat, .blocks-stat {
    padding: 2mm !important;
    min-height: 0 !important;
    border-radius: 2mm !important;
  }
  .stat-label, .blocks-stat-label { font-size: 6pt !important; margin-bottom: .8mm !important; }
  .stat-value, .blocks-stat-value { font-size: 10pt !important; line-height: 1.05 !important; }

  .plan-header { margin-bottom: 1.5mm !important; }
  .plan-header p { font-size: 6.5pt !important; }
  .legend { font-size: 6pt !important; }
  .plan-footer { margin-top: 1mm !important; font-size: 6pt !important; }

  #page-paving canvas { max-height: 91mm !important; width: 100% !important; height: auto !important; }
  #page-piles canvas,
  #page-fbs canvas,
  #page-slabs canvas { max-height: 96mm !important; width: 100% !important; height: auto !important; }
  #page-paving .premium-plan,
  #page-piles .plan-card,
  #page-fbs .plan-card,
  #page-slabs .plan-card { break-inside: avoid !important; }

  /* Блоки 390: только компактный результат после строки исходных данных. */
  #page-blocks .blocks-result-card { margin: 0 !important; padding: 3mm !important; }
  #page-blocks .blocks-result-card .blocks-stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
  #page-blocks .blocks-result-section { margin-top: 2mm !important; }
  #page-blocks table { font-size: 7pt !important; }

  /* Логистика: формы заказа не печатаем, только итог выбранного рейса. */
  #page-logistics .logistics-layout,
  #page-fbs-logistics .fbs-log-layout { display: block !important; }
  #page-logistics .logistics-right,
  #page-fbs-logistics .fbs-log-right { display: block !important; }
  #page-logistics .logistics-right > .card,
  #page-fbs-logistics .fbs-log-right > .card { margin: 0 0 2.5mm !important; }
  #page-logistics .logistics-result-card,
  #page-fbs-logistics .result-card { padding: 2.5mm !important; }
  #page-logistics .logistics-plan-card,
  #page-fbs-logistics .fbs-log-plan-card { padding: 2.5mm !important; break-inside: auto !important; }
  #page-logistics canvas { max-height: 78mm !important; width: 100% !important; height: auto !important; }
  #page-fbs-logistics canvas { max-height: 72mm !important; width: 100% !important; height: auto !important; }
  #page-logistics .trip-manifest,
  #page-fbs-logistics .trip-manifest { font-size: 7pt !important; line-height: 1.2 !important; }
  #page-logistics .trip-manifest-grid { grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 1.5mm !important; }
  #page-logistics .logistics-warning,
  #page-fbs-logistics .logistics-warning { margin: 1.5mm 0 !important; padding: 1.5mm !important; font-size: 6.5pt !important; }
  #page-fbs-logistics .fbs-trip-checks { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 1.5mm !important; margin: 1.5mm 0 !important; }
  #page-fbs-logistics .fbs-trip-checks > div { padding: 1.5mm 2mm !important; }

  /* Для самых насыщенных страниц даём чуть больше запаса по высоте. */
  #page-paving.page.active { zoom: .82; }
  #page-blocks.page.active { zoom: .84; }
  #page-logistics.page.active,
  #page-fbs-logistics.page.active { zoom: .80; }
}
@media print {
  #page-fbs-logistics .logistics-reference-card,
  #page-logistics .logistics-reference-card,
  #page-fbs-logistics .trip-tabs,
  #page-logistics .trip-tabs { display:none !important; }
}

/* V13.3 header logo + menu icon sizing fixes */
.brand-logo { height: 54px !important; width: 54px !important; max-width: 54px !important; object-fit: contain !important; border-radius: 12px !important; }
@media (max-width:900px) { .brand-logo { height: 44px !important; width: 44px !important; max-width:44px !important; } }
.nav-icon img { object-fit: contain !important; padding: 3px !important; }
.nav-icon--paving img { padding: 7px !important; }
.nav-icon--fbs img { padding: 6px !important; }

/* V13.4: cleaned PNG white margins; all menu icons use same optical sizing */
.nav-icon img { object-fit: contain !important; padding: 2px !important; }
.nav-icon--paving img, .nav-icon--fbs img { padding: 2px !important; }


/* ===== V13.7: TTN document module ===== */
.ttn-stage-note {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #d9dcdf;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #fff;
  color: #4f555c;
  font-size: 13px;
  line-height: 1.45;
}
.ttn-preview {
  display: grid;
  gap: 24px;
  justify-items: center;
  padding: 24px;
  border-radius: 16px;
  background: #25292e;
  border: 1px solid #34393f;
}
.ttn-sheet {
  width: min(100%, 210mm);
  margin: 0;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.34);
}
.ttn-sheet figcaption {
  padding: 9px 12px;
  border-bottom: 1px solid #d7dadd;
  color: #555b62;
  background: #f4f5f6;
  font-size: 12px;
  font-weight: 800;
}
.ttn-sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
body.ttn-mode .export-menu-wrap { display: none; }

@media (max-width: 820px) {
  .ttn-stage-note { display: block; }
  .ttn-stage-note > div + div { margin-top: 7px; }
  .ttn-preview { padding: 10px; gap: 14px; }
}

@page ttn { size: A4 portrait; margin: 0; }
@media print {
  #page-ttn.page.active {
    zoom: 1 !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #page-ttn .ttn-screen-heading,
  #page-ttn .ttn-stage-note,
  #page-ttn .ttn-sheet figcaption { display: none !important; }
  #page-ttn .ttn-preview {
    display: block !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  #page-ttn .ttn-sheet {
    page: ttn;
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    break-after: page !important;
    page-break-after: always !important;
    overflow: hidden !important;
  }
  #page-ttn .ttn-sheet:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
  #page-ttn .ttn-sheet img {
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    object-fit: fill !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

/* ===== V13.8: TTN editor ===== */
.ttn-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.ttn-editor {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #d9dcdf;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.ttn-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 3px 10px;
}
.ttn-editor-head h2 { margin: 2px 0 0; font-size: 20px; }
.ttn-editor-group {
  border: 1px solid #e0e2e5;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfb;
}
.ttn-editor-group + .ttn-editor-group { margin-top: 9px; }
.ttn-editor-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 12px;
  background: #f3f4f5;
  color: #24282d;
  font-size: 13px;
  font-weight: 900;
  user-select: none;
}
.ttn-editor-group > summary::-webkit-details-marker { display: none; }
.ttn-editor-group > summary::after {
  content: "▾";
  float: right;
  color: #777d84;
  transition: transform .15s ease;
}
.ttn-editor-group:not([open]) > summary::after { transform: rotate(-90deg); }
.ttn-fields {
  display: grid;
  gap: 10px;
  padding: 11px;
}
.ttn-fields-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.ttn-fields.nested {
  padding: 0;
  margin: 0;
}
.ttn-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.ttn-fields label > span {
  color: #5b6168;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}
.ttn-fields input,
.ttn-fields textarea {
  width: 100%;
  border: 1px solid #cfd3d7;
  border-radius: 9px;
  background: #fff;
  color: #171a1e;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: vertical;
  outline: none;
}
.ttn-fields input:focus,
.ttn-fields textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,36,45,.10);
}
.ttn-paper {
  position: relative;
  width: 100%;
  aspect-ratio: 1820 / 2573;
  overflow: hidden;
  background: #fff;
}
.ttn-paper > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.ttn-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.ttn-overlay text {
  fill: #050505;
  font-family: Arial, Helvetica, sans-serif;
  text-rendering: geometricPrecision;
}
.ttn-overlay rect.ttn-mask { fill: #fff; }
.ttn-preview {
  min-width: 0;
}
@media (max-width: 1180px) {
  .ttn-workspace { grid-template-columns: 1fr; }
  .ttn-editor { position: static; max-height: none; }
}
@media (max-width: 620px) {
  .ttn-fields-2 { grid-template-columns: 1fr; }
}
@media print {
  #page-ttn .ttn-editor { display: none !important; }
  #page-ttn .ttn-workspace { display: block !important; }
  #page-ttn .ttn-paper {
    position: relative !important;
    width: 210mm !important;
    height: 297mm !important;
    aspect-ratio: auto !important;
  }
  #page-ttn .ttn-paper > img,
  #page-ttn .ttn-overlay {
    position: absolute !important;
    inset: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
  }
}

/* ===== V13.12: price-list editor ===== */
body.price-mode .export-menu-wrap { display: none; }
.price-stage-note {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  margin: 0 0 16px;
  border: 1px solid #d9dcdf;
  border-radius: 12px;
  background: #fff;
  color: #5d636a;
  font-size: 12px;
}
.price-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.price-editor {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #d9dcdf;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.price-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 3px 10px;
}
.price-editor-head h2 { margin: 2px 0 0; font-size: 20px; }
.price-clear-btn { padding: 7px 9px; font-size: 11px; }
.price-editor-group {
  border: 1px solid #e0e2e5;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfb;
}
.price-editor-group + .price-editor-group { margin-top: 9px; }
.price-editor-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 12px;
  background: #f3f4f5;
  color: #24282d;
  font-size: 13px;
  font-weight: 900;
  user-select: none;
}
.price-editor-group > summary::-webkit-details-marker { display:none; }
.price-editor-group > summary::after {
  content: "▾";
  float: right;
  color: #777d84;
  transition: transform .15s ease;
}
.price-editor-group:not([open]) > summary::after { transform: rotate(-90deg); }
.price-editor-fields { display: grid; gap: 8px; padding: 10px; }
.price-editor-subtitle {
  padding: 6px 4px 2px;
  font-size: 11px;
  font-weight: 900;
  color: #272b30;
  line-height: 1.3;
}
.price-editor-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 112px;
  gap: 9px;
  align-items: center;
}
.price-editor-row > span {
  color: #555c63;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}
.price-input-wrap { position: relative; }
.price-input-wrap input {
  width: 100%;
  padding: 8px 27px 8px 9px;
  border: 1px solid #cfd3d7;
  border-radius: 8px;
  background: #fff;
  color: #171a1e;
  font: inherit;
  font-size: 12px;
  text-align: right;
  outline: none;
}
.price-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,36,45,.10);
}
.price-input-wrap b {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #83888e;
  font-size: 11px;
  pointer-events: none;
}
.price-preview {
  display: grid;
  gap: 22px;
  justify-items: center;
  min-width: 0;
  padding: 22px;
  border-radius: 16px;
  background: #25292e;
  border: 1px solid #34393f;
}
.price-sheet {
  width: min(100%, 210mm);
  min-height: 297mm;
  box-sizing: border-box;
  padding: 8mm 9mm 7mm;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 14px 34px rgba(0,0,0,.34);
}
.price-doc-header {
  display: grid;
  grid-template-columns: 39mm 1fr;
  gap: 4mm;
  align-items: center;
  padding: 0 0 3.1mm;
  border-bottom: .45mm solid #000;
}
.price-doc-logo { width: 35mm; height: 24mm; object-fit: contain; }
.price-doc-brand { text-align: center; line-height: 1.05; }
.price-doc-kicker { font-size: 8pt; font-weight: 800; letter-spacing: .25mm; }
.price-doc-main-name { margin-top: .7mm; font-size: 23pt; font-weight: 900; letter-spacing: .3mm; }
.price-doc-sub-name { margin-top: -.5mm; font-size: 24pt; font-weight: 1000; font-style: italic; letter-spacing: .4mm; }
.price-doc-legal { margin-top: .8mm; font-size: 8.8pt; font-weight: 800; }
.price-doc-address { margin-top: 1mm; font-size: 7.8pt; }
.price-doc-title { display: grid; justify-items: center; margin: 2.7mm 0 2.5mm; line-height: 1.05; }
.price-doc-title strong { font-size: 22pt; letter-spacing: .3mm; }
.price-doc-title span { margin-top: .8mm; font-size: 9.5pt; font-weight: 700; }
.price-doc-section { break-inside: avoid; margin: 0 0 2.2mm; }
.price-doc-section h3 {
  margin: 0 0 .8mm;
  text-align: center;
  font-size: 10pt;
  line-height: 1.05;
  font-weight: 900;
}
.price-doc-section table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 7.15pt;
  line-height: 1.08;
}
.price-doc-section th,
.price-doc-section td {
  border: .23mm solid #111;
  padding: 1.05mm 1.25mm;
  vertical-align: middle;
}
.price-doc-section th { font-size: 6.8pt; font-weight: 900; text-align: center; }
.price-doc-section th:nth-child(1), .price-doc-section td:nth-child(1) { width: 42%; }
.price-doc-section th:nth-child(2), .price-doc-section td:nth-child(2) { width: 29%; text-align: center; }
.price-doc-section th:nth-child(3), .price-doc-section td:nth-child(3) { width: 12%; text-align: center; }
.price-doc-section th:nth-child(4), .price-doc-section td:nth-child(4) { width: 17%; text-align: right; font-weight: 800; }
.price-group-row td {
  text-align: center !important;
  font-weight: 900 !important;
  font-size: 7pt;
  padding-top: 1.25mm;
  padding-bottom: 1.25mm;
}
.price-doc-page1 .price-doc-wall,
.price-doc-page1 .price-doc-partition { display: inline-block; width: calc(50% - 1.2mm); vertical-align: top; }
.price-doc-page1 .price-doc-wall { margin-right: 1.5mm; }
.price-doc-page1 .price-doc-wall table,
.price-doc-page1 .price-doc-partition table { font-size: 7pt; }
.price-doc-page1 .price-doc-decorative { margin-top: .5mm; }
.price-doc-page1 .price-doc-paving table,
.price-doc-page1 .price-doc-components table,
.price-doc-page1 .price-doc-curbs table { font-size: 6.75pt; }
.price-doc-page1 .price-doc-paving th,
.price-doc-page1 .price-doc-paving td,
.price-doc-page1 .price-doc-components th,
.price-doc-page1 .price-doc-components td,
.price-doc-page1 .price-doc-curbs th,
.price-doc-page1 .price-doc-curbs td { padding-top: .85mm; padding-bottom: .85mm; }
.price-doc-header-compact { grid-template-columns: 31mm 1fr; }
.price-doc-header-compact .price-doc-logo { width: 28mm; height: 19mm; }
.price-doc-header-compact .price-doc-kicker { font-size: 7pt; }
.price-doc-header-compact .price-doc-main-name { font-size: 19pt; }
.price-doc-header-compact .price-doc-sub-name { font-size: 20pt; }
.price-doc-header-compact .price-doc-legal { font-size: 8pt; }
.price-doc-header-compact .price-doc-address { font-size: 7pt; }
.price-sheet[data-price-page="2"] .price-doc-title { margin-top: 2mm; margin-bottom: 2mm; }
.price-sheet[data-price-page="2"] .price-doc-title strong { font-size: 19pt; }
.price-doc-page2 .price-doc-fbs { margin-bottom: 2.7mm; }
.price-doc-page2 .price-doc-fbs table { font-size: 7pt; }
.price-doc-columns { display: grid; grid-template-columns: 1.12fr .88fr; gap: 3.2mm; align-items: start; }
.price-doc-columns .price-doc-section table { font-size: 6.6pt; }
.price-doc-columns .price-doc-section th,
.price-doc-columns .price-doc-section td { padding: .9mm .95mm; }
.price-doc-columns .price-doc-section th:nth-child(1),
.price-doc-columns .price-doc-section td:nth-child(1) { width: 31%; }
.price-doc-columns .price-doc-section th:nth-child(2),
.price-doc-columns .price-doc-section td:nth-child(2) { width: 35%; }
.price-doc-columns .price-doc-section th:nth-child(3),
.price-doc-columns .price-doc-section td:nth-child(3) { width: 13%; }
.price-doc-columns .price-doc-section th:nth-child(4),
.price-doc-columns .price-doc-section td:nth-child(4) { width: 21%; }

@media (max-width: 1180px) {
  .price-workspace { grid-template-columns: 1fr; }
  .price-editor { position: static; max-height: none; }
}
@media (max-width: 620px) {
  .price-editor-row { grid-template-columns: 1fr 105px; }
  .price-preview { padding: 8px; }
}

@media print {
  #page-price.page.active {
    zoom: 1 !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #page-price .price-screen-heading,
  #page-price .price-stage-note,
  #page-price .price-editor { display: none !important; }
  #page-price .price-workspace,
  #page-price .price-preview {
    display: block !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  #page-price .price-sheet {
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 8mm 9mm 7mm !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    break-after: page !important;
    page-break-after: always !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
  #page-price .price-sheet:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}

/* ===== V13.13: price export + wholesale price list ===== */
.price-export-only { display: none !important; }
body.price-mode .standard-export-only,
body.price-opt-mode .standard-export-only { display: none !important; }
body.price-mode .price-export-only,
body.price-opt-mode .price-export-only { display: grid !important; }
body.price-mode .export-menu-wrap,
body.price-opt-mode .export-menu-wrap { display: block !important; }

.price-editor-dual-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 96px;
  gap: 7px;
  align-items: end;
  padding: 0 0 2px;
  color: #555c63;
  font-size: 10px;
  text-align: center;
}
.price-editor-row-dual {
  grid-template-columns: minmax(0, 1fr) 96px 96px;
  gap: 7px;
}
.price-editor-row-dual .price-input-wrap input { padding-left: 7px; padding-right: 23px; }
.price-sheet-opt .price-doc-section th:nth-child(1),
.price-sheet-opt .price-doc-section td:nth-child(1) { width: 36%; }
.price-sheet-opt .price-doc-section th:nth-child(2),
.price-sheet-opt .price-doc-section td:nth-child(2) { width: 25%; text-align: center; }
.price-sheet-opt .price-doc-section th:nth-child(3),
.price-sheet-opt .price-doc-section td:nth-child(3) { width: 10%; text-align: center; }
.price-sheet-opt .price-doc-section th:nth-child(4),
.price-sheet-opt .price-doc-section td:nth-child(4),
.price-sheet-opt .price-doc-section th:nth-child(5),
.price-sheet-opt .price-doc-section td:nth-child(5) { width: 14.5%; text-align: right; font-weight: 800; }
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(1),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(1) { width: 28%; }
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(2),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(2) { width: 27%; }
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(3),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(3) { width: 10%; }
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(4),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(4),
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(5),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(5) { width: 17.5%; }
.price-sheet-opt .price-doc-section table { font-size: 6.7pt; }
.price-sheet-opt .price-doc-section th,
.price-sheet-opt .price-doc-section td { padding-left: .9mm; padding-right: .9mm; }

@media (max-width: 700px) {
  .price-editor-dual-head,
  .price-editor-row-dual { grid-template-columns: minmax(0,1fr) 84px 84px; }
}

@media print {
  #page-price-opt.page.active {
    zoom: 1 !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #page-price-opt .price-screen-heading,
  #page-price-opt .price-stage-note,
  #page-price-opt .price-editor { display: none !important; }
  #page-price-opt .price-workspace,
  #page-price-opt .price-preview {
    display: block !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  #page-price-opt .price-sheet {
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 8mm 9mm 7mm !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    break-after: page !important;
    page-break-after: always !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
  #page-price-opt .price-sheet:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}

/* V13.13.1 price logo + opt column alignment fix */
.price-doc-header { grid-template-columns: 38mm 1fr !important; gap: 3.5mm !important; }
.price-doc-logo { width: 33mm !important; height: 22mm !important; object-fit: contain !important; justify-self: center; align-self: center; }
.price-doc-header-compact { grid-template-columns: 33mm 1fr !important; }
.price-doc-header-compact .price-doc-logo { width: 29mm !important; height: 19mm !important; }
.price-editor-dual-head { align-items: center !important; }
.price-editor-dual-head b { display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; }
.price-sheet-opt .price-doc-section th:nth-child(4),
.price-sheet-opt .price-doc-section th:nth-child(5),
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(4),
.price-sheet-opt .price-doc-columns .price-doc-section th:nth-child(5) { text-align: center !important; }
.price-sheet-opt .price-doc-section td:nth-child(4),
.price-sheet-opt .price-doc-section td:nth-child(5),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(4),
.price-sheet-opt .price-doc-columns .price-doc-section td:nth-child(5) { text-align: right !important; }

/* ===== V13.14: Commercial proposal ===== */
.commercial-export-only { display:none !important; }
body.commercial-mode .standard-export-only,
body.commercial-mode .price-export-only { display:none !important; }
body.commercial-mode .commercial-export-only { display:grid !important; }
body.commercial-mode .export-menu-wrap { display:block !important; }
.commercial-workspace { display:grid; grid-template-columns:minmax(390px,520px) minmax(0,1fr); gap:18px; align-items:start; }
.commercial-editor { position:sticky; top:82px; max-height:calc(100vh - 100px); overflow:auto; padding:18px; }
.commercial-editor-title,.cp-block-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.commercial-editor-title h2,.cp-block-head h3 { margin:2px 0 0; }
.cp-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0 18px; }
.cp-form-grid .cp-wide { grid-column:1/-1; }
.cp-form-grid .field span { display:block; font-size:11px; color:#8f959b; margin-bottom:5px; }
.cp-form-grid input,.cp-item-row input,.cp-item-row select,.cp-condition-row input,.cp-condition-row select { width:100%; box-sizing:border-box; background:#15181c; color:#eef0f2; border:1px solid #353b42; border-radius:9px; min-height:36px; padding:7px 9px; outline:none; }
.cp-form-grid input:focus,.cp-item-row input:focus,.cp-item-row select:focus,.cp-condition-row input:focus,.cp-condition-row select:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.14); }
.cp-block-head { margin:12px 0 8px; padding-top:12px; border-top:1px solid #31363c; }
.cp-items-editor { display:grid; gap:8px; }
.cp-item-row { background:#1b1f24; border:1px solid #30363d; border-radius:12px; padding:9px; display:grid; grid-template-columns:1.1fr 1.45fr .55fr .55fr .9fr 34px; gap:7px; align-items:center; }
.cp-item-row .cp-custom-name { grid-column:1 / span 2; }
.cp-item-row .cp-price-source { font-size:11px; }
.cp-item-remove { width:34px; height:34px; border:0; border-radius:8px; background:#2b3036; color:#e9eaeb; cursor:pointer; font-size:18px; }
.cp-item-remove:hover { background:#c82027; }
.cp-condition-row { display:grid; grid-template-columns:22px 115px 1fr; gap:8px; align-items:center; padding:8px 0; border-bottom:1px solid #2c3137; }
.cp-condition-row:last-child { border-bottom:0; }
.cp-condition-row input[type="checkbox"] { width:18px; min-height:18px; accent-color:#c82027; }
.cp-condition-row.is-disabled select,.cp-condition-row.is-disabled input[type="text"] { opacity:.42; pointer-events:none; }
.commercial-preview-wrap { min-width:0; }
.commercial-preview-toolbar { display:flex; justify-content:space-between; align-items:baseline; color:#c4c8cc; padding:0 4px 8px; }
.commercial-preview-toolbar small { color:#777e85; }
.commercial-preview { display:grid; gap:22px; justify-items:center; padding:22px; border-radius:16px; background:#25292e; border:1px solid #34393f; }
.cp-sheet { page:commercial; width:min(100%,210mm); min-height:297mm; box-sizing:border-box; padding:13mm 14mm 14mm; background:#fff; color:#151515; font-family:Arial,Helvetica,sans-serif; box-shadow:0 14px 34px rgba(0,0,0,.34); position:relative; overflow:hidden; display:flex; flex-direction:column; }
.cp-sheet::before { content:""; position:absolute; top:0; left:0; right:0; height:6mm; background:#c82027; }
.cp-doc-header { display:flex; align-items:center; justify-content:space-between; gap:8mm; padding-top:2mm; border-bottom:.5mm solid #171717; padding-bottom:4mm; }
.cp-doc-logo { width:30mm; height:20mm; object-fit:contain; }
.cp-doc-company { text-align:right; line-height:1.12; }
.cp-doc-company strong { display:block; font-size:12pt; }
.cp-doc-company span { display:block; font-size:7.6pt; margin-top:1mm; }
.cp-doc-title { margin:8mm 0 5mm; display:flex; justify-content:space-between; align-items:flex-end; gap:8mm; }
.cp-doc-title h2 { margin:0; font-size:20pt; line-height:1; text-transform:uppercase; }
.cp-doc-title h2 b { color:#c82027; }
.cp-doc-meta { text-align:right; font-size:8pt; line-height:1.45; }
.cp-doc-client { background:#f3f3f3; border-left:1.6mm solid #c82027; padding:3mm 4mm; font-size:8.3pt; margin-bottom:5mm; }
.cp-doc-intro { font-size:8.4pt; line-height:1.4; margin:0 0 4mm; }
.cp-doc-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:7.7pt; }
.cp-doc-table th { background:#1c1f23; color:#fff; font-weight:700; text-align:center; padding:2.2mm 1.7mm; border:.25mm solid #1c1f23; }
.cp-doc-table td { border:.22mm solid #5c5c5c; padding:2mm 1.7mm; vertical-align:middle; }
.cp-doc-table th:nth-child(1),.cp-doc-table td:nth-child(1){width:44%;}
.cp-doc-table th:nth-child(2),.cp-doc-table td:nth-child(2){width:12%;text-align:center;}
.cp-doc-table th:nth-child(3),.cp-doc-table td:nth-child(3){width:10%;text-align:center;}
.cp-doc-table th:nth-child(4),.cp-doc-table td:nth-child(4){width:16%;text-align:right;}
.cp-doc-table th:nth-child(5),.cp-doc-table td:nth-child(5){width:18%;text-align:right;font-weight:700;}
.cp-category-row td { background:#f0f0f0; font-weight:800; color:#c82027; }
.cp-doc-totals { margin-left:auto; width:48%; margin-top:4mm; border-top:.5mm solid #1c1f23; }
.cp-total-row { display:grid; grid-template-columns:1fr 1fr; padding:2.1mm 1.5mm; font-size:9pt; border-bottom:.22mm solid #aaa; }
.cp-total-row strong:last-child { text-align:right; }
.cp-total-row.cp-grand { background:#c82027; color:#fff; border:0; font-size:11pt; }
.cp-doc-conditions { margin-top:6mm; }
.cp-doc-conditions h3 { margin:0 0 2.5mm; font-size:10pt; text-transform:uppercase; }
.cp-doc-condition { display:grid; grid-template-columns:34mm 1fr; gap:4mm; padding:1.8mm 0; border-bottom:.18mm solid #d0d0d0; font-size:8pt; }
.cp-doc-condition strong { color:#c82027; }
.cp-doc-sign { margin-top:auto; padding-top:10mm; display:flex; justify-content:space-between; align-items:flex-end; gap:10mm; font-size:8pt; }
.cp-doc-sign .cp-sign-brand strong { display:block; font-size:9pt; }
.cp-doc-signature { min-width:55mm; border-bottom:.25mm solid #333; padding-bottom:2mm; text-align:center; color:#777; }
.cp-page-number { position:absolute; right:14mm; bottom:7mm; color:#999; font-size:7pt; }
.cp-cont-title { margin:6mm 0 4mm; display:flex; justify-content:space-between; align-items:end; }
.cp-cont-title strong { font-size:12pt; }
.cp-cont-title span { font-size:7pt; color:#777; }
@media(max-width:1250px){.commercial-workspace{grid-template-columns:1fr}.commercial-editor{position:static;max-height:none}}
@media(max-width:720px){.cp-item-row{grid-template-columns:1fr 1fr}.cp-item-row .cp-custom-name{grid-column:1/-1}.cp-condition-row{grid-template-columns:22px 1fr}.cp-condition-row input[type="text"]{grid-column:2}.cp-form-grid{grid-template-columns:1fr}.cp-form-grid .cp-wide{grid-column:auto}}
@page commercial { size:A4 portrait; margin:6mm; }
@media print {
  html, body { margin:0 !important; padding:0 !important; background:#fff !important; }
  body.commercial-mode .topbar,body.commercial-mode .sidebar,body.commercial-mode .commercial-screen-heading,body.commercial-mode .commercial-editor,body.commercial-mode .commercial-preview-toolbar { display:none !important; }
  body.commercial-mode .page.active { zoom:1 !important; transform:none !important; }
  body.commercial-mode .layout,body.commercial-mode .main,body.commercial-mode #page-commercial,body.commercial-mode .commercial-preview-wrap { display:block !important; margin:0 !important; padding:0 !important; width:198mm !important; max-width:198mm !important; min-width:198mm !important; overflow:visible !important; }
  body.commercial-mode .commercial-preview { width:198mm !important; max-width:198mm !important; padding:0 !important; margin:0 !important; background:#fff !important; border:0 !important; gap:0 !important; justify-items:stretch !important; }
  body.commercial-mode .cp-sheet { page:commercial !important; width:198mm !important; height:285mm !important; min-height:285mm !important; max-height:285mm !important; padding:9mm 10mm 10mm !important; margin:0 !important; box-shadow:none !important; border:0 !important; page-break-after:always; break-after:page; overflow:hidden !important; }
  body.commercial-mode .cp-sheet:last-child { page-break-after:auto; break-after:auto; }
  body.commercial-mode .cp-sheet::before { height:4mm !important; }
  body.commercial-mode .cp-page-number { bottom:3mm !important; right:4mm !important; color:#666 !important; }
  body.commercial-mode .cp-doc-header { padding-top:1mm !important; padding-bottom:3.5mm !important; }
  body.commercial-mode .cp-doc-logo { width:40mm !important; height:13mm !important; }
  body.commercial-mode .cp-doc-company strong { font-size:12.5pt !important; }
  body.commercial-mode .cp-doc-title { margin:7mm 0 4.5mm !important; }
  body.commercial-mode .cp-doc-title h2 { font-size:24pt !important; letter-spacing:-.02em !important; }
  body.commercial-mode .cp-doc-meta { font-size:8.5pt !important; }
  body.commercial-mode .cp-doc-client { padding:3.2mm 4mm !important; margin-bottom:4.5mm !important; font-size:8.7pt !important; }
  body.commercial-mode .cp-doc-intro { font-size:9pt !important; line-height:1.45 !important; margin-bottom:4.5mm !important; }
  body.commercial-mode .cp-doc-table { font-size:8.5pt !important; }
  body.commercial-mode .cp-doc-table th { padding:2.8mm 1.8mm !important; }
  body.commercial-mode .cp-doc-table td { padding:2.5mm 1.8mm !important; }
  body.commercial-mode .cp-doc-totals { width:54% !important; margin-top:5mm !important; }
  body.commercial-mode .cp-total-row { padding:2.4mm 1.8mm !important; font-size:10pt !important; }
  body.commercial-mode .cp-total-row.cp-grand { font-size:12.5pt !important; }
  body.commercial-mode .cp-doc-sign { padding-top:10mm !important; }
}

/* V13.14.1 commercial logo, size column and signature */
.cp-item-row { grid-template-columns:1.05fr 1.25fr .55fr .5fr .85fr 34px !important; }
.cp-item-row .cp-custom-name { grid-column:1 / span 2; }
.cp-item-row .cp-custom-size { grid-column:3 / span 2; }
.cp-item-row .cp-price-input { grid-column:5 / span 2; }
.cp-doc-logo { width:38mm; height:12mm; object-fit:contain; }
.cp-doc-table th:nth-child(1),.cp-doc-table td:nth-child(1){width:34%;}
.cp-doc-table th:nth-child(2),.cp-doc-table td:nth-child(2){width:18%;}
.cp-doc-table th:nth-child(3),.cp-doc-table td:nth-child(3){width:10%;text-align:center;}
.cp-doc-table th:nth-child(4),.cp-doc-table td:nth-child(4){width:8%;text-align:center;}
.cp-doc-table th:nth-child(5),.cp-doc-table td:nth-child(5){width:14%;text-align:right;}
.cp-doc-table th:nth-child(6),.cp-doc-table td:nth-child(6){width:16%;text-align:right;font-weight:700;}
.cp-doc-sign { align-items:flex-end; }
.cp-sign-manager { min-width:76mm; text-align:center; }
.cp-sign-role { font-size:8.5pt; color:#444; margin-bottom:2mm; }
.cp-sign-visuals { position:relative; width:78mm; margin:0 auto 0; min-height:30mm; }
.cp-stamp-image { position:absolute; left:4mm; bottom:-2mm; width:29mm; height:29mm; object-fit:contain; opacity:.92; pointer-events:none; z-index:1; }
.cp-sign-image { display:block; position:relative; z-index:4; width:54mm; max-height:18mm; object-fit:contain; margin:0 auto -2.2mm; transform:translateY(7mm); }
.cp-sign-name { width:72mm; margin:0 auto; position:relative; z-index:3; font-size:8.5pt; font-weight:700; border-top:.25mm solid #333; padding-top:1.2mm; }
@media(max-width:720px){
  .cp-item-row .cp-custom-size, .cp-item-row .cp-price-input, .cp-item-row .cp-custom-name { grid-column:1/-1; }
}

/* V13.14.4 retail price-list contact footer */
.price-sheet { position: relative; }
#page-price .price-sheet { padding-bottom: 16mm; }
.price-doc-contact-footer {
  position: absolute;
  left: 9mm;
  right: 9mm;
  bottom: 5.2mm;
  padding-top: 2.2mm;
  border-top: .28mm solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4mm;
  font-size: 7.3pt;
  line-height: 1.1;
  white-space: nowrap;
}
.price-doc-contact-footer b { font-weight: 800; }
@media (max-width: 650px) {
  .price-doc-contact-footer { font-size: 6.2pt; gap: 2mm; }
}

/* V13.14.5 — wider commercial product selectors */
.commercial-workspace { grid-template-columns:minmax(600px,690px) minmax(0,1fr); }
.cp-item-row {
  grid-template-columns:minmax(145px,1.15fr) minmax(255px,2.35fr) 64px 64px 98px 34px !important;
  gap:8px;
}
.cp-item-row select[data-cp-field="category"],
.cp-item-row select[data-cp-field="productId"] { min-width:0; font-size:12px; }
.cp-item-row select[data-cp-field="productId"] { font-size:12.5px; }
.cp-item-row input[data-cp-field="qty"],
.cp-item-row input[data-cp-field="unit"] { text-align:center; padding-left:5px; padding-right:5px; }
@media(max-width:1450px){
  .commercial-workspace{grid-template-columns:1fr}
  .commercial-editor{position:static;max-height:none}
}
@media(max-width:760px){
  .cp-item-row{grid-template-columns:1fr 1fr !important}
  .cp-item-row select[data-cp-field="productId"]{grid-column:1/-1}
}


/* V13.14.7 — commercial page balanced 50/50 layout */
.commercial-workspace {
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) !important;
  gap:20px !important;
  align-items:start !important;
}
.commercial-editor,
.commercial-preview-wrap {
  min-width:0 !important;
  width:100% !important;
}
.commercial-editor {
  box-sizing:border-box;
}
.commercial-preview-wrap {
  display:flex;
  flex-direction:column;
}
.commercial-preview {
  box-sizing:border-box;
  width:100%;
}
@media(max-width:1200px){
  .commercial-workspace{grid-template-columns:1fr !important;}
}

/* V13.15 — recalculation of concrete grade */
.concrete-grade-layout {
  display:grid;
  grid-template-columns:minmax(0, 1.15fr) minmax(360px, .85fr);
  gap:18px;
  align-items:start;
}
.concrete-grade-editor,
.concrete-grade-result { padding:18px; }
.cg-section-title h2,
.cg-result-head h2 { margin:2px 0 0; }
.cg-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.cg-grid .field span,
.cg-grade-card .field span { display:block; margin-bottom:5px; font-size:11px; color:#92989e; }
.cg-grid select,.cg-grid input,
.cg-grade-card select,.cg-grade-card input {
  width:100%; box-sizing:border-box; min-height:40px; padding:8px 10px;
  color:#eef0f2; background:#15181c; border:1px solid #353b42; border-radius:9px; outline:none;
}
.cg-grid select:focus,.cg-grid input:focus,
.cg-grade-card select:focus,.cg-grade-card input:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.14); }
.cg-grid .field small { display:block; margin-top:5px; color:#6f767d; font-size:10px; line-height:1.35; }
.cg-wide { grid-column:1/-1; }
.cg-grade-columns { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:18px; }
.cg-grade-card { padding:14px; background:#1b1f24; border:1px solid #30363d; border-radius:13px; }
.cg-grade-card-target { border-color:#4a2528; }
.cg-grade-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding-bottom:10px; margin-bottom:10px; border-bottom:1px solid #2f343a; }
.cg-grade-head span { color:#c82027; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.cg-grade-head strong { font-size:15px; }
.cg-grade-card .field + .field { margin-top:10px; }
.cg-note { margin-top:14px; padding:11px 12px; border-radius:10px; background:#171a1e; border-left:3px solid #c82027; color:#8f959b; font-size:11px; line-height:1.45; }
.concrete-grade-result { position:sticky; top:82px; overflow:hidden; }
.cg-result-head { padding-bottom:14px; border-bottom:1px solid #30363d; }
.cg-result-size { margin-top:5px; color:#8f959b; font-size:12px; }
.cg-result-main { margin:18px 0; padding:18px; border-radius:14px; background:linear-gradient(135deg,#20242a,#171a1e); border:1px solid #353b42; }
.cg-result-main span { display:block; color:#949aa0; font-size:11px; }
.cg-result-main strong { display:block; margin-top:6px; font-size:30px; line-height:1.05; color:#fff; }
.cg-result-main small { display:block; margin-top:5px; color:#c82027; font-weight:800; }
.cg-metrics { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.cg-metrics > div { padding:11px 12px; border-radius:10px; background:#171a1e; border:1px solid #2e343a; }
.cg-metrics span,.cg-total-box span { display:block; color:#81888f; font-size:10px; line-height:1.25; }
.cg-metrics strong { display:block; margin-top:5px; font-size:14px; }
.cg-total-box { margin-top:12px; border:1px solid #343a40; border-radius:12px; overflow:hidden; }
.cg-total-box > div { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:10px 12px; border-bottom:1px solid #2e343a; }
.cg-total-box > div:last-child { border-bottom:0; }
.cg-total-box strong { font-size:14px; }
.cg-total-box .cg-total-diff { background:#23191b; }
.cg-total-box .cg-total-diff strong { color:#e34b51; }
.cg-formula { margin-top:12px; padding:10px 12px; border-radius:10px; background:#121519; color:#7f868d; font-size:10.5px; line-height:1.45; }
@media(max-width:1100px){
  .concrete-grade-layout { grid-template-columns:1fr; }
  .concrete-grade-result { position:static; }
}
@media(max-width:650px){
  .cg-grid,.cg-grade-columns,.cg-metrics { grid-template-columns:1fr; }
  .cg-wide { grid-column:auto; }
}

/* V13.15.2 — selectable commercial proposal signers */
.cp-signer-select-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.cp-signer-select-row select{width:100%;box-sizing:border-box;background:#15181c;color:#eef0f2;border:1px solid #353b42;border-radius:9px;min-height:36px;padding:7px 9px;outline:none}
.cp-signer-editor{border:1px solid #343a41;border-radius:12px;background:#181c20;padding:12px;margin-top:2px}
.cp-signer-editor-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.cp-signer-editor-head strong{display:block;font-size:13px;color:#f0f1f2}
.cp-signer-editor-head small{display:block;color:#777e85;font-size:10.5px;margin-top:2px}
.cp-signer-editor-grid{display:grid;grid-template-columns:1fr 1.35fr;gap:9px}
.cp-signer-editor-grid .cp-wide{grid-column:1/-1}
.cp-signer-signature-preview{margin-top:10px}
.cp-signer-signature-preview>span{display:block;color:#8f959b;font-size:11px;margin-bottom:5px}
.cp-signer-signature-box{height:74px;border:1px dashed #414850;border-radius:9px;background:#121519;display:flex;align-items:center;justify-content:center;overflow:hidden}
.cp-signer-signature-box img{display:none;max-width:90%;max-height:66px;object-fit:contain}
.cp-signer-signature-box img.has-signature{display:block}
.cp-signer-signature-box em{font-style:normal;color:#646b72;font-size:11px}
.cp-signer-editor-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
@media(max-width:720px){.cp-signer-editor-grid{grid-template-columns:1fr}.cp-signer-editor-grid .cp-wide{grid-column:auto}.cp-signer-select-row{grid-template-columns:1fr}.cp-signer-editor-actions{flex-wrap:wrap}}

.cp-sign-empty{height:18mm;}
.cp-signer-editor-actions .btn:disabled{opacity:.38;cursor:not-allowed;}


/* V13.15.4 — optional free text block in commercial proposal */
.cp-extra-text-editor{border:1px solid #30363d;border-radius:12px;background:#1b1f24;padding:10px 12px;margin-bottom:4px}
.cp-extra-text-toggle{display:flex;align-items:center;gap:9px;color:#eef0f2;font-size:12px;font-weight:700;cursor:pointer}
.cp-extra-text-toggle input{width:18px;height:18px;min-height:18px;accent-color:#c82027;flex:0 0 auto}
.cp-extra-text-field{display:block;margin-top:10px}
.cp-extra-text-field>span{display:block;font-size:11px;color:#8f959b;margin-bottom:5px}
.cp-extra-text-field textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:108px;background:#15181c;color:#eef0f2;border:1px solid #353b42;border-radius:9px;padding:9px 10px;outline:none;font:inherit;line-height:1.4}
.cp-extra-text-field textarea:focus{border-color:#c82027;box-shadow:0 0 0 2px rgba(200,32,39,.14)}
.cp-doc-extra-text{margin-top:5mm;padding:3.2mm 4mm;background:#f5f5f5;border-left:1.2mm solid #c82027;font-size:8.3pt;line-height:1.45;white-space:pre-wrap;box-sizing:border-box;max-width:100%;overflow-wrap:anywhere;word-break:break-word;text-align:justify;text-justify:inter-word}


/* V13.15.6 — hard wrap for any unbroken text in CP free-text block */
.cp-doc-extra-text{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  overflow-wrap:anywhere !important;
  word-wrap:break-word !important;
  word-break:break-all !important;
  white-space:pre-wrap !important;
  text-align:justify !important;
  text-justify:inter-word !important;
}

/* V13.16 — FBS cost accounting module */
.fbs-cost-page { padding-bottom:28px; }
.cost-top-grid { display:grid; grid-template-columns:minmax(0,1.06fr) minmax(420px,.94fr); gap:18px; align-items:start; }
.cost-control-card,.cost-kpi-card,.cost-table-card,.cost-method-card { min-width:0; }
.cost-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:14px; }
.cost-card-head h2 { margin:2px 0 0; }
.cost-method-badge { display:inline-flex; align-items:center; min-height:30px; padding:0 11px; border-radius:999px; background:#2a2f35; border:1px solid #3a4148; font-size:12px; font-weight:800; white-space:nowrap; }
.cost-control-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.cost-control-grid .cost-wide { grid-column:1/-1; }
.cost-source-box { margin-top:13px; padding:12px 14px; border:1px solid #343a41; border-radius:11px; background:#171b20; display:grid; gap:6px; }
.cost-source-box > div { display:flex; justify-content:space-between; gap:14px; align-items:baseline; }
.cost-source-box strong { font-size:15px; }
.cost-source-box span { color:#aeb4ba; font-size:12px; text-align:right; }
.cost-source-box small { color:#777f87; line-height:1.4; }
.cost-edit-toggle { display:flex; gap:11px; align-items:flex-start; margin-top:13px; padding:12px 14px; border-radius:11px; background:#1a1f24; border:1px solid #353c43; cursor:pointer; }
.cost-edit-toggle input { width:18px; height:18px; margin-top:2px; accent-color:#c82027; flex:0 0 auto; }
.cost-edit-toggle span { display:grid; gap:3px; }
.cost-edit-toggle strong { font-size:13px; }
.cost-edit-toggle small { color:#8f969d; line-height:1.35; }
.cost-edit-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.cost-edit-actions .btn:disabled { opacity:.4; cursor:not-allowed; }

.cost-kpi-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.cost-kpi { padding:13px; border-radius:12px; border:1px solid #363c43; background:#181c21; min-width:0; }
.cost-kpi span { display:block; color:#9da4ab; font-size:11px; margin-bottom:5px; }
.cost-kpi strong { display:block; font-size:21px; line-height:1.1; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cost-kpi small { display:block; color:#6f777f; font-size:10px; margin-top:5px; }
.cost-kpi-accent { border-color:rgba(200,32,39,.75); box-shadow:inset 3px 0 0 #c82027; }
.cost-kpi .is-positive,.cost-kpi strong.is-positive { color:#74c68a; }
.cost-kpi .is-negative,.cost-kpi strong.is-negative { color:#ff7378; }
.cost-kpi .is-neutral,.cost-kpi strong.is-neutral { color:#eef0f2; }
.cost-batch-box { margin-top:10px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid #343a41; border-radius:12px; overflow:hidden; }
.cost-batch-box > div { padding:10px 12px; background:#15191e; border-right:1px solid #2e343a; border-bottom:1px solid #2e343a; display:flex; justify-content:space-between; gap:10px; }
.cost-batch-box > div:nth-child(2n){ border-right:0; }
.cost-batch-box > div:nth-last-child(-n+2){ border-bottom:0; }
.cost-batch-box span { color:#8e959c; font-size:11px; }
.cost-batch-box strong { font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.cost-batch-margin { background:#202328 !important; }
.cost-status { margin-top:10px; padding:9px 11px; border-radius:9px; background:#171b20; color:#aab0b6; font-size:11px; border-left:3px solid #4a5057; }
.cost-status.changed { border-left-color:#c82027; color:#e0e3e6; }

.cost-table-card { margin-top:18px; }
.cost-table-head { align-items:flex-end; }
.cost-table-hint { max-width:520px; color:#838b93; font-size:11px; line-height:1.4; text-align:right; }
.cost-table-hint strong { color:#c8ccd0; }
.cost-table-wrap { width:100%; overflow:auto; border:1px solid #343a41; border-radius:12px; }
.cost-table { width:100%; min-width:850px; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.cost-table th { padding:10px 9px; background:#1c2025; color:#dfe2e5; text-align:left; border-bottom:1px solid #3b4148; font-size:11px; }
.cost-table th:nth-child(1){ width:30%; }
.cost-table th:nth-child(2){ width:20%; }
.cost-table th:nth-child(3){ width:7%; text-align:center; }
.cost-table th:nth-child(4){ width:23%; }
.cost-table th:nth-child(5){ width:20%; text-align:right; }
.cost-table td { padding:8px 9px; border-bottom:1px solid #2d3339; vertical-align:middle; }
.cost-table tbody tr:last-child td { border-bottom:0; }
.cost-section-row td { padding:8px 10px; background:#252a30; color:#e9ebed; font-size:11px; font-weight:900; letter-spacing:.07em; text-transform:uppercase; }
.cost-unit { text-align:center; color:#a5abb1; }
.cost-money { text-align:right; font-variant-numeric:tabular-nums; }
.cost-money strong { display:block; }
.cost-row-delta { display:block; margin-top:3px; color:#6e767e; font-size:9.5px; }
.cost-row-delta.plus { color:#e5686d; }
.cost-row-delta.minus { color:#70bd85; }
.cost-edit-cell { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; }
.cost-edit-cell input { width:100%; min-width:0; height:34px; box-sizing:border-box; background:#14181c; color:#eef0f2; border:1px solid #333a41; border-radius:8px; padding:6px 8px; font:inherit; font-variant-numeric:tabular-nums; }
.cost-edit-cell input[readonly] { border-color:transparent; background:transparent; padding-left:0; cursor:default; }
.cost-edit-cell small { color:#656e76; font-size:9px; white-space:nowrap; }
.cost-edit-cell.is-changed input { border-color:#a92229; }
.cost-table-wrap:not(.is-editing) .cost-edit-cell small { opacity:.65; }
.cost-special-row td { background:#191d22; }
.cost-special-note { color:#737b83; font-size:10px; }
.cost-subtotal-row td { background:#20252a; font-weight:800; }
.cost-summary-row td { background:#23282e; font-weight:900; }
.cost-grand-row td { background:#c82027; color:#fff; font-size:13px; font-weight:900; }
.cost-grand-row .cost-money strong { font-size:15px; }

.cost-method-card { margin-top:18px; }
.cost-method-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.cost-method-grid > div { padding:11px 12px; border-radius:10px; background:#191d22; border:1px solid #32383f; display:grid; gap:4px; }
.cost-method-grid strong { font-size:12px; }
.cost-method-grid span { color:#8f969d; font-size:10.5px; line-height:1.4; }
.cost-method-card .hint { margin:12px 0 0; }
.cost-control-card input.is-readonly { background:#12161a; color:#aeb4ba; }

@media(max-width:1320px){
  .cost-top-grid { grid-template-columns:1fr; }
  .cost-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:850px){
  .cost-control-grid { grid-template-columns:1fr; }
  .cost-control-grid .cost-wide { grid-column:auto; }
  .cost-kpi-grid { grid-template-columns:1fr 1fr; }
  .cost-method-grid { grid-template-columns:1fr; }
  .cost-table-head { align-items:flex-start; flex-direction:column; }
  .cost-table-hint { text-align:left; }
}
@media(max-width:560px){
  .cost-kpi-grid,.cost-batch-box { grid-template-columns:1fr; }
  .cost-batch-box > div { border-right:0; border-bottom:1px solid #2e343a !important; }
  .cost-batch-box > div:last-child { border-bottom:0 !important; }
  .cost-source-box > div { flex-direction:column; align-items:flex-start; gap:3px; }
  .cost-source-box span { text-align:left; }
}

/* V13.16 final polish — keep source/read-only values fully legible */
.cost-table .cost-edit-cell input[readonly] {
  color:#eef0f2 !important;
  opacity:1 !important;
  -webkit-text-fill-color:#eef0f2;
}
.cost-table .cost-edit-cell input:disabled {
  color:#eef0f2 !important;
  opacity:1 !important;
  -webkit-text-fill-color:#eef0f2;
}

/* V13.16.1 — readable cost table on dark production rows */
.cost-special-row td,
.cost-subtotal-row td,
.cost-summary-row td {
  color:#eef0f2 !important;
}
.cost-special-row td strong,
.cost-subtotal-row td strong,
.cost-summary-row td strong {
  color:#f5f6f7 !important;
}
.cost-special-row .cost-special-note {
  color:#aeb4ba !important;
}
.cost-special-row .cost-unit,
.cost-subtotal-row .cost-unit,
.cost-summary-row .cost-unit {
  color:#c6cbd0 !important;
}
.cost-table .cost-edit-cell small {
  color:#9aa1a8 !important;
  opacity:1 !important;
}
.cost-table .cost-row-delta {
  color:#8f969d;
}
.cost-table .cost-row-delta.plus { color:#ff858a; }
.cost-table .cost-row-delta.minus { color:#88d29b; }
.cost-method-badge {
  max-width:100%;
  white-space:normal;
  line-height:1.25;
  text-align:right;
}

/* V13.16.2 — definitive cost-table contrast rules */
/* Ordinary material rows are light: all read-only content must be dark and readable. */
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) td {
  background:#ffffff !important;
  color:#171a1d !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) td strong {
  color:#111417 !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-edit-cell input[readonly] {
  color:#20252a !important;
  -webkit-text-fill-color:#20252a !important;
  opacity:1 !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-edit-cell small {
  color:#6a727a !important;
  opacity:1 !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-unit {
  color:#626a72 !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-row-delta {
  color:#727a82 !important;
}
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-row-delta.plus { color:#b3262c !important; }
.cost-table tbody tr:not(.cost-section-row):not(.cost-special-row):not(.cost-subtotal-row):not(.cost-summary-row):not(.cost-grand-row) .cost-row-delta.minus { color:#287b3d !important; }

/* In edit mode inputs are deliberately dark so editable values are obvious. */
.cost-table-wrap.is-editing .cost-edit-cell input:not([readonly]) {
  background:#14181c !important;
  color:#f4f5f6 !important;
  -webkit-text-fill-color:#f4f5f6 !important;
  border-color:#3a4148 !important;
}
.cost-table-wrap.is-editing .cost-edit-cell.is-changed input:not([readonly]) {
  border-color:#c82027 !important;
  box-shadow:0 0 0 1px rgba(200,32,39,.18);
}

/* Dark production/summary rows stay dark with light text. */
.cost-special-row .cost-edit-cell input[readonly],
.cost-subtotal-row .cost-edit-cell input[readonly],
.cost-summary-row .cost-edit-cell input[readonly] {
  color:#f2f4f5 !important;
  -webkit-text-fill-color:#f2f4f5 !important;
}

/* V13.16.3 — additional FBS cost expenses + source audit */
.cost-source-audit {
  color:#79c58c !important;
  font-weight:700;
}
.cost-extra-card { margin-top:18px; min-width:0; }
.cost-extra-head { align-items:center; }
.cost-extra-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.cost-extra-actions .btn:disabled { opacity:.4; cursor:not-allowed; }
.cost-extra-toggle {
  display:flex;
  gap:11px;
  align-items:flex-start;
  padding:12px 14px;
  border:1px solid #353c43;
  border-radius:11px;
  background:#1a1f24;
  cursor:pointer;
}
.cost-extra-toggle input { width:18px; height:18px; margin-top:2px; accent-color:#c82027; flex:0 0 auto; }
.cost-extra-toggle > span { display:grid; gap:3px; }
.cost-extra-toggle strong { font-size:13px; }
.cost-extra-toggle small { color:#8f969d; line-height:1.35; }
.cost-extra-editor { display:grid; gap:10px; margin-top:12px; }
.cost-extra-empty {
  padding:15px;
  border:1px dashed #3c434a;
  border-radius:11px;
  color:#8e969e;
  background:#15191d;
  font-size:12px;
  line-height:1.45;
}
.cost-extra-editor.is-disabled + .cost-extra-summary { opacity:.65; }
.cost-extra-row {
  display:grid;
  grid-template-columns:minmax(210px,1.65fr) minmax(115px,.72fr) minmax(105px,.62fr) minmax(135px,.82fr) 78px minmax(135px,.85fr) 36px;
  gap:8px;
  align-items:end;
  padding:11px;
  border:1px solid #343b42;
  border-radius:12px;
  background:#171b20;
}
.cost-extra-field { display:grid; gap:5px; min-width:0; }
.cost-extra-field > span,
.cost-extra-vat > span:first-child,
.cost-extra-amount > span { color:#8f969d; font-size:10px; }
.cost-extra-field input,
.cost-extra-field select {
  width:100%;
  min-width:0;
  box-sizing:border-box;
  height:36px;
  border:1px solid #383f46;
  border-radius:8px;
  background:#12161a;
  color:#f1f3f4;
  padding:6px 8px;
  font:inherit;
  outline:none;
}
.cost-extra-field input:focus,
.cost-extra-field select:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.13); }
.cost-extra-vat { display:grid; gap:5px; min-width:0; }
.cost-extra-vat-check {
  height:36px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:1px solid #383f46;
  border-radius:8px;
  background:#12161a;
}
.cost-extra-vat-check input { width:17px; height:17px; accent-color:#c82027; }
.cost-extra-vat-check small { color:#b4bac0; font-size:10px; }
.cost-extra-amount { min-width:0; display:grid; gap:5px; }
.cost-extra-amount strong {
  height:36px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 9px;
  border:1px solid #30373e;
  border-radius:8px;
  background:#20252a;
  color:#f4f5f6;
  font-size:12px;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.cost-extra-remove {
  width:36px;
  height:36px;
  border:0;
  border-radius:8px;
  background:#2b3036;
  color:#e9eaeb;
  font-size:19px;
  cursor:pointer;
}
.cost-extra-remove:hover { background:#c82027; color:#fff; }
.cost-extra-summary {
  margin-top:11px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border:1px solid #343a41;
  border-radius:11px;
  overflow:hidden;
}
.cost-extra-summary > div {
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  background:#15191e;
  border-right:1px solid #30363c;
}
.cost-extra-summary > div:last-child { border-right:0; }
.cost-extra-summary span { color:#8f969d; font-size:10px; }
.cost-extra-summary strong { color:#f0f2f3; font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.cost-extra-summary-accent { box-shadow:inset 3px 0 0 #c82027; }
.cost-extra-note { margin:10px 1px 0; color:#7f878f; font-size:10.5px; line-height:1.45; }
.cost-extra-note strong { color:#b8bec4; }
.cost-extra-summary-row td {
  background:#20252a !important;
  color:#eef0f2 !important;
  font-weight:800;
}
.cost-extra-summary-row .cost-money strong { color:#f5f6f7 !important; }

@media(max-width:1180px){
  .cost-extra-row { grid-template-columns:minmax(220px,1.5fr) repeat(3,minmax(110px,.7fr)) 74px minmax(130px,.8fr) 36px; }
}
@media(max-width:940px){
  .cost-extra-row { grid-template-columns:1fr 1fr; align-items:end; }
  .cost-extra-name { grid-column:1/-1; }
  .cost-extra-remove { justify-self:end; }
  .cost-extra-summary { grid-template-columns:1fr; }
  .cost-extra-summary > div { border-right:0; border-bottom:1px solid #30363c; }
  .cost-extra-summary > div:last-child { border-bottom:0; }
}
@media(max-width:560px){
  .cost-extra-head { align-items:flex-start; flex-direction:column; }
  .cost-extra-actions { width:100%; justify-content:flex-start; }
  .cost-extra-row { grid-template-columns:1fr; }
  .cost-extra-name { grid-column:auto; }
}

/* V14.0 MAIN — full-factory cost module */
.cost-method-badge {
  background:#c82027 !important;
  border-color:#c82027 !important;
  color:#ffffff !important;
  box-shadow:0 5px 14px rgba(200,32,39,.18);
}
.cost-sale-link-note { display:block; margin-top:5px; color:#727a82; font-size:9.5px; line-height:1.35; }
.cost-control-grid .field small.cost-sale-link-note { color:#727a82; }
.cost-source-box #costProductMeta { max-width:64%; }
@media(max-width:850px){ .cost-source-box #costProductMeta { max-width:100%; } }

/* V14.0 MAIN — additional expenses appear as transparent calculation rows */
.cost-user-expense-section td {
  border-top:2px solid #c82027 !important;
}
.cost-user-expense-row td {
  background:#fff7f7 !important;
  color:#20252a !important;
}
.cost-user-expense-row td:first-child {
  box-shadow:inset 3px 0 0 #c82027;
}
.cost-user-expense-row .cost-unit,
.cost-user-expense-row .cost-readonly-value,
.cost-user-expense-row .cost-money strong {
  color:#20252a !important;
  -webkit-text-fill-color:#20252a !important;
}
.cost-user-expense-vat {
  display:block;
  margin-top:3px;
  color:#767d84 !important;
  font-size:9px;
  line-height:1.2;
}

/* V14.1 MAIN — per-line editable article name and unit */
.cost-table { min-width:1040px; }
.cost-table th:nth-child(1){ width:38px !important; text-align:center; padding-left:5px; padding-right:5px; }
.cost-table th:nth-child(2){ width:28% !important; }
.cost-table th:nth-child(3){ width:19% !important; }
.cost-table th:nth-child(4){ width:9% !important; text-align:center; }
.cost-table th:nth-child(5){ width:24% !important; }
.cost-table th:nth-child(6){ width:20% !important; text-align:right; }
.cost-meta-head { color:#e8eaec !important; font-size:14px !important; }
.cost-meta-toggle-cell { width:38px; text-align:center; padding-left:5px !important; padding-right:5px !important; }
.cost-meta-toggle { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.cost-meta-toggle input { width:17px; height:17px; margin:0; accent-color:#c82027; cursor:pointer; }
.cost-meta-name { min-width:0; }
.cost-meta-name > strong { overflow-wrap:anywhere; word-break:break-word; }
.cost-meta-changed { display:block; margin-top:3px; color:#b3262c !important; font-size:9px; font-weight:700; }
.cost-special-row .cost-meta-changed,.cost-subtotal-row .cost-meta-changed,.cost-summary-row .cost-meta-changed,.cost-grand-row .cost-meta-changed { color:#ff9aa0 !important; }
.cost-meta-input-wrap { display:grid; grid-template-columns:minmax(0,1fr) 30px; gap:6px; align-items:center; }
.cost-meta-input {
  width:100%; min-width:0; height:34px; box-sizing:border-box; border:1px solid #b8bec4; border-radius:8px;
  background:#ffffff; color:#171a1d; -webkit-text-fill-color:#171a1d; padding:6px 8px; font:inherit; outline:none;
}
.cost-meta-input:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.12); }
.cost-meta-unit-input { text-align:center; }
.cost-meta-reset { width:30px; height:30px; border:0; border-radius:7px; background:#e9ecef; color:#333a40; cursor:pointer; font-size:16px; line-height:1; }
.cost-meta-reset:hover { background:#c82027; color:#fff; }
.cost-meta-base { display:block; margin-top:4px; color:#6d757d !important; font-size:9px; line-height:1.25; overflow-wrap:anywhere; }
.cost-meta-unit .cost-meta-changed { text-align:center; }
.cost-special-row .cost-meta-input,.cost-subtotal-row .cost-meta-input,.cost-summary-row .cost-meta-input,.cost-grand-row .cost-meta-input {
  background:#111519; border-color:#485058; color:#f3f5f6; -webkit-text-fill-color:#f3f5f6;
}
.cost-special-row .cost-meta-base,.cost-subtotal-row .cost-meta-base,.cost-summary-row .cost-meta-base,.cost-grand-row .cost-meta-base { color:#aeb4ba !important; }
.cost-special-row .cost-meta-reset,.cost-subtotal-row .cost-meta-reset,.cost-summary-row .cost-meta-reset,.cost-grand-row .cost-meta-reset { background:#343a40; color:#f1f3f4; }
.cost-grand-row .cost-meta-input { border-color:rgba(255,255,255,.55); background:rgba(0,0,0,.16); }
.cost-grand-row .cost-meta-reset { background:rgba(0,0,0,.23); }
.cost-user-expense-row .cost-meta-toggle-cell { box-shadow:none !important; }
@media(max-width:850px){ .cost-table { min-width:980px; } }

/* V14.2 MAIN — cost UX: bounded header, sale toggle, unit conversions, professional print */
.cost-control-card {
  overflow:hidden;
  padding-top:18px !important;
}
.cost-card-head {
  min-width:0;
  flex-wrap:wrap;
}
.cost-card-head > div:first-child { min-width:0; }
.cost-method-badge {
  flex:0 1 auto;
  max-width:min(48%, 380px);
  margin-left:auto;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  box-sizing:border-box;
}
.cost-control-card .eyebrow { line-height:1.2; }

.cost-field-label-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.cost-field-label-row > span {
  min-width:0;
}
.cost-function-toggle {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:2px 8px 2px 6px;
  border:1px solid #cfd3d7;
  border-radius:999px;
  background:#f4f5f6;
  color:#555c63;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.cost-function-toggle input {
  width:15px !important;
  height:15px !important;
  min-height:15px !important;
  margin:0;
  accent-color:#c82027;
}
.cost-function-toggle:has(input:checked) {
  border-color:#c82027;
  background:#fff0f1;
  color:#a61920;
}
.cost-control-grid .field.is-function-disabled select,
.cost-control-grid .field.is-function-disabled input {
  opacity:.52;
  cursor:not-allowed;
}
.cost-control-grid .field.is-function-disabled .cost-sale-link-note { color:#a13a3f !important; font-weight:700; opacity:1; }
.cost-kpi.is-function-disabled {
  background:#15191d;
  border-style:dashed;
  opacity:.78;
}
.cost-kpi.is-function-disabled strong,
.cost-batch-box strong.is-function-disabled {
  color:#7f878e !important;
  font-size:13px;
  white-space:normal;
}

.cost-meta-unit-input {
  appearance:auto;
  text-align:left;
  padding-right:26px;
}
.cost-table .cost-meta-unit select.cost-meta-input {
  width:100%;
  min-width:84px;
}
.cost-unit-conversion-note {
  display:block;
  margin-top:3px;
  color:#6d757d;
  font-size:8.5px;
}

.cost-export-only { display:none !important; }
body.cost-mode .cost-export-only { display:grid !important; }
body.cost-mode .export-menu-wrap { display:block !important; }

.cost-print-document { display:none; }

@page cost-report { size:A4 portrait; margin:10mm 11mm 11mm; }
@media print {
  #page-fbs-cost.page.active {
    page:cost-report;
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
    color:#171a1d !important;
  }
  #page-fbs-cost > .page-heading,
  #page-fbs-cost > .cost-top-grid,
  #page-fbs-cost > .cost-extra-card,
  #page-fbs-cost > .cost-table-card,
  #page-fbs-cost > .cost-method-card {
    display:none !important;
  }
  #page-fbs-cost .cost-print-document {
    display:block !important;
    width:100% !important;
    margin:0 !important;
    padding:0 !important;
    color:#171a1d !important;
    background:#fff !important;
    font-family:Arial,Helvetica,sans-serif;
  }
  #page-fbs-cost .cost-print-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8mm;
    padding-bottom:3mm;
    border-bottom:.45mm solid #1c2025;
  }
  #page-fbs-cost .cost-print-header img {
    width:43mm;
    height:14mm;
    object-fit:contain;
    object-position:left center;
  }
  #page-fbs-cost .cost-print-header > div {
    max-width:92mm;
    text-align:right;
    line-height:1.2;
  }
  #page-fbs-cost .cost-print-header strong { display:block; font-size:10pt; }
  #page-fbs-cost .cost-print-header span { display:block; margin-top:1mm; color:#5f666d; font-size:6.8pt; }
  #page-fbs-cost .cost-print-title {
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:6mm;
    margin:5mm 0 4mm;
  }
  #page-fbs-cost .cost-print-title span {
    display:block;
    color:#c82027;
    font-size:6.8pt;
    font-weight:900;
    letter-spacing:.08em;
  }
  #page-fbs-cost .cost-print-title h1 {
    margin:1mm 0 0 !important;
    font-size:19pt !important;
    line-height:1;
    letter-spacing:-.02em;
  }
  #page-fbs-cost .cost-print-date { color:#596068; font-size:7.5pt; white-space:nowrap; }
  #page-fbs-cost .cost-print-meta {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0;
    border:.22mm solid #c6cace;
    margin-bottom:4mm;
  }
  #page-fbs-cost .cost-print-meta > div {
    display:grid;
    grid-template-columns:30mm 1fr;
    gap:2mm;
    padding:2mm 2.5mm;
    border-bottom:.18mm solid #d7dadd;
  }
  #page-fbs-cost .cost-print-meta > div:nth-child(odd){ border-right:.18mm solid #d7dadd; }
  #page-fbs-cost .cost-print-meta > div:nth-last-child(-n+2){ border-bottom:0; }
  #page-fbs-cost .cost-print-meta span { color:#70777e; font-size:6.5pt; }
  #page-fbs-cost .cost-print-meta strong { font-size:7.3pt; overflow-wrap:anywhere; }
  #page-fbs-cost .cost-print-kpis {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    border:.22mm solid #c6cace;
    margin-bottom:4mm;
  }
  #page-fbs-cost .cost-print-kpis > div {
    min-height:15mm;
    padding:2.2mm 2.5mm;
    border-right:.18mm solid #d7dadd;
    border-bottom:.18mm solid #d7dadd;
  }
  #page-fbs-cost .cost-print-kpis > div:nth-child(3n){ border-right:0; }
  #page-fbs-cost .cost-print-kpis > div:nth-last-child(-n+3){ border-bottom:0; }
  #page-fbs-cost .cost-print-kpis .accent { box-shadow:inset 1.2mm 0 0 #c82027; }
  #page-fbs-cost .cost-print-kpis span { display:block; color:#747b82; font-size:6.3pt; margin-bottom:1.2mm; }
  #page-fbs-cost .cost-print-kpis strong { display:block; font-size:10pt; line-height:1.1; }
  #page-fbs-cost .cost-print-kpis small { display:block; margin-top:1mm; color:#777e85; font-size:5.8pt; }
  #page-fbs-cost .cost-print-table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:6.8pt;
    color:#171a1d;
  }
  #page-fbs-cost .cost-print-table thead { display:table-header-group; }
  #page-fbs-cost .cost-print-table th {
    background:#1c2025 !important;
    color:#fff !important;
    padding:2mm 1.4mm;
    border:.18mm solid #1c2025;
    text-align:center;
    font-size:6.4pt;
    font-weight:800;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }
  #page-fbs-cost .cost-print-table th:nth-child(1){width:34%;}
  #page-fbs-cost .cost-print-table th:nth-child(2){width:15%;}
  #page-fbs-cost .cost-print-table th:nth-child(3){width:9%;}
  #page-fbs-cost .cost-print-table th:nth-child(4){width:20%;}
  #page-fbs-cost .cost-print-table th:nth-child(5){width:22%;}
  #page-fbs-cost .cost-print-table td {
    padding:1.65mm 1.4mm;
    border:.16mm solid #9fa5aa;
    vertical-align:middle;
    background:#fff !important;
    color:#171a1d !important;
  }
  #page-fbs-cost .cost-print-table td:nth-child(2),
  #page-fbs-cost .cost-print-table td:nth-child(3){ text-align:center; }
  #page-fbs-cost .cost-print-table td:nth-child(4),
  #page-fbs-cost .cost-print-table td:nth-child(5){ text-align:right; }
  #page-fbs-cost .cost-print-table tr { break-inside:avoid; page-break-inside:avoid; }
  #page-fbs-cost .cost-print-table small { display:block; margin-top:.7mm; color:#777e85; font-size:5.8pt; }
  #page-fbs-cost .cost-print-section td {
    background:#eceeef !important;
    color:#c82027 !important;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
    text-align:left !important;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }
  #page-fbs-cost .cost-print-subtotal td,
  #page-fbs-cost .cost-print-vat td { background:#f0f1f2 !important; font-weight:800; }
  #page-fbs-cost .cost-print-grand td {
    background:#c82027 !important;
    color:#fff !important;
    font-weight:900;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }
  #page-fbs-cost .cost-print-source {
    margin-top:3mm;
    padding-top:2mm;
    border-top:.3mm solid #1c2025;
    color:#626970;
    font-size:6.2pt;
    line-height:1.35;
  }
  #page-fbs-cost .cost-print-source strong { color:#171a1d; }
  #page-fbs-cost .cost-print-footer {
    display:flex;
    justify-content:space-between;
    gap:6mm;
    margin-top:3mm;
    color:#858b91;
    font-size:5.8pt;
  }
}

@media(max-width:650px){
  .cost-method-badge { max-width:100%; margin-left:0; }
  .cost-field-label-row { align-items:flex-start; flex-direction:column; }
}

/* V14.3 — local users and section permissions */
.auth-locked { filter: blur(1px); pointer-events:none; user-select:none; }
.auth-gate {
  position:fixed; inset:0; z-index:10000; display:grid; place-items:center;
  padding:24px; background:rgba(12,14,17,.96); backdrop-filter:blur(10px);
}
.auth-gate[hidden] { display:none !important; }
.auth-card {
  width:min(460px, 100%); background:#1b1f24; border:1px solid #343a41; border-radius:20px;
  box-shadow:0 30px 80px rgba(0,0,0,.55); padding:26px;
}
.auth-brand { display:flex; align-items:center; gap:16px; padding-bottom:18px; margin-bottom:18px; border-bottom:1px solid #30363d; }
.auth-brand img { width:72px; height:52px; object-fit:contain; }
.auth-brand strong { display:block; color:#f4f5f6; font-size:19px; letter-spacing:.02em; }
.auth-brand span { display:block; color:#8d949b; font-size:12px; margin-top:3px; }
.auth-form { display:grid; gap:13px; }
.auth-form[hidden] { display:none !important; }
.auth-form label:not(.auth-remember) > span { display:block; font-size:11px; color:#a4aab0; margin-bottom:5px; }
.auth-form input[type="text"], .auth-form input:not([type]) , .auth-form input[type="password"] {
  width:100%; min-height:42px; box-sizing:border-box; border:1px solid #3b424a; border-radius:10px;
  background:#121519; color:#f3f4f5; padding:9px 11px; outline:none;
}
.auth-form input:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.15); }
.auth-remember { display:flex; align-items:center; gap:9px; color:#c7cbd0; font-size:12px; }
.auth-remember input { width:17px; height:17px; accent-color:#c82027; }
.auth-submit { width:100%; min-height:43px; justify-content:center; }
.auth-error { min-height:16px; color:#ff6b70; font-size:12px; }
.auth-help, .auth-setup-note { color:#8d949b; font-size:11px; line-height:1.45; }
.auth-setup-note { padding:10px 12px; border-radius:10px; background:#252a30; border-left:3px solid #c82027; color:#c8ccd0; }
.current-user { display:flex; align-items:center; gap:9px; padding-left:10px; border-left:1px solid #343a41; }
.current-user-copy { max-width:190px; line-height:1.08; }
.current-user-copy strong { display:block; color:#f1f2f3; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.current-user-copy span { display:block; margin-top:3px; color:#818890; font-size:9px; }
.current-user-logout { min-height:32px !important; padding:5px 9px !important; font-size:10px !important; }
.users-workspace { display:grid; grid-template-columns:minmax(280px, 360px) minmax(0,1fr); gap:18px; align-items:start; }
.users-list-card, .user-editor-card { padding:18px; }
.users-head, .user-access-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.users-head h2, .user-access-head h3 { margin:2px 0 0; }
.users-list { display:grid; gap:7px; margin-top:14px; }
.user-list-item { width:100%; border:1px solid #30363d; background:#171b1f; border-radius:11px; padding:9px; display:flex; align-items:center; gap:10px; text-align:left; cursor:pointer; color:#fff; }
.user-list-item:hover, .user-list-item.active { border-color:#c82027; background:#20252a; }
.user-list-avatar { width:34px; height:34px; flex:0 0 34px; border-radius:9px; display:grid; place-items:center; background:#c82027; color:#fff; font-weight:800; }
.user-list-copy { min-width:0; }
.user-list-copy strong { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-list-copy small { display:block; color:#8b9299; margin-top:4px; font-size:10px; }
.user-editor-form { margin-top:14px; }
.user-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.user-form-grid .field span { display:block; color:#959ca3; font-size:11px; margin-bottom:5px; }
.user-form-grid input { width:100%; box-sizing:border-box; min-height:39px; background:#15191d; border:1px solid #353c43; border-radius:9px; color:#f2f3f4; padding:8px 10px; outline:none; }
.user-form-grid input:focus { border-color:#c82027; box-shadow:0 0 0 2px rgba(200,32,39,.14); }
.user-active-line { display:flex; align-items:center; gap:8px; margin:13px 0 16px; color:#d3d6d9; font-size:12px; }
.user-active-line input { width:17px; height:17px; accent-color:#c82027; }
.user-access-head { padding-top:14px; border-top:1px solid #30363d; }
.user-access-actions { display:flex; gap:6px; }
.user-access-actions .btn { min-height:31px; padding:5px 9px; font-size:10px; }
.user-access-grid { margin-top:10px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.user-access-item { display:flex; align-items:center; gap:9px; min-height:38px; padding:7px 9px; border:1px solid #30363d; border-radius:9px; background:#171b1f; color:#d9dcdf; font-size:11px; }
.user-access-item input { width:17px; height:17px; accent-color:#c82027; flex:0 0 auto; }
.user-access-item.is-disabled { opacity:.68; }
.user-editor-note { margin-top:11px; min-height:16px; color:#858c93; font-size:10px; line-height:1.45; }
.user-editor-buttons { display:flex; gap:8px; margin-top:14px; }
@media(max-width:1050px){ .users-workspace{grid-template-columns:1fr}.current-user-copy{display:none} }
@media(max-width:680px){ .user-form-grid,.user-access-grid{grid-template-columns:1fr}.user-access-head{align-items:flex-start;flex-direction:column} }
@media print { .auth-gate, .current-user, .users-page { display:none !important; } }


/* V14.4 MAIN — grouped sidebar navigation */
.nav { display:grid; gap:8px; align-content:start; }
.nav-group { display:grid; gap:0; min-width:0; }
.nav-group-toggle {
  width:100%; min-height:46px; border:1px solid transparent; border-radius:12px;
  padding:8px 10px; background:transparent; color:#f1f3f5; cursor:pointer;
  display:grid; grid-template-columns:28px 1fr 22px; gap:8px; align-items:center;
  text-align:left; transition:background .18s ease,border-color .18s ease,color .18s ease;
}
.nav-group-toggle:hover { background:#282c31; border-color:#343a40; }
.nav-group-marker {
  width:30px; height:30px; border-radius:9px; display:grid; place-items:center;
  background:linear-gradient(180deg,#2d3137 0%, #252a30 100%);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 10px rgba(0,0,0,.18);
  overflow:hidden;
}
.nav-group-marker img { display:block; width:18px; height:18px; object-fit:contain; }
.nav-group-title { font-size:13px; font-weight:900; letter-spacing:.015em; }
.nav-group-chevron { justify-self:end; width:20px; height:20px; display:grid; place-items:center; transform:rotate(0deg); transition:transform .25s ease, opacity .18s ease; opacity:.84; }
.nav-group-chevron img { display:block; width:15px; height:15px; object-fit:contain; }
.nav-group.is-open .nav-group-chevron { transform:rotate(90deg); opacity:1; }
.nav-group.is-open .nav-group-toggle { background:#23272c; border-color:#30363d; }
.nav-group-content {
  display:grid; gap:4px; overflow:hidden; max-height:0; opacity:0;
  padding-left:8px; margin-top:0; transform:translateY(-4px);
  transition:max-height .3s ease,opacity .22s ease,transform .3s ease,margin-top .3s ease;
}
.nav-group.is-open .nav-group-content { max-height:410px; opacity:1; transform:none; margin-top:5px; }
.nav-group-content .nav-item { min-height:46px; padding-top:5px; padding-bottom:5px; border-radius:11px; }
.nav-group-content .nav-icon { width:34px; height:34px; flex-basis:34px; border-radius:8px; }
.nav-group-content .nav-item > span:last-child { font-size:12.5px; }
.nav-item-standalone { margin-top:3px; border-top:1px solid #2e3339; border-radius:0 0 13px 13px; padding-top:11px; }
.nav-group[hidden] { display:none !important; }
@media (prefers-reduced-motion: reduce) {
  .nav-group-content,.nav-group-chevron { transition:none !important; }
}

/* V14.5 MAIN — local corporate chat */
.chat-nav-item { position:relative; }
.chat-nav-label { flex:1; }
.chat-nav-badge {
  margin-left:auto; min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  background:#d1222a; color:#fff; display:inline-flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:900; line-height:1; box-shadow:0 3px 9px rgba(209,34,42,.25);
}
.chat-page { min-width:0; }
.chat-local-note {
  margin:0 0 14px; padding:10px 13px; border:1px solid #ead2d4; border-left:4px solid var(--accent);
  border-radius:10px; background:#fff8f8; display:flex; gap:8px; align-items:flex-start;
  font-size:11px; line-height:1.45; color:#565b61;
}
.chat-local-note strong { color:#a91d23; white-space:nowrap; }
.chat-workspace {
  padding:0 !important; display:grid; grid-template-columns:310px minmax(0,1fr); overflow:hidden;
  min-height:650px; height:calc(100vh - 190px); border-radius:16px;
}
.chat-sidebar {
  min-width:0; background:#1d2024; color:#fff; border-right:1px solid #30353b;
  display:flex; flex-direction:column; overflow:hidden;
}
.chat-sidebar-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 15px 10px; }
.chat-sidebar-head h2 { color:#fff; margin:2px 0 0; font-size:19px; }
.chat-sidebar-head .eyebrow { color:#d1222a; }
.chat-new-button {
  width:36px; height:36px; border:0; border-radius:10px; background:#d1222a; color:#fff;
  font-size:25px; line-height:1; font-weight:400; cursor:pointer; box-shadow:0 6px 16px rgba(209,34,42,.25);
}
.chat-new-button:hover { background:#b91c23; }
.chat-search { margin:0 12px 10px; height:38px; border:1px solid #363c43; border-radius:10px; background:#25292e; display:flex; align-items:center; gap:7px; padding:0 10px; color:#8e959d; }
.chat-search input { height:34px; min-width:0; padding:0; border:0; border-radius:0; background:transparent; color:#fff; box-shadow:none !important; }
.chat-search input::placeholder { color:#818891; }
.chat-search span { font-size:16px; }
.chat-conversation-list { flex:1; min-height:0; overflow:auto; padding:0 7px 10px; }
.chat-conversation {
  width:100%; border:0; border-radius:11px; padding:9px 8px; background:transparent; color:#dce0e4;
  display:grid; grid-template-columns:42px minmax(0,1fr) auto; gap:9px; align-items:center; text-align:left; cursor:pointer;
}
.chat-conversation:hover { background:#272c31; }
.chat-conversation.active { background:#30353b; box-shadow:inset 3px 0 #d1222a; }
.chat-conversation-avatar,.chat-user-avatar {
  width:40px; height:40px; border-radius:12px; display:grid; place-items:center; flex:0 0 auto;
  background:#3a4047; color:#fff; font-size:12px; font-weight:900;
}
.chat-conversation-avatar.group { background:#9c2228; }
.chat-conversation-copy { min-width:0; display:grid; gap:4px; }
.chat-conversation-copy strong { font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-conversation-copy small { color:#8f969e; font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-conversation-meta { align-self:stretch; display:flex; flex-direction:column; align-items:flex-end; justify-content:center; gap:6px; }
.chat-conversation-meta time { color:#7e868f; font-size:9px; }
.chat-conversation-meta b { min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#d1222a; color:#fff; display:grid; place-items:center; font-size:9px; }
.chat-list-empty { padding:22px 12px; text-align:center; color:#7f878f; font-size:11px; line-height:1.5; }
.chat-main { min-width:0; background:#f3f4f5; display:flex; flex-direction:column; }
.chat-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:#80868d; padding:30px; text-align:center; }
.chat-empty-icon { width:62px; height:62px; border-radius:20px; display:grid; place-items:center; background:#e5e7e9; color:#b1252b; font-size:27px; }
.chat-empty strong { color:#34383d; font-size:16px; }
.chat-empty span { font-size:11px; }
.chat-thread { flex:1; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto auto; }
.chat-thread-head { min-height:68px; padding:11px 16px; background:#fff; border-bottom:1px solid #dfe2e5; display:flex; align-items:center; gap:10px; }
.chat-thread-avatar { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:#2a2f35; color:#fff; font-weight:900; font-size:12px; }
.chat-thread-copy { min-width:0; display:grid; gap:3px; }
.chat-thread-copy strong { font-size:14px; color:#1e2226; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-thread-copy span { font-size:10px; color:#8a9096; }
.chat-messages { min-height:0; overflow:auto; padding:18px 20px; background:linear-gradient(180deg,#f4f5f6 0%,#eef0f1 100%); }
.chat-thread-empty { padding:25px; text-align:center; color:#9a9fa4; font-size:11px; }
.chat-date-sep { display:flex; justify-content:center; margin:10px 0 14px; }
.chat-date-sep span { padding:5px 9px; border-radius:999px; background:#dfe2e4; color:#686e74; font-size:9px; font-weight:800; }
.chat-message-row { display:flex; justify-content:flex-start; margin:5px 0; }
.chat-message-row.own { justify-content:flex-end; }
.chat-bubble { max-width:min(72%,680px); min-width:88px; padding:8px 10px 6px; border-radius:13px 13px 13px 4px; background:#fff; border:1px solid #dde0e3; box-shadow:0 3px 9px rgba(24,28,32,.06); }
.chat-message-row.own .chat-bubble { background:#262b30; color:#fff; border-color:#262b30; border-radius:13px 13px 4px 13px; }
.chat-sender { margin-bottom:4px; color:#b32128; font-size:9px; font-weight:900; }
.chat-message-text { font-size:12px; line-height:1.42; overflow-wrap:anywhere; word-break:break-word; white-space:normal; }
.chat-message-time { text-align:right; margin-top:4px; color:#9ba0a5; font-size:8.5px; }
.chat-message-row.own .chat-message-time { color:#8f969d; }
.chat-files { display:grid; gap:5px; margin-top:6px; }
.chat-file { min-width:210px; max-width:100%; border:1px solid #dadddf; border-radius:9px; padding:7px 8px; background:#f5f6f7; color:#30353a; display:flex; align-items:center; gap:7px; text-align:left; cursor:pointer; }
.chat-message-row.own .chat-file { border-color:#41474e; background:#30363c; color:#fff; }
.chat-file > span:last-child { min-width:0; display:grid; gap:1px; }
.chat-file strong { font-size:9.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-file small { font-size:8.5px; color:#92999f; }
.chat-pending-files { padding:7px 12px; border-top:1px solid #dddfe1; background:#fff; display:flex; gap:6px; flex-wrap:wrap; }
.chat-pending-file { max-width:250px; padding:5px 7px; border:1px solid #dedfe1; border-radius:8px; background:#f6f7f8; display:flex; align-items:center; gap:6px; }
.chat-pending-file > span:nth-child(2) { min-width:0; display:grid; }
.chat-pending-file strong { font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-pending-file small { font-size:8px; color:#8d9399; }
.chat-pending-file button { width:19px; height:19px; border:0; background:transparent; color:#a9adb1; cursor:pointer; }
.chat-compose { padding:9px 12px; background:#fff; border-top:1px solid #dfe2e5; display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:7px; align-items:end; }
.chat-compose textarea { width:100%; min-height:38px; max-height:130px; resize:none; border:1px solid #d7dade; border-radius:11px; padding:9px 10px; font:inherit; font-size:11px; line-height:1.35; outline:none; }
.chat-compose textarea:focus { border-color:#c9272e; box-shadow:0 0 0 3px rgba(201,39,46,.08); }
.chat-attach { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; background:#eef0f1; cursor:pointer; font-size:16px; }
.chat-attach:hover { background:#e3e5e7; }
.chat-attach input { display:none; }
.chat-send { min-height:38px; padding:0 14px; border:0; border-radius:10px; background:#d1222a; color:#fff; font-size:11px; font-weight:900; cursor:pointer; }
.chat-send:hover { background:#b91c23; }
.chat-send:disabled { opacity:.55; cursor:wait; }
.chat-modal[hidden] { display:none !important; }
.chat-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; }
.chat-modal-backdrop { position:absolute; inset:0; background:rgba(10,12,14,.72); backdrop-filter:blur(2px); }
.chat-modal-card { position:relative; width:min(520px,100%); max-height:min(680px,90vh); overflow:auto; border:1px solid #343940; border-radius:17px; background:#1d2024; color:#fff; padding:17px; box-shadow:0 25px 65px rgba(0,0,0,.45); }
.chat-modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:13px; }
.chat-modal-head h2 { color:#fff; margin:2px 0 0; }
.chat-modal-close { width:32px; height:32px; border:0; border-radius:9px; background:#292e34; color:#c6cbd0; font-size:20px; cursor:pointer; }
.chat-type-switch { display:grid; grid-template-columns:1fr 1fr; padding:3px; border-radius:10px; background:#272c31; margin-bottom:12px; }
.chat-type-switch button { min-height:34px; border:0; border-radius:8px; background:transparent; color:#9fa5ac; font-size:11px; font-weight:900; cursor:pointer; }
.chat-type-switch button.active { background:#d1222a; color:#fff; }
.chat-modal-search { margin:0 0 9px; }
.chat-user-picker,.chat-group-users { display:grid; gap:5px; max-height:340px; overflow:auto; }
.chat-user-option,.chat-group-user { width:100%; border:1px solid #333940; border-radius:10px; background:#24282d; color:#e9ecef; padding:8px; display:flex; align-items:center; gap:9px; text-align:left; cursor:pointer; }
.chat-user-option:hover,.chat-group-user:hover { background:#2a2f35; border-color:#444b53; }
.chat-user-option > span:last-child,.chat-group-user > span:last-child { min-width:0; display:grid; gap:2px; }
.chat-user-option strong,.chat-group-user strong { font-size:11px; }
.chat-user-option small,.chat-group-user small { color:#868d95; font-size:9px; }
.chat-user-avatar { width:34px; height:34px; border-radius:10px; font-size:10px; }
.chat-group-create .field span { color:#a4abb2; font-size:10px; margin-bottom:5px; }
.chat-group-create .field input { background:#252a2f; border-color:#3a4047; color:#fff; }
.chat-group-label { margin:13px 0 7px; color:#9aa1a8; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.chat-group-user input { width:16px; height:16px; flex:0 0 16px; accent-color:#d1222a; }
.chat-group-create .btn { width:100%; margin-top:13px; }
body.chat-mode #btnNewProject,
body.chat-mode #btnSaveProject,
body.chat-mode .export-menu-wrap,
body.chat-mode #btnPrint { display:none !important; }
@media(max-width:980px){
  .chat-workspace { grid-template-columns:260px minmax(0,1fr); }
  .chat-bubble { max-width:82%; }
}
@media(max-width:720px){
  .chat-workspace { grid-template-columns:1fr; height:auto; min-height:0; }
  .chat-sidebar { min-height:300px; max-height:420px; border-right:0; border-bottom:1px solid #30353b; }
  .chat-main { min-height:520px; }
  .chat-bubble { max-width:90%; }
  .chat-local-note { display:block; }
  .chat-local-note strong { display:block; margin-bottom:3px; }
}
@media print {
  .chat-page,.chat-modal { display:none !important; }
}

/* V14.5.1 — respect chat empty/thread visibility */
.chat-thread[hidden],
.chat-empty[hidden] {
  display: none !important;
}


/* V14.5.2 — chat drag & drop and local hide */
.chat-thread { position:relative; }
.chat-thread-head { gap:10px; }
.chat-thread-copy { min-width:0; flex:1; }
.chat-delete-button {
  margin-left:auto; min-height:32px; padding:0 10px; border:1px solid #e1e3e5; border-radius:9px;
  background:#fff; color:#747a80; display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  font-size:9px; font-weight:800; white-space:nowrap; transition:.16s ease;
}
.chat-delete-button > span:first-child { color:#c82027; font-size:15px; line-height:1; }
.chat-delete-button:hover { border-color:#d8a7aa; background:#fff7f7; color:#b72027; }
.chat-drop-overlay[hidden] { display:none !important; }
.chat-drop-overlay {
  position:absolute; inset:0; z-index:25; display:grid; place-items:center; pointer-events:none;
  background:rgba(246,247,248,.91); border:2px dashed #c82027; border-radius:0 0 14px 0;
  backdrop-filter:blur(2px);
}
.chat-drop-overlay > div { min-width:260px; padding:24px 30px; border-radius:16px; background:#fff; border:1px solid #e2e4e6; box-shadow:0 16px 45px rgba(0,0,0,.14); text-align:center; }
.chat-drop-overlay strong { display:block; color:#c82027; font-size:17px; margin-bottom:6px; }
.chat-drop-overlay span { color:#7c838a; font-size:10px; }
.chat-thread.is-dragover .chat-compose { box-shadow:inset 0 3px 0 #c82027; }
@media(max-width:720px){ .chat-delete-button > span:last-child{display:none}.chat-delete-button{width:34px;padding:0;justify-content:center}.chat-drop-overlay>div{min-width:0;width:min(82%,320px)} }

/* V14.6 MAIN — reminders and activity log */
.reminder-bell {
  position:relative; width:40px; height:40px; border:1px solid #353a40; border-radius:10px;
  background:#25292e; color:#fff; display:grid; place-items:center; cursor:pointer; font-size:17px;
}
.reminder-bell:hover { background:#2d3238; }
.reminder-bell b {
  position:absolute; top:-6px; right:-6px; min-width:19px; height:19px; padding:0 5px; border-radius:10px;
  display:grid; place-items:center; background:#d5202a; color:#fff; font-size:10px; box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.reminders-nav-item,.activity-nav-item { position:relative; }
.reminder-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.reminder-tabs button {
  min-height:38px; border:1px solid #d9dce0; border-radius:10px; background:#fff; padding:0 12px;
  font-weight:800; color:#444a50; cursor:pointer;
}
.reminder-tabs button b { margin-left:6px; min-width:20px; display:inline-grid; place-items:center; border-radius:10px; background:#eceef0; color:#555; padding:2px 6px; }
.reminder-tabs button.active { background:#1d2024; color:#fff; border-color:#1d2024; }
.reminder-tabs button.active b { background:#d5202a; color:#fff; }
.reminders-workspace { display:grid; grid-template-columns:minmax(360px,460px) minmax(0,1fr); gap:16px; align-items:start; }
.reminder-editor { position:sticky; top:86px; padding:18px; }
.reminder-editor-head,.reminder-list-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.reminder-editor-head h2,.reminder-list-head h2 { margin:2px 0 0; }
.reminder-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; margin-top:14px; }
.reminder-span-2 { grid-column:1/-1; }
.reminder-form textarea,.reminder-complete-card textarea { width:100%; resize:vertical; min-height:94px; border:1px solid #d9dce0; border-radius:10px; padding:10px 11px; font:inherit; color:#202328; }
.reminder-editor-actions { display:flex; gap:8px; margin-top:14px; }
.reminder-list-card { padding:18px; min-width:0; }
.reminder-search { width:min(390px,52%); height:40px; border:1px solid #d9dce0; border-radius:10px; display:flex; align-items:center; gap:7px; padding:0 10px; background:#fff; }
.reminder-search input { border:0; height:36px; padding:0; box-shadow:none !important; }
.reminder-list { display:grid; gap:10px; margin-top:14px; }
.reminder-empty { min-height:190px; display:grid; place-items:center; color:#858b92; border:1px dashed #d4d7da; border-radius:12px; }
.reminder-card { position:relative; border:1px solid #d7dade; border-left:5px solid #747b82; border-radius:12px; padding:14px 15px; background:#fff; }
.reminder-card.priority-important { border-left-color:#e18a1d; }
.reminder-card.priority-urgent,.reminder-card.is-overdue { border-left-color:#d5202a; }
.reminder-card.is-overdue { background:#fffafa; }
.reminder-card.is-completed { opacity:.78; background:#f7f8f9; border-left-color:#4f925d; }
.reminder-card-top { display:flex; justify-content:space-between; gap:12px; color:#747b82; font-size:11px; font-weight:800; }
.reminder-card.is-overdue .reminder-time { color:#c81f28; }
.reminder-type { text-transform:uppercase; letter-spacing:.04em; color:#c81f28; }
.reminder-card h3 { margin:7px 0 10px; font-size:16px; line-height:1.3; }
.reminder-meta { display:flex; flex-wrap:wrap; gap:7px 14px; font-size:12px; color:#4b5056; }
.reminder-meta a { color:#b51e24; font-weight:800; text-decoration:none; }
.reminder-card p { margin:10px 0 0; padding:9px 10px; border-radius:8px; background:#f3f4f5; font-size:12px; line-height:1.45; }
.reminder-result { margin-top:10px; padding:9px 10px; border-left:3px solid #4f925d; background:#f1f7f2; font-size:12px; }
.reminder-people { margin-top:11px; padding-top:9px; border-top:1px solid #e4e6e8; display:flex; flex-wrap:wrap; gap:7px 14px; color:#777d83; font-size:10.5px; }
.reminder-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.reminder-complete-modal[hidden] { display:none !important; }
.reminder-complete-modal { position:fixed; inset:0; z-index:160; display:grid; place-items:center; padding:20px; }
.reminder-modal-backdrop { position:absolute; inset:0; background:rgba(13,15,18,.62); backdrop-filter:blur(3px); }
.reminder-complete-card { position:relative; width:min(620px,100%); background:#fff; border-radius:16px; padding:20px; box-shadow:0 25px 80px rgba(0,0,0,.36); }
.reminder-complete-head { display:flex; justify-content:space-between; align-items:flex-start; gap:15px; margin-bottom:14px; }
.reminder-complete-head h2 { margin:3px 0 0; }
.reminder-complete-head>button { border:0; background:#eceef0; width:34px; height:34px; border-radius:9px; font-size:20px; cursor:pointer; }
.reminder-followup-toggle { margin:13px 0; padding:11px; border:1px solid #dddfe2; border-radius:10px; display:flex; align-items:center; gap:9px; font-size:12px; font-weight:800; }
.reminder-followup-toggle input { width:18px; height:18px; }
.reminder-followup-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.activity-card { padding:18px; }
.activity-toolbar { display:grid; grid-template-columns:minmax(220px,1.6fr) repeat(2,minmax(160px,1fr)) 145px 145px auto; gap:9px; align-items:end; }
.activity-toolbar label { display:grid; gap:5px; }
.activity-toolbar label>span { font-size:10px; font-weight:800; color:#6b7178; }
.activity-meta { display:flex; justify-content:space-between; gap:12px; margin:14px 0 8px; color:#777d83; font-size:11px; }
.activity-meta strong { color:#202328; }
.activity-log-list { border:1px solid #d9dce0; border-radius:12px; overflow:hidden; }
.activity-row { display:grid; grid-template-columns:145px minmax(180px,240px) 1fr; gap:14px; align-items:center; padding:11px 13px; border-bottom:1px solid #e4e6e8; background:#fff; }
.activity-row:last-child { border-bottom:0; }
.activity-row time { font-size:11px; color:#777d83; }
.activity-person,.activity-main { min-width:0; display:grid; gap:3px; }
.activity-person strong,.activity-main strong { font-size:12px; }
.activity-person span { font-size:10px; color:#c51e27; font-weight:800; }
.activity-main span { color:#666c72; font-size:11px; line-height:1.4; word-break:break-word; }
.activity-empty { min-height:220px; display:grid; place-items:center; color:#858b92; background:#fff; }

@media(max-width:1250px){
  .reminders-workspace{grid-template-columns:1fr}.reminder-editor{position:static}.activity-toolbar{grid-template-columns:1fr 1fr 1fr}.activity-toolbar .btn{align-self:end}
}
@media(max-width:760px){
  .reminder-form-grid,.reminder-followup-fields{grid-template-columns:1fr}.reminder-span-2{grid-column:auto}.reminder-list-head{flex-direction:column}.reminder-search{width:100%}.activity-toolbar{grid-template-columns:1fr}.activity-row{grid-template-columns:1fr;gap:5px}.activity-meta{flex-direction:column}
}
@media print {
  .reminders-page,.activity-page,.reminder-complete-modal,.reminder-bell { display:none !important; }
}
body.reminders-mode #btnNewProject,
body.reminders-mode #btnSaveProject,
body.reminders-mode .export-menu-wrap,
body.reminders-mode #btnPrint,
body.activity-mode #btnNewProject,
body.activity-mode #btnSaveProject,
body.activity-mode .export-menu-wrap,
body.activity-mode #btnPrint { display:none !important; }


/* V14.6.1 — visible locked sections + simplified reminder follow-up */
.nav-item.is-access-locked {
  opacity:.52;
  cursor:not-allowed;
  color:#8c9299;
  transform:none !important;
  background:transparent !important;
}
.nav-item.is-access-locked:hover { color:#8c9299; background:transparent !important; transform:none !important; }
.nav-item.is-access-locked .nav-icon { filter:grayscale(.7); opacity:.72; box-shadow:none; }
.nav-access-lock { margin-left:auto; width:18px; height:18px; flex:0 0 18px; display:grid; place-items:center; }
.nav-access-lock img { display:block; width:15px; height:15px; padding:0 !important; opacity:.92; }
.nav-group-toggle { grid-template-columns:30px minmax(0,1fr) auto 20px; }
.nav-group-access-lock { grid-column:3; width:17px; height:17px; display:grid; place-items:center; }
.nav-group-access-lock img { display:block; width:14px; height:14px; }
.nav-group.is-access-locked-group .nav-group-title { color:#a2a8af; }
.nav-group.is-access-locked-group .nav-group-marker { opacity:.62; filter:grayscale(.7); }
.reminder-followup-fields-single { grid-template-columns:1fr; }
.reminder-followup-fields-single .field { max-width:100%; }

.nav-group-toggle .nav-group-chevron { grid-column:4; }


/* ==== Premium Chat UI v14.7 ==== */
.chat-screen-heading{margin-bottom:14px}
.chat-local-note{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:1px solid #2f343a;border-radius:16px;background:linear-gradient(180deg,#20252a 0%,#181d22 100%);color:#d0d5db;box-shadow:0 12px 28px rgba(7,10,13,.18);margin-bottom:14px}
.chat-local-note strong{color:#fff}.chat-local-note span{font-size:11px;line-height:1.5;color:#b4bbc2}
.chat-workspace{height:min(79vh,860px);border:1px solid #272c31;border-radius:24px;overflow:hidden;background:#101417;box-shadow:0 24px 60px rgba(8,11,14,.18)}
.chat-sidebar{background:linear-gradient(180deg,#171b20 0%,#11161a 100%);color:#fff;border-right:1px solid rgba(255,255,255,.05);padding:18px 16px 16px}
.chat-sidebar-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.chat-sidebar-head h2{color:#fff;font-size:26px;letter-spacing:-.02em;margin:2px 0 0}.chat-sidebar-head p{margin:6px 0 0;color:#919aa3;font-size:11px;line-height:1.5}
.chat-new-button{display:inline-flex;align-items:center;gap:8px;padding:0 14px;height:42px;border-radius:14px;border:1px solid rgba(255,255,255,.07);background:linear-gradient(180deg,#e1262d 0%,#c41921 100%);box-shadow:0 12px 24px rgba(209,34,42,.24);color:#fff;font-weight:900;font-size:11px;cursor:pointer;white-space:nowrap}
.chat-new-button img{width:16px;height:16px}.chat-new-button:hover{transform:translateY(-1px);box-shadow:0 16px 28px rgba(209,34,42,.28)}
.chat-search{display:flex;align-items:center;gap:10px;height:46px;padding:0 14px;border:1px solid rgba(255,255,255,.07);background:#20262c;border-radius:14px;margin:0 0 14px;color:#9098a1;box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}
.chat-search-icon{display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px}.chat-search-icon img{width:18px;height:18px}
.chat-search input{background:transparent;border:0;outline:0;color:#fff;font-size:12px}.chat-search input::placeholder{color:#78808a}
.chat-conversation-list{display:grid;gap:8px;padding-right:2px}
.chat-conversation{position:relative;display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid rgba(255,255,255,.04);border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.035) 0%,rgba(255,255,255,.02) 100%);text-align:left;cursor:pointer;transition:transform .16s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease}
.chat-conversation:hover{transform:translateY(-1px);border-color:rgba(225,38,45,.45);background:#1d2329;box-shadow:0 10px 22px rgba(0,0,0,.18)}
.chat-conversation.active{border-color:#e1262d;background:linear-gradient(180deg,#252227 0%,#20171a 100%);box-shadow:0 16px 32px rgba(225,38,45,.15)}
.chat-conversation.active:before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:4px;border-radius:0 99px 99px 0;background:#e1262d}
.chat-conversation-avatar{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,#353b42 0%,#22272d 100%);color:#fff;font-size:14px;font-weight:900;display:grid;place-items:center;letter-spacing:.04em;box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
.chat-conversation-avatar.group{background:linear-gradient(135deg,#e1262d 0%,#8e1319 100%)}
.chat-conversation-copy strong{display:block;color:#fff;font-size:12.5px;margin-bottom:3px}.chat-conversation-copy small{display:block;color:#98a1aa;font-size:10px;line-height:1.4}
.chat-conversation-meta time{color:#7d8791;font-size:9px;font-weight:700}.chat-conversation-meta b{min-width:20px;height:20px;padding:0 6px;background:#e1262d;font-size:9px;box-shadow:0 6px 14px rgba(225,38,45,.24)}
.chat-list-empty{padding:36px 16px;border:1px dashed rgba(255,255,255,.09);border-radius:16px;background:rgba(255,255,255,.02);color:#8a949d}
.chat-main{background:#f4f6f8;display:flex;flex-direction:column;min-width:0}
.chat-empty{background:radial-gradient(circle at top,#ffffff 0%,#f4f6f8 42%,#eef1f4 100%)}
.chat-empty-icon{width:84px;height:84px;border-radius:26px;background:linear-gradient(180deg,#ffffff 0%,#f2f4f6 100%);box-shadow:0 18px 36px rgba(0,0,0,.09), inset 0 1px 0 rgba(255,255,255,.85)}
.chat-empty-icon img{width:36px;height:36px}.chat-empty strong{font-size:20px}.chat-empty span{max-width:360px;font-size:12px;line-height:1.55}
.chat-thread{grid-template-rows:auto minmax(0,1fr) auto auto;background:#eef2f5}
.chat-thread-head{min-height:82px;padding:16px 22px;background:rgba(255,255,255,.88);backdrop-filter:blur(8px);border-bottom:1px solid #e3e7eb;box-shadow:0 6px 18px rgba(0,0,0,.04)}
.chat-thread-avatar{width:52px;height:52px;border-radius:18px;background:linear-gradient(135deg,#1d2329 0%,#363e46 100%);color:#fff;font-size:13px;letter-spacing:.04em;box-shadow:0 12px 22px rgba(0,0,0,.12)}
.chat-thread-copy strong{font-size:16px;color:#14181c}.chat-thread-copy span{font-size:11px;color:#7e8790}
.chat-thread-actions{margin-left:auto;display:flex;align-items:center;gap:10px}.chat-info-button{width:40px;height:40px;border-radius:12px;border:1px solid #e0e4e8;background:#fff;display:grid;place-items:center;cursor:default;box-shadow:0 8px 18px rgba(0,0,0,.05)}.chat-info-button img{width:18px;height:18px}
.chat-delete-button{height:40px;padding:0 14px;border-radius:12px;border:1px solid #ead2d4;background:#fff;display:inline-flex;align-items:center;gap:10px;color:#9d2027;font-size:11px;font-weight:800;box-shadow:0 8px 18px rgba(0,0,0,.04)}
.chat-delete-icon{display:grid;place-items:center;width:16px;height:16px}.chat-delete-icon img{width:16px;height:16px}.chat-delete-button:hover{border-color:#e9bcc0;background:#fff8f8}
.chat-messages{padding:24px 24px 18px;background:radial-gradient(circle at top left,rgba(255,255,255,.65) 0%,rgba(255,255,255,0) 28%),linear-gradient(180deg,#f4f7f9 0%,#eef2f5 100%)}
.chat-thread-empty{padding:42px 28px;border:1px dashed #d9dee3;border-radius:20px;background:rgba(255,255,255,.55);font-size:12px}
.chat-date-sep{margin:16px 0 18px}.chat-date-sep span{padding:7px 12px;border-radius:999px;background:#dde4ea;color:#68727b;font-size:9px;letter-spacing:.06em;text-transform:uppercase;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.chat-message-row{margin:7px 0 12px}.chat-bubble{max-width:min(74%,720px);min-width:110px;padding:12px 14px 10px;border:1px solid #dde4ea;border-radius:22px 22px 22px 8px;background:#fff;box-shadow:0 10px 24px rgba(17,22,26,.06)}
.chat-message-row.own .chat-bubble{background:linear-gradient(180deg,#23282e 0%,#1d2328 100%);color:#fff;border-color:#23282e;border-radius:22px 22px 8px 22px;box-shadow:0 12px 28px rgba(13,18,22,.18)}
.chat-sender{display:inline-flex;align-items:center;gap:6px;margin-bottom:6px;color:#c51f27;font-size:9px;font-weight:900;letter-spacing:.04em;text-transform:uppercase}.chat-sender:before{content:"";width:6px;height:6px;border-radius:50%;background:#e1262d}
.chat-message-text{font-size:12.5px;line-height:1.58}.chat-message-time{text-align:right;margin-top:7px;font-size:8.5px;font-weight:700;color:#98a2ab}.chat-message-row.own .chat-message-time{color:#8f98a1}
.chat-files{display:grid;gap:7px;margin-top:10px}.chat-file{min-width:250px;max-width:100%;border:1px solid #e3e7eb;border-radius:14px;padding:10px 11px;background:#f6f8fa;color:#1f252b;display:flex;align-items:center;gap:10px;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.chat-message-row.own .chat-file{border-color:#39424a;background:#2b3239;color:#fff;box-shadow:none}.chat-file-ico{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;border-radius:12px;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.06)}.chat-message-row.own .chat-file-ico{background:#20262b}.chat-file-ico img{width:20px;height:20px}.chat-file-copy{min-width:0;display:grid;gap:2px}.chat-file strong{font-size:10px}.chat-file small{font-size:8.5px;color:#87919a}.chat-message-row.own .chat-file small{color:#b7c0c8}
.chat-pending-files{padding:10px 16px;border-top:1px solid #e3e6ea;background:#fff;display:flex;gap:8px;flex-wrap:wrap}.chat-pending-file{max-width:280px;padding:7px 9px;border:1px solid #e2e6ea;border-radius:12px;background:#f6f8fa;display:flex;align-items:center;gap:8px}.chat-pending-file strong{font-size:9.5px}.chat-pending-file small{font-size:8px;color:#8d949c}.chat-pending-file button{width:22px;height:22px;border:0;border-radius:8px;background:#eceff2;color:#90979e;cursor:pointer}
.chat-compose{padding:14px 16px 16px;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-top:1px solid #e2e6ea;grid-template-columns:46px minmax(0,1fr) auto;gap:10px;align-items:end;box-shadow:0 -10px 24px rgba(0,0,0,.04)}
.chat-compose textarea{min-height:48px;max-height:160px;border:1px solid #dfe5ea;border-radius:16px;padding:13px 14px;background:#fff;font-size:12px;line-height:1.5;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.chat-compose textarea:focus{border-color:#e1262d;box-shadow:0 0 0 4px rgba(225,38,45,.08)}
.chat-attach{width:46px;height:46px;border-radius:14px;border:1px solid #e0e4e8;background:#fff;box-shadow:0 8px 18px rgba(0,0,0,.05)}.chat-attach span{display:grid;place-items:center}.chat-attach img{width:20px;height:20px}.chat-attach:hover{background:#f7f8f9}
.chat-send{min-height:46px;padding:0 16px;border-radius:14px;background:linear-gradient(180deg,#e1262d 0%,#c81b23 100%);display:inline-flex;align-items:center;gap:9px;box-shadow:0 14px 26px rgba(225,38,45,.22)}.chat-send img{width:16px;height:16px}.chat-send span{font-size:11px;font-weight:900}
.chat-modal-card{width:min(560px,100%);border-radius:22px;background:linear-gradient(180deg,#1c2025 0%,#171b20 100%);padding:20px 20px 18px}.chat-modal-head h2{font-size:24px}.chat-type-switch{border-radius:14px;padding:4px;background:#262b30}.chat-type-switch button{min-height:38px;border-radius:11px;font-size:11px}.chat-user-picker,.chat-group-users{gap:8px}.chat-user-option,.chat-group-user{padding:10px;border-radius:14px}.chat-user-avatar{border-radius:12px;background:linear-gradient(135deg,#353b42 0%,#24292f 100%);color:#fff;display:grid;place-items:center;font-weight:800}
.chat-drop-overlay{background:rgba(17,21,25,.4);backdrop-filter:blur(2px)}.chat-drop-overlay>div{border-radius:22px;padding:28px 34px;background:#fff;border:1px solid #e2e5e8;box-shadow:0 28px 56px rgba(0,0,0,.18)}.chat-drop-overlay strong{font-size:18px}
@media(max-width:980px){.chat-workspace{height:auto;min-height:0}.chat-sidebar-head h2{font-size:22px}.chat-thread-head{padding:14px 16px}.chat-messages{padding:18px 16px 14px}.chat-bubble{max-width:86%}}
@media(max-width:720px){.chat-local-note{display:block}.chat-workspace{border-radius:18px}.chat-sidebar{padding:14px}.chat-new-button span,.chat-delete-button span:last-child,.chat-send span{display:none}.chat-new-button,.chat-send{padding:0;width:42px;justify-content:center}.chat-thread-head{min-height:74px}.chat-thread-actions{gap:8px}.chat-bubble{max-width:92%}.chat-file{min-width:0}}


/* ==== Chat hotfix v14.7.1 ==== */
.chat-sidebar-head{align-items:center}
.chat-sidebar-head>div{min-width:0;flex:1}
.chat-new-button{width:46px !important;min-width:46px !important;height:46px !important;padding:0 !important;justify-content:center !important;border-radius:16px !important;flex:0 0 46px;overflow:hidden}
.chat-new-button span{display:none !important}
.chat-conversation-list{display:grid !important;grid-auto-rows:max-content;align-content:start !important;align-items:start !important;overflow:auto;min-height:0}
.chat-conversation{height:auto !important;min-height:0 !important;align-self:start !important}
.chat-conversation-copy strong,.chat-conversation-copy small{max-width:100%}


/* V14.7.2 — administrator reminder archive */
.archive-nav-badge{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#c82027;color:#fff;display:grid;place-items:center;font-size:9px;font-weight:900}.archive-nav-badge[hidden]{display:none!important}
.archive-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:22px;padding:20px;margin-bottom:12px}.archive-summary h2{margin:2px 0 6px}.archive-summary p{margin:0;color:#7b8289;font-size:11px;line-height:1.5}.archive-search{width:min(430px,44%);display:grid;gap:6px}.archive-search>span{font-size:10px;font-weight:800;color:#6f767d}.archive-search input{height:42px}
.archive-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 4px 10px;color:#81888f;font-size:10px}.archive-meta strong{color:#30353a;font-size:11px}.archive-list{display:grid;gap:12px}.archive-empty{padding:44px;border:1px dashed #d6dade;border-radius:16px;background:#fff;text-align:center;color:#8a9198;font-size:12px}
.archive-card{border:1px solid #d9dde1;border-radius:17px;background:#fff;box-shadow:0 9px 24px rgba(24,28,32,.05);overflow:hidden}.archive-card-head{display:flex;justify-content:space-between;gap:18px;padding:16px 18px 13px;border-bottom:1px solid #e5e8eb;background:linear-gradient(180deg,#fff 0%,#fafbfc 100%)}.archive-type{display:inline-block;color:#c82027;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;margin-bottom:5px}.archive-card h3{margin:0;font-size:15px;color:#20252a}.archive-date{text-align:right;display:grid;gap:3px;flex:0 0 auto}.archive-date span{font-size:9px;color:#92989e}.archive-date strong{font-size:10px;color:#4b5258}
.archive-data{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:#e4e7e9;border-bottom:1px solid #e1e4e7}.archive-data span{display:grid;gap:4px;background:#fff;padding:11px 14px;font-size:10.5px;color:#343a40}.archive-data b{font-size:8.5px;color:#92999f;text-transform:uppercase;letter-spacing:.04em}.archive-note,.archive-result{padding:13px 18px;border-bottom:1px solid #e7eaec}.archive-note b,.archive-result b{display:block;margin-bottom:5px;color:#747b82;font-size:9px;text-transform:uppercase;letter-spacing:.05em}.archive-note p,.archive-result p{margin:0;color:#30363b;font-size:11px;line-height:1.55}.archive-result{border-left:4px solid #c82027;background:#fffafa}.archive-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 18px;background:#f7f8f9}.archive-footer>div{display:flex;gap:14px;flex-wrap:wrap;color:#7d848b;font-size:9.5px}.archive-footer b{color:#363c42}.btn-archive{background:#252b31;color:#fff;border:1px solid #343b42}.btn-archive:hover{background:#c82027;border-color:#c82027}
body.archive-mode #btnNewProject,body.archive-mode #btnSaveProject,body.archive-mode .export-menu-wrap,body.archive-mode #btnPrint{display:none!important}
@media(max-width:900px){.archive-toolbar{align-items:stretch;flex-direction:column}.archive-search{width:100%}.archive-data{grid-template-columns:1fr 1fr}.archive-footer{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.archive-data{grid-template-columns:1fr}.archive-card-head{flex-direction:column}.archive-date{text-align:left}}
@media print{.archive-page{display:none!important}}


/* V14.7.2.1 — strict admin-only navigation visibility */
.archive-nav-item[hidden],
.admin-only-archive[hidden],
.admin-only-nav[hidden] { display:none !important; }

/* V14.7.2.2 — permanent delete in admin archive */
.archive-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.btn-archive-delete{background:#fff;color:#c82027;border:1px solid #e4b7ba}
.btn-archive-delete:hover{background:#c82027;color:#fff;border-color:#c82027}
@media(max-width:600px){.archive-actions{width:100%;justify-content:stretch}.archive-actions .btn{flex:1}}


/* V14.8 — Расчёт транспортных услуг */
.transport-service-layout{display:grid;grid-template-columns:minmax(360px,.9fr) minmax(480px,1.35fr);gap:18px;align-items:stretch}
.transport-service-controls{display:grid;gap:18px;align-content:start}.transport-route-card,.transport-price-card,.transport-map-card,.transport-summary-card{padding:18px}
.transport-section-head,.transport-map-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.transport-section-head h2,.transport-map-head h2{margin:2px 0 0}
.transport-vat-pill{padding:7px 10px;border-radius:999px;background:#fff0f1;color:#c51f27;border:1px solid #f2c9cc;font-size:10px;font-weight:900;white-space:nowrap}
.transport-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.transport-wide{grid-column:1/-1}.transport-build-route{grid-column:1/-1;min-height:44px}
.transport-route-status{grid-column:1/-1;min-height:36px;padding:10px 11px;border-radius:10px;background:#f5f6f7;border:1px solid #e2e4e6;color:#70777e;font-size:10px;line-height:1.45}
.transport-price-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.transport-formula-note{margin-top:12px;padding:11px 12px;border-radius:11px;background:#1d2126;color:#c8cdd2;font-size:10px;line-height:1.5}.transport-formula-note strong{color:#fff}
.transport-map-card{min-width:0;display:flex;flex-direction:column}.transport-map-head{align-items:center}.transport-map-distance{font-size:24px;font-weight:900;color:#c82027;white-space:nowrap}
.transport-map{height:480px;min-height:360px;border-radius:16px;overflow:hidden;border:1px solid #dfe2e5;background:#edf0f2;position:relative}.transport-map-fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;color:#858c93}.transport-map-fallback strong{font-size:18px;color:#333940;margin-bottom:7px}.transport-map-fallback span{max-width:420px;font-size:11px;line-height:1.55}.transport-map-caption{margin-top:9px;color:#8b9299;font-size:9.5px;line-height:1.45}
.transport-results{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:18px 0}.transport-result-card{padding:14px;border:1px solid #dfe2e5;border-radius:14px;background:#fff;display:grid;gap:5px;min-width:0}.transport-result-card span{color:#737b83;font-size:9.5px}.transport-result-card strong{font-size:17px;line-height:1.2;color:#171b1f;overflow-wrap:anywhere}.transport-result-card small{font-size:8.5px;color:#9a9fa5}.transport-result-card.accent{background:#c82027;border-color:#c82027;color:#fff}.transport-result-card.accent span,.transport-result-card.accent strong,.transport-result-card.accent small{color:#fff}
.transport-summary-card{max-width:760px;margin-left:auto}.transport-summary-row{display:grid;grid-template-columns:1fr auto;gap:18px;align-items:center;padding:10px 4px;border-bottom:1px solid #e4e6e8;font-size:11px}.transport-summary-row strong{text-align:right}.transport-summary-row.grand{margin-top:5px;padding:13px 12px;border:0;border-radius:11px;background:#1d2126;color:#fff;font-size:13px}.transport-summary-row.grand strong{color:#fff;font-size:16px}
@media(max-width:1250px){.transport-service-layout{grid-template-columns:1fr}.transport-map{height:420px}.transport-results{grid-template-columns:repeat(3,minmax(0,1fr))}.transport-summary-card{max-width:none}}
@media(max-width:700px){.transport-form-grid,.transport-price-grid{grid-template-columns:1fr}.transport-wide,.transport-build-route{grid-column:auto}.transport-results{grid-template-columns:1fr 1fr}.transport-map{height:340px}.transport-summary-row{grid-template-columns:1fr;gap:4px}.transport-summary-row strong{text-align:left}}
@media print{body.transport-service-mode .transport-service-page{display:block!important}.transport-service-page .transport-build-route{display:none!important}.transport-map{height:110mm!important}.transport-map-caption{display:none!important}.transport-results{grid-template-columns:repeat(3,1fr)!important}}

/* V14.8.3 route reliability */
.transport-input-hint{display:block;margin-top:5px;color:#8a9198;font-size:9.5px;line-height:1.35}

/* V14.9 — обучаемая тарифная сетка транспортных услуг */
.transport-learning-pill,
.transport-tariff-count{
  padding:7px 10px;border-radius:999px;background:#fff2f3;color:#c82027;border:1px solid #f0c7ca;
  font-size:9.5px;font-weight:900;white-space:nowrap;
}
.transport-model-box{
  margin-top:12px;padding:13px 14px;border-radius:13px;background:#1d2126;color:#fff;
  display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center;
}
.transport-model-box>div:first-child{display:grid;gap:4px;min-width:150px}
.transport-model-box span{font-size:9px;color:#9fa6ad;text-transform:uppercase;letter-spacing:.05em;font-weight:900}
.transport-model-box strong{font-size:19px;color:#fff}
.transport-model-source{font-size:10px;line-height:1.5;color:#c6cbd0;border-left:1px solid #343a40;padding-left:14px}
.transport-manual-toggle{
  margin-top:12px;padding:11px 12px;border:1px solid #e1e4e7;border-radius:12px;background:#fafbfb;
  display:flex;gap:10px;align-items:flex-start;cursor:pointer;
}
.transport-manual-toggle input{width:18px;height:18px;flex:0 0 18px;margin-top:1px;accent-color:#c82027}
.transport-manual-toggle>span{display:grid;gap:3px}.transport-manual-toggle strong{font-size:10.5px}.transport-manual-toggle small{font-size:9px;color:#858c93;line-height:1.4}
.transport-manual-price{margin-top:10px}
.transport-tariff-card{padding:18px}
.transport-tariff-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end;margin-bottom:14px}
.transport-tariff-summary>div{padding:11px 12px;border-radius:11px;background:#f5f6f7;border:1px solid #e2e4e6;display:grid;gap:4px}
.transport-tariff-summary>div span{font-size:9px;color:#8b9299;text-transform:uppercase;letter-spacing:.05em;font-weight:900}
.transport-tariff-summary>div strong{font-size:15px;color:#1d2227}
.transport-tariff-summary .field small{display:block;margin-top:5px;color:#8b9299;font-size:8.5px;line-height:1.35}
.transport-actual-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end}
.transport-save-actual{grid-column:1/-1;min-height:42px}
.transport-actual-hint{margin:9px 0 12px;color:#81888f;font-size:9px;line-height:1.45}
.transport-tariff-list{border:1px solid #dfe3e6;border-radius:12px;overflow:hidden;background:#fff}
.transport-tariff-table-head,.transport-tariff-row{display:grid;grid-template-columns:minmax(130px,1.6fr) .75fr .8fr .65fr 30px;gap:8px;align-items:center}
.transport-tariff-table-head{padding:8px 10px;background:#202429;color:#fff;font-size:8.5px;text-transform:uppercase;letter-spacing:.05em;font-weight:900}
.transport-tariff-row{padding:9px 10px;border-top:1px solid #e6e8ea;font-size:9.5px;color:#2a3035}
.transport-tariff-row:first-of-type{border-top:0}
.transport-tariff-row>span:first-child{display:grid;gap:2px;min-width:0}.transport-tariff-row strong{font-size:9.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.transport-tariff-row small{font-size:8px;color:#8e959c}
.transport-record-delete{width:24px;height:24px;border:0;border-radius:7px;background:#f4e8e9;color:#c82027;font-size:16px;cursor:pointer}.transport-record-delete:hover{background:#c82027;color:#fff}
.transport-tariff-empty{padding:16px;color:#848b92;font-size:9.5px;line-height:1.5;text-align:center}
.transport-reference-prices{margin-top:10px;padding:10px 12px;border:1px solid #f0d4a8;border-radius:11px;background:#fff9ef;display:grid;gap:4px}
.transport-reference-prices strong{font-size:9.5px;color:#6f511b}.transport-reference-prices span{font-size:9px;color:#4d4a43}.transport-reference-prices small{font-size:8.5px;color:#8b7652;line-height:1.4}
@media(max-width:700px){
  .transport-model-box{grid-template-columns:1fr}.transport-model-source{border-left:0;border-top:1px solid #343a40;padding:10px 0 0}
  .transport-tariff-summary,.transport-actual-grid{grid-template-columns:1fr}
  .transport-save-actual{grid-column:auto}
  .transport-tariff-table-head{display:none}.transport-tariff-row{grid-template-columns:1fr auto;gap:5px 10px}.transport-tariff-row>span:nth-child(2),.transport-tariff-row>span:nth-child(3),.transport-tariff-row>span:nth-child(4){font-size:9px}.transport-tariff-row>span:last-child{grid-column:2;grid-row:1/span 2}
}
@media print{
  body.transport-service-mode .transport-tariff-card,
  body.transport-service-mode .transport-manual-toggle,
  body.transport-service-mode .transport-manual-price{display:none!important}
}
.transport-reference-prices[hidden],.transport-manual-price[hidden]{display:none!important}

/* V15.0 — скрытая история ТН + открытая обучаемая сетка */
.transport-model-confidence{display:block;margin-top:5px;font-size:8.5px;line-height:1.35;font-weight:800;color:#aeb5bc}
.transport-model-confidence[data-level="high"]{color:#8fd0a0}.transport-model-confidence[data-level="medium"]{color:#e2c36f}.transport-model-confidence[data-level="low"]{color:#e18b8f}
.transport-history-strip{margin-top:10px;padding:10px 12px;border-radius:11px;border:1px solid #e1e4e7;background:#f6f7f8;display:flex;align-items:center;justify-content:space-between;gap:12px}
.transport-history-strip span{font-size:8.5px;letter-spacing:.05em;text-transform:uppercase;font-weight:900;color:#8b9299}.transport-history-strip strong{font-size:9.5px;color:#30363b;text-align:right}
@media(max-width:700px){.transport-history-strip{align-items:flex-start;flex-direction:column}.transport-history-strip strong{text-align:left}}
@media print{body.transport-service-mode .transport-history-strip{display:none!important}}

/* ==== V15.1 — HOME / ADMIN TRANSPORT POINTS / TRANSPORT PRINT ==== */
.home-nav-item{margin-bottom:9px;border-bottom:1px solid #30353a;padding-bottom:11px}
.home-nav-item.active{background:linear-gradient(180deg,#c9252c 0%,#b91c23 100%)}
body.home-mode #btnNewProject,body.home-mode #btnSaveProject,body.home-mode .export-menu-wrap,body.home-mode #btnPrint{display:none!important}
.home-page{padding-bottom:30px}
.home-hero{position:relative;min-height:390px;border-radius:24px;overflow:hidden;background:linear-gradient(120deg,#15191d 0%,#272d33 100%);box-shadow:0 22px 50px rgba(20,24,28,.16);margin-bottom:18px}
.home-hero-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.home-hero-overlay{position:absolute;inset:0;background:linear-gradient(90deg,rgba(14,17,20,.94) 0%,rgba(14,17,20,.82) 43%,rgba(14,17,20,.24) 76%,rgba(14,17,20,.12) 100%)}
.home-hero-content{position:relative;z-index:2;padding:38px 42px;max-width:760px;color:#fff}.home-hero-logo{width:190px;max-height:62px;object-fit:contain;object-position:left center;filter:brightness(0) invert(1);margin-bottom:28px}.home-hero-kicker{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#f04a50;font-weight:900}.home-hero h1{margin:7px 0 13px;font-size:40px;line-height:1.04;letter-spacing:-.035em;color:#fff}.home-hero p{max-width:650px;margin:0;color:#d5d9dd;font-size:13px;line-height:1.6}.home-hero-actions{display:flex;gap:10px;margin-top:24px}.btn-home-light{border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.1);color:#fff;border-radius:12px;padding:0 17px;font-weight:800;cursor:pointer}.btn-home-light:hover{background:rgba(255,255,255,.18)}.home-hero-year{position:absolute;z-index:2;right:26px;bottom:24px;width:120px;height:94px;border-radius:18px;background:rgba(255,255,255,.92);box-shadow:0 14px 32px rgba(0,0,0,.13);display:grid;place-items:center;align-content:center;color:#171b1f}.home-hero-year strong{font-size:29px;line-height:1}.home-hero-year span{margin-top:6px;font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#7c848c;font-weight:900}
.home-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:18px;margin-bottom:18px}.home-about-card,.home-contact-card,.home-tools-card{padding:22px}.home-about-card h2,.home-contact-card h2,.home-tools-card h2{margin:3px 0 9px}.home-about-card>p{font-size:11.5px;line-height:1.7;color:#656d75;margin:0}.home-milestones{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:18px}.home-milestones>div{padding:13px;border-radius:13px;background:#f4f6f7;border:1px solid #e2e5e8;display:grid;gap:4px}.home-milestones strong{font-size:15px;color:#c82027}.home-milestones span{font-size:9px;line-height:1.35;color:#6f777f}.home-contact-list{display:grid;gap:1px;border:1px solid #e0e3e6;border-radius:14px;overflow:hidden;background:#e0e3e6}.home-contact-list>div{background:#fff;padding:12px 13px;display:grid;gap:4px}.home-contact-list span{font-size:8.5px;text-transform:uppercase;letter-spacing:.05em;color:#9299a0;font-weight:900}.home-contact-list strong{font-size:10.5px;line-height:1.45;color:#2d3338}
.home-stats{display:grid;grid-template-columns:repeat(6,1fr);gap:9px;margin-bottom:18px}.home-stats>div{padding:16px 13px;border-radius:15px;background:#fff;border:1px solid #dfe3e6;box-shadow:0 8px 18px rgba(20,24,28,.04);display:grid;gap:4px}.home-stats span{font-size:9px;color:#7a828a}.home-stats strong{font-size:19px;color:#c82027;line-height:1.1}.home-stats small{font-size:8px;color:#9aa0a6}.home-tools-head{display:flex;justify-content:space-between;align-items:end;gap:14px;margin-bottom:12px}.home-tools-head>span{font-size:9px;color:#8b9299}.home-tools-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.home-tools-grid button{min-height:88px;padding:14px;text-align:left;border:1px solid #e0e4e7;border-radius:14px;background:linear-gradient(180deg,#fff 0%,#f8f9fa 100%);cursor:pointer;display:grid;align-content:center;gap:5px}.home-tools-grid button:hover{border-color:#d42a31;box-shadow:0 10px 22px rgba(200,32,39,.08);transform:translateY(-1px)}.home-tools-grid strong{font-size:11px;color:#20252a}.home-tools-grid span{font-size:9px;line-height:1.45;color:#828a91}

.archive-tabs{display:flex;gap:7px;margin:0 0 12px}.archive-tabs button{height:38px;padding:0 15px;border-radius:11px;border:1px solid #dfe3e6;background:#fff;color:#656d74;font-size:10px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;gap:8px}.archive-tabs button b{min-width:19px;height:19px;border-radius:999px;background:#edf0f2;color:#777f87;display:grid;place-items:center;font-size:8px}.archive-tabs button.active{background:#20252a;border-color:#20252a;color:#fff}.archive-tabs button.active b{background:#c82027;color:#fff}.archive-panel[hidden]{display:none!important}.archive-transport-filters{display:grid;grid-template-columns:150px minmax(260px,380px);gap:10px;align-items:end}.archive-transport-filters label{display:grid;gap:5px}.archive-transport-filters span{font-size:9px;font-weight:800;color:#777f86}.archive-transport-list{display:grid;gap:12px}.archive-transport-card{border:1px solid #d9dde1;border-radius:17px;background:#fff;box-shadow:0 9px 24px rgba(24,28,32,.05);overflow:hidden}.archive-transport-head{display:flex;justify-content:space-between;gap:18px;padding:15px 17px;background:linear-gradient(180deg,#fff 0%,#fafbfc 100%);border-bottom:1px solid #e4e7ea}.archive-transport-head>div{min-width:0}.archive-transport-head h3{margin:5px 0 3px;font-size:14px}.archive-transport-head small{font-size:8.5px;color:#90979e}.archive-transport-head>strong{font-size:10px;color:#4b5259;white-space:nowrap}.archive-point-status{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:8px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}.archive-point-status.pending{background:#fff4d9;color:#8b6917}.archive-point-status.active{background:#e6f6e9;color:#39784a}.archive-point-status.rejected{background:#f6e7e8;color:#a34046}.archive-point-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px 17px}.archive-point-grid label{display:grid;gap:5px;min-width:0}.archive-point-grid label.wide{grid-column:span 2}.archive-point-grid span{font-size:8.5px;color:#7e868e;font-weight:800}.archive-point-grid input,.archive-point-grid select{height:38px;border:1px solid #dce1e5;border-radius:10px;background:#fff;padding:0 10px;font-size:10px;min-width:0}.archive-point-meta{display:flex;gap:18px;flex-wrap:wrap;padding:10px 17px;border-top:1px solid #edf0f2;border-bottom:1px solid #edf0f2;background:#fafbfb;font-size:9px;color:#707880}.archive-point-meta b{color:#30363b}.archive-point-actions{display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap;padding:12px 17px;background:#f7f8f9}
.transport-tariff-private{padding:18px;text-align:center;border:1px dashed #d8dde1;border-radius:12px;background:#f8f9fa;display:grid;gap:5px}.transport-tariff-private strong{font-size:10.5px;color:#33393f}.transport-tariff-private span{font-size:9px;line-height:1.5;color:#818990}

.transport-print-document{display:none}
@media print{
  @page{size:A4 portrait;margin:12mm 12mm 11mm}
  body.transport-service-mode{background:#fff!important}
  body.transport-service-mode .topbar,body.transport-service-mode .sidebar,body.transport-service-mode #page-transport-service>.page-heading,body.transport-service-mode #page-transport-service>.transport-service-layout,body.transport-service-mode #page-transport-service>.transport-results,body.transport-service-mode #page-transport-service>.transport-summary-card{display:none!important}
  body.transport-service-mode .layout,body.transport-service-mode .main{display:block!important;width:auto!important;margin:0!important;padding:0!important;overflow:visible!important;background:#fff!important}
  body.transport-service-mode #page-transport-service.page.active{display:block!important;zoom:1!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important}
  body.transport-service-mode #transportPrintDocument{display:block!important;color:#161a1e;font-family:Arial,Helvetica,sans-serif;width:100%;max-width:186mm;margin:0 auto}
  .transport-print-header{display:flex;align-items:center;justify-content:space-between;gap:10mm;padding-bottom:4mm;border-bottom:.35mm solid #1e2226}.transport-print-header img{width:43mm;max-height:14mm;object-fit:contain;object-position:left center}.transport-print-header>div{text-align:right;max-width:92mm}.transport-print-header strong{display:block;font-size:9pt}.transport-print-header span{display:block;margin-top:1.2mm;font-size:6.5pt;color:#626970;line-height:1.35}
  .transport-print-title{display:flex;justify-content:space-between;align-items:end;gap:10mm;margin:7mm 0 4mm}.transport-print-title>div>span{font-size:6.5pt;color:#c82027;font-weight:900;letter-spacing:.08em}.transport-print-title h1{margin:1mm 0 0;font-size:19pt;line-height:1}.transport-print-title time{font-size:7pt;color:#676e75;white-space:nowrap}
  .transport-print-route{display:grid;grid-template-columns:1fr 1fr;border:.25mm solid #d6dade;border-radius:2mm;overflow:hidden;margin-bottom:4mm}.transport-print-route>div{padding:3mm 3.2mm;min-width:0}.transport-print-route>div+div{border-left:.25mm solid #d6dade}.transport-print-route span,.transport-print-kpis span,.transport-print-model>span{display:block;font-size:6pt;text-transform:uppercase;letter-spacing:.05em;color:#777f86;font-weight:800;margin-bottom:1.2mm}.transport-print-route strong{font-size:8pt;line-height:1.35;overflow-wrap:anywhere}
  .transport-print-kpis{display:grid;grid-template-columns:repeat(4,1fr);border:.25mm solid #d6dade;border-radius:2mm;overflow:hidden;margin-bottom:5mm}.transport-print-kpis>div{padding:3mm}.transport-print-kpis>div+div{border-left:.25mm solid #d6dade}.transport-print-kpis strong{font-size:9pt;line-height:1.2}
  .transport-print-table{width:100%;border-collapse:collapse;margin-bottom:5mm;font-size:8.5pt}.transport-print-table td{padding:3.1mm 3mm;border-bottom:.25mm solid #d6dade}.transport-print-table td:last-child{text-align:right;font-weight:800;white-space:nowrap}.transport-print-table tr.grand td{background:#c82027!important;color:#fff!important;font-size:11pt;font-weight:900;border:0;print-color-adjust:exact;-webkit-print-color-adjust:exact}.transport-print-table tr.grand td:first-child{letter-spacing:.025em}
  .transport-print-model{padding:3.5mm;border:.25mm solid #d6dade;border-radius:2mm;background:#f6f7f8!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}.transport-print-model>strong{display:block;font-size:8pt}.transport-print-model p{margin:1.5mm 0;font-size:6.8pt;line-height:1.45;color:#4e555c}.transport-print-model small{font-size:6.3pt;color:#777f86}.transport-print-footer{display:flex;justify-content:space-between;gap:10mm;margin-top:7mm;padding-top:2.5mm;border-top:.25mm solid #d8dcdf;font-size:6pt;color:#7c838a}
}

@media(max-width:1200px){.home-stats{grid-template-columns:repeat(3,1fr)}.home-tools-grid{grid-template-columns:repeat(2,1fr)}.archive-point-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.home-grid{grid-template-columns:1fr}.home-hero{min-height:430px}.home-hero h1{font-size:34px}.home-milestones{grid-template-columns:1fr}.archive-transport-filters{grid-template-columns:1fr}.archive-point-grid{grid-template-columns:1fr}.archive-point-grid label.wide{grid-column:auto}}
@media(max-width:620px){.home-hero-content{padding:28px 24px}.home-hero-year{display:none}.home-stats{grid-template-columns:1fr 1fr}.home-tools-grid{grid-template-columns:1fr}.home-hero-actions{flex-direction:column;align-items:stretch}.btn-home-light{min-height:42px}.archive-tabs{overflow:auto}.archive-transport-head{flex-direction:column}.archive-point-actions{justify-content:stretch}.archive-point-actions .btn{flex:1}}

/* V15.2 HOME REFRESH + INTERNAL CONTACTS */
.topbar{
  height:82px;
  padding:0 20px 0 18px;
  background:linear-gradient(90deg,#12161b 0%,#171c22 58%,#12161b 100%);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand{gap:12px}
.brand-logo{height:58px!important;width:58px!important;max-width:58px!important;border-radius:14px!important;box-shadow:0 8px 20px rgba(0,0,0,.25)}
.brand-copy{display:grid;gap:3px}
.brand-name{font-size:15px;letter-spacing:.02em;color:#fff}
.brand-subtitle{font-size:11px;color:#98a1aa;text-transform:none}
.top-actions{gap:10px;flex-wrap:wrap;justify-content:flex-end}
.top-actions .btn{border-radius:12px;min-height:38px;padding:0 14px;font-weight:800}
.top-actions .btn.btn-ghost{background:#21262d;border:1px solid #313843;color:#eef1f4}
.top-actions .btn.btn-ghost:hover{background:#2a313a}
.top-actions .btn.btn-primary{box-shadow:0 10px 20px rgba(184,36,42,.22)}
.export-menu-button .export-caret{margin-left:4px}
.reminder-bell{width:42px;height:42px;border-radius:14px;background:#21262d;border:1px solid #313843;display:grid;place-items:center;box-shadow:none}
.reminder-bell:hover{background:#2b323b;transform:translateY(-1px)}
.reminder-bell>span{font-size:18px}
.current-user{gap:12px;padding:6px 0 6px 12px;border-left:1px solid rgba(255,255,255,.08)}
.current-user-avatar{width:42px;height:42px;border-radius:14px;background:linear-gradient(180deg,#dc2e35 0%,#991d22 100%);display:grid;place-items:center;color:#fff;font-weight:900;font-size:13px;box-shadow:0 10px 22px rgba(184,36,42,.28)}
.current-user-copy{max-width:220px;display:grid;gap:4px}
.current-user-copy strong{font-size:12px;color:#fff}
.current-user-copy span{margin:0;font-size:10px;color:#9fa8b0;text-transform:uppercase;letter-spacing:.08em}
.current-user-logout{min-height:38px!important;padding:0 12px!important;font-size:11px!important;border-radius:12px!important;background:#21262d!important;border:1px solid #313843!important;color:#eef1f4!important}
.current-user-logout:hover{background:#2a313a!important}

.home-page{gap:18px}
.home-page.active{display:grid}
.home-page:not(.active){display:none!important}
.home-hero--refined{min-height:328px;margin-bottom:0;border-radius:28px;box-shadow:0 24px 56px rgba(16,20,24,.16)}
.home-hero--refined .home-hero-overlay{background:linear-gradient(90deg,rgba(10,13,16,.92) 0%,rgba(10,13,16,.78) 42%,rgba(10,13,16,.2) 78%,rgba(10,13,16,.08) 100%)}
.home-hero-content{max-width:760px;padding:38px 36px 34px}
.home-hero-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);font-size:11px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#fff;backdrop-filter:blur(10px)}
.home-hero-chip-dot{width:8px;height:8px;border-radius:50%;background:#d1272f;box-shadow:0 0 0 4px rgba(209,39,47,.18)}
.home-hero--refined h1{margin:18px 0 14px;font-size:54px;line-height:.98;letter-spacing:-.05em;max-width:700px}
.home-hero--refined p{font-size:15px;max-width:620px;color:#dde3e8}
.home-hero-actions{margin-top:26px;gap:12px}
.home-hero-actions .btn{min-height:48px;padding:0 18px;border-radius:14px;font-weight:900}
.btn-home-light{background:rgba(255,255,255,.1);backdrop-filter:blur(10px)}
.home-hero-meta{margin-top:26px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:670px}
.home-meta-item{padding:14px 15px;border-radius:18px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.12);backdrop-filter:blur(8px)}
.home-meta-item span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#ff9da1;font-weight:900;margin-bottom:7px}
.home-meta-item strong{display:block;font-size:13px;line-height:1.45;color:#fff}
.home-hero-year{right:28px;bottom:28px;width:126px;height:100px;border-radius:22px}
.home-tools-card--primary,.home-internal-card{padding:24px}
.home-tools-head{align-items:center;margin-bottom:16px}
.home-tools-head h2{margin:4px 0 0;font-size:30px;letter-spacing:-.03em}
.home-tools-head>span,.home-contacts-actions span{font-size:11px;color:#858d96;line-height:1.5}
.home-tools-grid--enhanced{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.home-tools-grid--enhanced button{min-height:132px;padding:18px;border-radius:18px;display:grid;grid-template-columns:52px 1fr;grid-template-rows:auto 1fr;column-gap:14px;row-gap:8px;align-items:start;border:1px solid #e2e6ea;background:linear-gradient(180deg,#fff 0%,#f7f9fb 100%);box-shadow:0 12px 26px rgba(21,25,29,.05)}
.home-tools-grid--enhanced button:hover{transform:translateY(-2px);border-color:#d12b32;box-shadow:0 18px 30px rgba(184,36,42,.1)}
.home-tool-icon{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(180deg,#232932 0%,#171c22 100%);box-shadow:0 10px 20px rgba(16,20,24,.16);grid-row:span 2}
.home-tool-icon img{width:32px;height:32px;object-fit:contain}
.home-tools-grid--enhanced strong{font-size:15px;color:#1c2126;line-height:1.2;margin-top:2px}
.home-tools-grid--enhanced span:last-child{font-size:11px;line-height:1.55;color:#717983}
.home-internal-card{display:grid;gap:16px}
.home-contacts-head{margin-bottom:0}
.home-contacts-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.home-internal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.home-contact-person-card{padding:18px;border-radius:18px;background:linear-gradient(180deg,#fff 0%,#f8fafb 100%);border:1px solid #e2e6ea;box-shadow:0 12px 24px rgba(17,21,25,.04);display:grid;gap:16px}
.home-contact-person-top{display:flex;align-items:center;gap:12px;min-width:0}
.home-contact-avatar{width:46px;height:46px;border-radius:14px;background:linear-gradient(180deg,#d53038 0%,#ab2026 100%);display:grid;place-items:center;color:#fff;font-size:18px;font-weight:900;box-shadow:0 12px 22px rgba(184,36,42,.18)}
.home-contact-person-copy{min-width:0}
.home-contact-person-copy h3{margin:0;font-size:15px;line-height:1.25;color:#1e2328}
.home-contact-person-copy p{margin:4px 0 0;font-size:11px;color:#7a838b;line-height:1.45}
.home-contact-person-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.home-contact-person-meta div{padding:12px;border-radius:14px;background:#f3f5f7;border:1px solid #e4e7ea;display:grid;gap:5px}
.home-contact-person-meta span{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#8a929a}
.home-contact-person-meta strong{font-size:13px;color:#1f2429;line-height:1.3}
.home-internal-empty{padding:16px 18px;border-radius:16px;border:1px dashed #cdd3d9;background:#fafbfc;color:#7d868f;font-size:13px}
.home-contacts-editor{padding:18px;border-radius:18px;border:1px solid #e3e6ea;background:#fafbfc;display:grid;gap:14px}
.home-contacts-editor-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.home-contacts-editor-head h3{margin:4px 0 0;font-size:22px;letter-spacing:-.02em}
.home-contacts-editor-list{display:grid;gap:10px}.home-contact-row{display:grid;grid-template-columns:1.3fr 1.1fr .65fr 1fr auto;gap:10px;align-items:end;padding:14px;border-radius:16px;background:#fff;border:1px solid #e2e6ea}
.home-contact-row label{display:grid;gap:6px}.home-contact-row label span{font-size:10px;font-weight:800;color:#79818a;text-transform:uppercase;letter-spacing:.08em}.home-contact-row input{width:100%}.home-contact-row-remove{min-height:42px!important;align-self:end}.home-contacts-editor-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}

.nav-group-title{font-weight:800;font-size:14px;letter-spacing:-.01em}.nav-item>span:last-child{font-size:14px}
.nav-group-toggle{border-radius:14px;padding:11px 12px}
.nav-group-chevron img{width:18px;height:18px;opacity:.8}

@media(max-width:1320px){.home-tools-grid--enhanced,.home-internal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-hero--refined h1{font-size:46px}}
@media(max-width:980px){.topbar{height:auto;padding:14px;align-items:flex-start}.home-hero-meta{grid-template-columns:1fr}.home-hero--refined h1{font-size:40px}.home-contact-row{grid-template-columns:1fr 1fr}.home-contact-row .home-contact-row-remove{grid-column:1/-1}.home-tools-grid--enhanced button{grid-template-columns:46px 1fr}}
@media(max-width:720px){.home-tools-grid--enhanced,.home-internal-grid{grid-template-columns:1fr}.home-tools-head,.home-contacts-actions,.home-contacts-editor-head{align-items:flex-start;flex-direction:column}.home-hero-content{padding:28px 24px 26px}.home-hero--refined h1{font-size:34px}.home-meta-item strong{font-size:12px}.home-contact-person-meta{grid-template-columns:1fr}}

/* V15.2.1 navigation regression fix */
.page.home-page:not(.active){display:none!important}
.page.home-page.active{display:grid}

/* V15.2.2 — recycle bin for transport points */
.archive-point-status.deleted{background:#eceff2;color:#5e6872;border-color:#d8dde2}
.archive-transport-card:has(.archive-point-status.deleted){opacity:.9;border-style:dashed}


/* V15.2.3 — administrator activity-log cleanup */
.activity-admin-tools{display:grid;gap:10px;margin:14px 0;padding:14px;border-radius:14px;background:#f7f8f9;border:1px solid #dde1e4}
.activity-admin-tools[hidden]{display:none!important}
.activity-selection-tools,.activity-period-delete{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-radius:12px;background:#fff;border:1px solid #e1e4e7}
.activity-selection-tools>div:first-child{display:grid;gap:3px}.activity-selection-tools>div:first-child>strong{font-size:13px}.activity-selection-tools>div:first-child>span{font-size:10px;color:#7f878e}
.activity-selection-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.activity-period-delete{display:grid;grid-template-columns:minmax(220px,1fr) 150px 150px auto;align-items:end}
.activity-period-copy{display:grid;gap:4px}.activity-period-copy strong{font-size:13px}.activity-period-copy span{font-size:10px;line-height:1.45;color:#7d858c;max-width:540px}.activity-period-delete label{display:grid;gap:5px}.activity-period-delete label>span{font-size:9px;font-weight:800;color:#737b82}
.btn-danger{background:#fff;color:#c82027;border:1px solid #dfb8bb}.btn-danger:hover:not(:disabled){background:#c82027;color:#fff;border-color:#c82027}.btn-danger:disabled{opacity:.42;cursor:not-allowed}
.activity-row-admin{grid-template-columns:28px 145px minmax(180px,240px) 1fr}.activity-row.is-selected{background:#fff6f6;box-shadow:inset 3px 0 0 #c82027}
.activity-check{width:22px;height:22px;display:grid;place-items:center;cursor:pointer}.activity-check input{position:absolute;opacity:0;pointer-events:none}.activity-check span{width:18px;height:18px;border-radius:5px;border:1px solid #c9cfd5;background:#fff;display:grid;place-items:center}.activity-check input:checked+span{background:#c82027;border-color:#c82027}.activity-check input:checked+span:after{content:"✓";color:#fff;font-size:12px;font-weight:900;line-height:1}
@media(max-width:1050px){.activity-selection-tools{align-items:flex-start;flex-direction:column}.activity-selection-actions{justify-content:flex-start}.activity-period-delete{grid-template-columns:1fr 1fr}.activity-period-copy{grid-column:1/-1}.activity-period-delete .activity-delete-button{grid-column:1/-1}}
@media(max-width:720px){.activity-period-delete{grid-template-columns:1fr}.activity-period-copy,.activity-period-delete .activity-delete-button{grid-column:auto}.activity-row-admin{grid-template-columns:28px 1fr}.activity-row-admin time,.activity-row-admin .activity-person,.activity-row-admin .activity-main{grid-column:2}.activity-selection-actions{width:100%}.activity-selection-actions .btn{flex:1}}
@media print{.activity-admin-tools{display:none!important}}

/* V15.3 — справочник цен сырья */
.raw-price-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}.raw-price-summary-card{padding:15px 16px;border-radius:15px;background:#fff;border:1px solid #dfe3e7;box-shadow:0 8px 18px rgba(20,24,28,.04);display:grid;gap:5px}.raw-price-summary-card span{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:#8b9299;font-weight:900}.raw-price-summary-card strong{font-size:20px;color:#20252a}
.raw-price-layout{display:grid;grid-template-columns:minmax(310px,.7fr) minmax(620px,1.55fr);gap:16px;align-items:start}.raw-price-editor-card,.raw-price-list-card{padding:18px}.raw-price-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.raw-price-section-head h2{margin:3px 0 0}.raw-price-reference-pill{padding:7px 10px;border-radius:999px;background:#fff0f1;color:#c82027;border:1px solid #f0c6c9;font-size:9px;font-weight:900;white-space:nowrap}.raw-price-form{display:grid;gap:11px}.raw-price-two-cols{display:grid;grid-template-columns:1fr 1fr;gap:10px}.raw-price-form textarea{width:100%;resize:vertical;min-height:74px;border:1px solid #dfe3e6;border-radius:10px;padding:10px;font:inherit}.raw-price-form-note{padding:10px 11px;border-radius:10px;background:#f5f6f7;border:1px solid #e1e4e7;color:#70777e;font-size:9.5px;line-height:1.5}.raw-price-form-note strong{color:#2b3136}.raw-price-form-actions{display:flex;gap:8px;justify-content:flex-end}.raw-price-filters{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:10px;margin-bottom:12px}.raw-price-table-wrap{overflow:auto;border:1px solid #dfe3e7;border-radius:12px}.raw-price-table{width:100%;border-collapse:collapse;min-width:880px}.raw-price-table th{padding:9px 10px;background:#202429;color:#fff;text-align:left;font-size:8.5px;text-transform:uppercase;letter-spacing:.05em}.raw-price-table td{padding:10px;border-top:1px solid #e7eaec;font-size:9.5px;vertical-align:top;color:#343a40}.raw-price-table td strong{display:block;font-size:10px;color:#20252a}.raw-price-table td small{display:block;margin-top:3px;color:#9299a0;font-size:8px}.raw-price-actions{white-space:nowrap}.raw-price-actions button{border:0;background:transparent;color:#53606a;font-size:9px;font-weight:800;padding:4px 5px;cursor:pointer}.raw-price-actions button:hover{color:#c82027}.raw-price-actions button.danger{color:#b72a31}.raw-price-empty{padding:20px;text-align:center;color:#888f96;font-size:10px}.raw-material-prices-nav-item .nav-icon{background:rgba(7,9,12,.35)}
body.raw-material-prices-mode #btnNewProject,body.raw-material-prices-mode #btnSaveProject,body.raw-material-prices-mode .export-menu-wrap,body.raw-material-prices-mode #btnPrint{display:none!important}
@media(max-width:1150px){.raw-price-layout{grid-template-columns:1fr}.raw-price-summary{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.raw-price-two-cols,.raw-price-filters,.raw-price-summary{grid-template-columns:1fr}.raw-price-form-actions{justify-content:stretch}.raw-price-form-actions .btn{flex:1}}
@media print{.raw-material-prices-page{display:none!important}}

/* V15.4 — raw material prices inside Documentation + admin backups */
.backup-page{max-width:1500px}
.backup-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.backup-status-card{padding:18px;display:flex;align-items:center;gap:14px;min-height:104px}
.backup-status-icon{width:50px;height:50px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(180deg,#262c33 0%,#171c21 100%);color:#fff;font-size:24px;font-weight:900;box-shadow:0 10px 22px rgba(20,24,28,.14);flex:0 0 50px}
.backup-status-card>div:last-child{display:grid;gap:4px;min-width:0}.backup-status-card span{font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#8a9299}.backup-status-card strong{font-size:17px;color:#20252a}.backup-status-card small{font-size:10px;line-height:1.45;color:#858d95}.backup-status-card .backup-status-offline{color:#a96e13}
.backup-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px}
.backup-card,.backup-sync-card{padding:24px}.backup-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}.backup-card-head h2{margin:4px 0 0;font-size:24px;letter-spacing:-.025em}.backup-card>p,.backup-sync-card>p{margin:0 0 18px;color:#69727b;font-size:12px;line-height:1.7}.backup-admin-pill,.backup-sync-badge{padding:7px 10px;border-radius:999px;background:#f7e9ea;color:#a51f25;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.07em;white-space:nowrap}.backup-sync-badge{background:#edf6f0;color:#2f7a50}
.backup-warning{margin:16px 0;padding:13px 14px;border-radius:14px;background:#fff8ea;border:1px solid #f1ddb1;color:#77591d;font-size:11px;line-height:1.55}.backup-main-button{min-height:46px!important;border-radius:13px!important;padding:0 18px!important}.backup-last-info{margin-top:12px;font-size:10px;line-height:1.5;color:#8a9299}
.backup-file-picker{display:flex;align-items:center;justify-content:center;min-height:88px;padding:16px;border:1px dashed #bfc6cd;border-radius:16px;background:#fafbfc;cursor:pointer;margin:15px 0;transition:.18s}.backup-file-picker:hover{border-color:#b8242a;background:#fff9f9}.backup-file-picker input{position:absolute;opacity:0;pointer-events:none}.backup-file-picker span{font-size:12px;font-weight:900;color:#363c42}.backup-restore-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 14px}.backup-restore-preview>div{padding:11px 12px;border-radius:12px;background:#f4f6f7;border:1px solid #e2e6e9;display:grid;gap:4px}.backup-restore-preview span{font-size:8.5px;font-weight:900;text-transform:uppercase;letter-spacing:.07em;color:#91989f}.backup-restore-preview strong{font-size:10.5px;line-height:1.4;color:#2b3035;word-break:break-word}
.backup-sync-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:12px;margin:18px 0}.backup-sync-flow>div{min-height:88px;padding:15px;border-radius:16px;background:linear-gradient(180deg,#fff 0%,#f6f8f9 100%);border:1px solid #e0e4e7;display:flex;align-items:center;gap:12px}.backup-sync-flow>div strong{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:#20252a;color:#fff;font-size:13px;flex:0 0 34px}.backup-sync-flow>div span{font-size:11px;font-weight:800;line-height:1.4;color:#3b4248}.backup-sync-flow>i{font-style:normal;font-size:24px;color:#b8242a;font-weight:900}
@media(max-width:1000px){.backup-status-grid{grid-template-columns:1fr}.backup-layout{grid-template-columns:1fr}.backup-sync-flow{grid-template-columns:1fr}.backup-sync-flow>i{transform:rotate(90deg);text-align:center}}
@media(max-width:620px){.backup-card,.backup-sync-card{padding:18px}.backup-card-head{flex-direction:column}.backup-restore-preview{grid-template-columns:1fr}}
@media print{.backup-page{display:none!important}}

.admin-only-backup[hidden]{display:none!important;}

/* V15.5 — counterparties registry + INN lookup */
.field-status{display:block;min-height:16px;margin-top:5px;font-size:10px;line-height:1.35;color:#8b9299}
.field-status[data-kind="success"]{color:#2f7a50}.field-status[data-kind="error"]{color:#b8242a}.field-status[data-kind="loading"]{color:#8c6814}
.cp-inn-lookup,.raw-supplier-lookup,.party-inn-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.cp-inn-lookup .btn,.raw-supplier-lookup .btn,.party-inn-row .btn{min-height:38px;white-space:nowrap;padding:0 12px}
.party-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.party-summary-card{padding:16px 18px;border-radius:17px;background:#fff;border:1px solid #dfe3e6;box-shadow:0 8px 22px rgba(20,24,28,.05);display:grid;gap:6px}
.party-summary-card span{font-size:10px;color:#7e868e;text-transform:uppercase;letter-spacing:.07em;font-weight:800}.party-summary-card strong{font-size:23px;color:#1e2328;letter-spacing:-.03em}.party-summary-card:nth-child(2) strong,.party-summary-card:nth-child(3) strong{color:#c82027}
.party-layout{display:grid;grid-template-columns:minmax(340px,440px) minmax(0,1fr);gap:18px;align-items:start}.party-editor-card,.party-list-card{padding:20px}.party-editor-card{position:sticky;top:100px;max-height:calc(100vh - 120px);overflow:auto}
.party-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.party-section-head h2,.party-section-head h3{margin:3px 0 0;letter-spacing:-.02em}.party-reference-pill{padding:7px 10px;border-radius:999px;background:#f4f5f6;border:1px solid #e0e3e6;color:#777f87;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
.party-form{display:grid;gap:12px}.party-two-cols{display:grid;grid-template-columns:1fr 1fr;gap:10px}.party-form textarea{resize:vertical}
.party-role-box{padding:13px;border-radius:14px;background:#f6f7f8;border:1px solid #e2e5e8}.party-role-box>span{display:block;margin-bottom:9px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.07em;color:#7b838b}.party-role-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.party-role-grid label{display:flex;gap:8px;align-items:center;font-size:11px;color:#343a40;font-weight:700}.party-role-grid input{width:16px;height:16px;min-height:16px;accent-color:#c82027}
.party-form-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}.party-lookup-settings{margin-top:18px;padding-top:18px;border-top:1px solid #e2e5e8}.party-lookup-settings p{margin:-4px 0 12px;color:#7b838b;font-size:10.5px;line-height:1.55}
.party-filters{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(180px,.6fr);gap:10px;margin-bottom:14px}.party-table-wrap{overflow:auto;border:1px solid #e0e4e7;border-radius:15px}.party-table{width:100%;border-collapse:collapse;min-width:900px;font-size:11px}.party-table th{background:#1d2228;color:#fff;text-align:left;padding:11px 12px;font-size:9px;text-transform:uppercase;letter-spacing:.06em}.party-table td{padding:12px;border-top:1px solid #e4e7ea;vertical-align:top;color:#3a4046}.party-table tr:first-child td{border-top:0}.party-table td strong{display:block;font-size:11.5px;color:#20252a;line-height:1.4}.party-table td small{display:block;margin-top:4px;font-size:9px;color:#858d95;line-height:1.4}.party-actions{white-space:nowrap}.party-actions button{border:0;background:#eef1f3;border-radius:9px;padding:7px 9px;margin-right:4px;font-size:9px;font-weight:800;color:#343b42}.party-actions button:hover{background:#e0e5e8}.party-actions button.danger{background:#f8e9ea;color:#a92329}.party-state{display:inline-flex;padding:6px 8px;border-radius:999px;background:#eef1f3;color:#5d6670;font-size:9px;font-weight:900}.party-state-active{background:#e6f3eb;color:#2f7a50}.party-state-liquidated,.party-state-bankrupt{background:#f8e9ea;color:#a92329}.party-state-liquidating,.party-state-reorganizing{background:#f8f1dd;color:#896916}.party-empty{padding:22px;text-align:center;color:#899199;font-size:12px}
.raw-price-table td:nth-child(3) strong{display:block}.raw-price-table td:nth-child(3) small{display:block;margin-top:3px;color:#8b9299;font-size:9px}
@media(max-width:1180px){.party-summary{grid-template-columns:repeat(2,1fr)}.party-layout{grid-template-columns:1fr}.party-editor-card{position:static;max-height:none}}
@media(max-width:680px){.party-summary{grid-template-columns:1fr}.party-two-cols,.party-role-grid,.party-filters{grid-template-columns:1fr}.cp-inn-lookup,.raw-supplier-lookup,.party-inn-row{grid-template-columns:1fr}.cp-inn-lookup .btn,.raw-supplier-lookup .btn,.party-inn-row .btn{width:100%}}
@media print{.counterparties-page{display:none!important}}

/* V16.0 — document history, supplier comparison, counterparty verification, update center */
.cp-editor-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.cp-editor-actions .btn{white-space:nowrap}

/* Document history */
.doc-history-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}
.doc-history-summary>div{padding:16px 18px;border-radius:16px;background:#fff;border:1px solid #dfe3e7;box-shadow:0 8px 18px rgba(20,24,28,.04);display:grid;gap:5px}
.doc-history-summary span{font-size:10px;color:#818992;text-transform:uppercase;letter-spacing:.07em;font-weight:800}
.doc-history-summary strong{font-size:20px;color:#20252a}
.doc-history-card{padding:18px}
.doc-history-toolbar{display:grid;grid-template-columns:minmax(250px,1.3fr) 160px 160px auto auto;gap:10px;align-items:end;margin-bottom:14px}
.doc-history-table-wrap{overflow:auto;border:1px solid #e2e5e8;border-radius:14px}
.doc-history-table{width:100%;border-collapse:collapse;min-width:880px}
.doc-history-table th{padding:11px 12px;background:#f4f6f8;color:#747d85;font-size:9px;text-transform:uppercase;letter-spacing:.07em;text-align:left;border-bottom:1px solid #e1e5e8}
.doc-history-table td{padding:12px;border-bottom:1px solid #edf0f2;font-size:11px;vertical-align:middle}
.doc-history-table tr:last-child td{border-bottom:0}
.doc-history-table td strong{display:block;font-size:12px;color:#20252a}.doc-history-table td small{display:block;margin-top:4px;color:#858d95;font-size:9.5px;line-height:1.4}
.doc-history-check{width:38px;text-align:center!important}.doc-history-check input{width:17px;height:17px;accent-color:#c82027}
.doc-history-actions{white-space:nowrap;text-align:right}.doc-history-actions button{border:0;background:#eef1f4;color:#30363b;border-radius:9px;padding:7px 9px;font-size:10px;font-weight:800;margin-left:5px}.doc-history-actions button:hover{background:#dde3e8}.doc-history-actions button.danger{color:#b51f26;background:#faecee}
.doc-history-empty{padding:28px;text-align:center;color:#8a929a;font-size:12px}
.doc-history-compare{margin-top:16px;padding:18px}.doc-compare-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.doc-compare-head h3{margin:4px 0 0;font-size:21px}.doc-compare-head button{width:34px;height:34px;border-radius:10px;border:1px solid #dfe3e7;background:#fff;font-size:20px}.doc-compare-delta{margin:14px 0;padding:13px 15px;border-radius:13px;background:#f4f6f8;display:flex;justify-content:space-between;align-items:center}.doc-compare-delta span{font-size:10px;color:#818992;text-transform:uppercase;font-weight:900;letter-spacing:.06em}.doc-compare-delta strong{font-size:17px}.doc-compare-delta.up strong{color:#ba242b}.doc-compare-delta.down strong{color:#28754d}
.doc-compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.doc-compare-grid>div{padding:12px;border-radius:12px;border:1px solid #e3e6e9;display:grid;grid-template-columns:90px 1fr 20px 1fr;gap:7px;align-items:center}.doc-compare-grid span{font-size:9.5px;color:#808890;font-weight:800;text-transform:uppercase}.doc-compare-grid strong{font-size:11px;overflow-wrap:anywhere}.doc-compare-grid b{text-align:center;color:#c82027}

/* Supplier comparison */
.raw-compare-card{padding:18px;margin-bottom:16px}.raw-compare-select{min-width:300px;margin:0}.raw-compare-note{margin:0 0 13px;font-size:11px;color:#737c84;line-height:1.55}.raw-compare-table-wrap{overflow:auto;border:1px solid #e0e4e7;border-radius:14px}.raw-compare-table{width:100%;min-width:1000px;border-collapse:collapse}.raw-compare-table th{padding:10px;background:#f3f5f7;color:#7b848c;font-size:9px;text-transform:uppercase;letter-spacing:.06em;text-align:left;border-bottom:1px solid #dfe3e6}.raw-compare-table td{padding:11px 10px;border-bottom:1px solid #edf0f2;font-size:10.5px;vertical-align:middle}.raw-compare-table tr:last-child td{border-bottom:0}.raw-compare-table td strong{display:block;font-size:11.5px}.raw-compare-table td small{display:block;margin-top:3px;color:#8a9299;font-size:9px}.raw-compare-table tr.best-price{background:#fbfdfb}.raw-compare-table small.stale{color:#b66c25;font-weight:800}.raw-favorite{border:0;background:transparent;font-size:23px;line-height:1;color:#aab1b8;padding:2px 5px}.raw-favorite.active{color:#d79d1c}.raw-delta{display:inline-flex;padding:5px 7px;border-radius:8px;background:#f0f2f4;font-weight:900}.raw-delta.up{color:#b32329;background:#faecee}.raw-delta.down{color:#26744a;background:#eaf6ef}

/* Counterparty verification */
.party-verification{border:1px solid #dfe3e7;border-radius:15px;background:linear-gradient(180deg,#fafbfc 0%,#f5f7f8 100%);padding:14px;display:grid;gap:12px}
.party-verification-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.party-verification-head>div{display:grid;gap:3px}.party-verification-head>div>span{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#878f97;font-weight:900}.party-verification-head strong{font-size:14px;color:#20252a}
.party-verification-badge{padding:6px 9px;border-radius:999px;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;background:#eceff2;color:#7b838b}.party-verification-badge[data-level="good"]{background:#e8f5ed;color:#257147}.party-verification-badge[data-level="warn"]{background:#fff2db;color:#9a6818}.party-verification-badge[data-level="bad"]{background:#fae8ea;color:#b02027}
.party-verification-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.party-verification-grid>div{background:#fff;border:1px solid #e2e5e8;border-radius:11px;padding:10px;display:grid;gap:4px}.party-verification-grid>div.wide{grid-column:1/-1}.party-verification-grid span{font-size:8.5px;text-transform:uppercase;color:#8b939a;font-weight:900;letter-spacing:.05em}.party-verification-grid strong{font-size:10.5px;line-height:1.4;color:#252b30;overflow-wrap:anywhere}

/* Update center */
.update-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.update-version-card{padding:18px;display:grid;gap:5px}.update-version-card>span{font-size:9.5px;text-transform:uppercase;color:#838b93;font-weight:900;letter-spacing:.07em}.update-version-card>strong{font-size:22px;color:#20252a}.update-version-card>small{font-size:10px;color:#8a9299}.update-backup-badge{font-style:normal;padding:4px 7px;border-radius:8px;background:#f1f3f5}.update-backup-badge[data-level="good"]{background:#e8f5ed;color:#257147}.update-backup-badge[data-level="warn"]{background:#fff2dc;color:#946316}.update-backup-badge[data-level="bad"]{background:#fae8ea;color:#b12027}
.update-layout{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:16px;align-items:start}.update-safety-card,.update-history-card{padding:20px}.update-safety-card h2,.update-history-card h2{margin:4px 0 9px}.update-safety-card p{font-size:11.5px;color:#707982;line-height:1.6}.update-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.update-server-note{margin-top:16px;padding:13px;border-radius:13px;background:#f4f6f8;border:1px solid #e2e5e8;font-size:10.5px;line-height:1.5;color:#69727a}.update-release-list{display:grid;gap:10px;margin-top:14px}.update-release{position:relative;display:grid;grid-template-columns:88px 1fr;gap:14px;padding:14px;border:1px solid #e2e5e8;border-radius:14px;background:#fafbfc}.update-release.current{border-color:#e1b5b8;background:#fffafa}.update-release-version{display:grid;align-content:start;gap:4px}.update-release-version strong{font-size:18px;color:#c82027}.update-release-version span{font-size:9px;color:#8a9299}.update-release-copy h3{margin:0 0 7px;font-size:13px}.update-release-copy ul{margin:0;padding-left:17px;color:#6e777f;font-size:10.5px;line-height:1.55}.update-current-pill{position:absolute;right:12px;top:12px;padding:5px 8px;border-radius:999px;background:#c82027;color:#fff;font-size:8.5px;font-weight:900;text-transform:uppercase}

@media(max-width:1150px){.doc-history-toolbar{grid-template-columns:1fr 1fr 1fr}.doc-history-toolbar .btn{min-height:42px}.update-layout{grid-template-columns:1fr}.raw-compare-select{min-width:220px}}
@media(max-width:760px){.doc-history-summary,.update-overview{grid-template-columns:1fr}.doc-history-toolbar{grid-template-columns:1fr}.doc-compare-grid{grid-template-columns:1fr}.doc-compare-grid>div{grid-template-columns:75px 1fr 18px 1fr}.party-verification-grid{grid-template-columns:1fr}.party-verification-grid>div.wide{grid-column:auto}.raw-price-section-head{align-items:flex-start;flex-direction:column}.raw-compare-select{min-width:0;width:100%}.update-release{grid-template-columns:1fr}.update-current-pill{position:static;justify-self:start}.cp-editor-actions{justify-content:flex-start}}
@media print{.document-history-page,.update-center-page{display:none!important}}

/* V17 SERVER */
.server-sync-status{padding:8px 10px;border-radius:10px;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;border:1px solid #343a41;color:#aab2ba;background:#20252b;white-space:nowrap}
.server-sync-status[data-level="online"]{color:#9bd7aa;border-color:rgba(74,165,99,.35);background:rgba(48,122,74,.12)}
.server-sync-status[data-level="offline"]{color:#e59b9f;border-color:rgba(184,36,42,.35);background:rgba(184,36,42,.1)}
.backup-server-list{display:grid;gap:8px;margin-top:14px}.backup-server-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border:1px solid #e1e4e7;border-radius:12px;background:#fff;font-size:11px}.backup-server-row strong{display:block}.backup-server-row small{color:#838b92}.backup-server-row a{font-weight:800;color:#b8242a;text-decoration:none}
