:root {
  --ars-ink: #111318;
  --ars-ink-soft: #111318;
  --ars-panel: #ffffff;
  --ars-page: #f3f5f7;
  --ars-line: #dfe4eb;
  --ars-muted: #667085;
  --ars-brand: #f6b719;
  --ars-brand-strong: #df9f00;
  --ars-accent: #0f766e;
  --ars-focus: #2f80ed;
  --ars-radius: 8px;
  --ars-shadow: 0 18px 45px rgba(17, 19, 24, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ars-page);
}

body {
  background:
    linear-gradient(180deg, #eef1f5 0, #f7f8fa 360px, #f3f5f7 100%);
  color: var(--ars-ink-soft);
  display: block !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

#app {
  display: block !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

header.bg-dark {
  background: #111318 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 40px rgba(17, 19, 24, 0.18);
  padding: 18px 16px 20px !important;
  position: sticky;
  top: 0;
  z-index: 20;
}

header.bg-dark .container {
  max-width: 1320px;
}

.logo {
  color: #fff !important;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 18px;
}

.logo span {
  color: var(--ars-brand) !important;
}

nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

nav a,
header.bg-dark nav a.btn,
header.bg-dark nav a.btn-outline-warning {
  align-items: center;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(246, 183, 25, 0.68) !important;
  border-radius: var(--ars-radius);
  color: #f8fafc !important;
  display: inline-flex;
  font-weight: 650;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

nav a:hover,
nav a.active,
nav a.exact-active,
header.bg-dark nav a.router-link-active,
header.bg-dark nav a.router-link-exact-active {
  background: var(--ars-brand) !important;
  border-color: var(--ars-brand) !important;
  color: var(--ars-ink) !important;
}

header.bg-dark nav a:hover {
  transform: translateY(-1px);
}

.currency {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.currency .btn {
  align-items: center;
  background: #2c333d !important;
  border: 1px solid #3d4652 !important;
  border-radius: var(--ars-radius);
  color: #fff !important;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  min-width: 46px;
}

.currency .btn:hover,
.currency .btn:focus,
.currency .btn:active,
.currency .btn.active {
  background: var(--ars-brand) !important;
  border-color: var(--ars-brand) !important;
  color: var(--ars-ink) !important;
}

.table {
  background: var(--ars-panel);
  border: 1px solid var(--ars-line);
  border-collapse: separate !important;
  border-radius: var(--ars-radius);
  border-spacing: 0;
  margin: 26px auto 110px;
  max-width: 1320px;
  overflow: hidden;
  box-shadow: var(--ars-shadow);
  width: calc(100% - 32px) !important;
}

.table th,
.table td {
  border-color: var(--ars-line) !important;
  color: var(--ars-ink-soft);
  padding: 13px 16px;
  vertical-align: middle;
}

.table th {
  background: #fff;
  color: #1f2937;
  font-size: 15px;
  font-weight: 750;
}

.table > tbody > tr:not(.cat):not(.subCat):nth-child(even) > td {
  background: #fbfcfe;
}

.table > tbody > tr:not(.cat):not(.subCat):hover > td {
  background: #fff7df;
}

.cat th {
  background: var(--ars-ink) !important;
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 800;
  padding: 18px 16px !important;
  text-align: center;
}

.subCat th {
  background: #e7ebf0 !important;
  color: #263241 !important;
  font-size: 15px !important;
  font-weight: 800;
  padding: 11px 16px !important;
  text-transform: uppercase;
}

.bg {
  background: var(--ars-brand) !important;
  color: var(--ars-ink) !important;
}

.main__table-name {
  font-size: 17px !important;
  font-weight: 750 !important;
  min-width: 330px;
}

.table td:first-child {
  line-height: 1.45;
}

.table td:nth-child(2),
.table td:nth-child(3),
.table td:nth-child(5) {
  white-space: nowrap;
}

.table td:nth-child(5) {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.minmax {
  min-width: 210px;
  text-align: center;
}

.minmax > div {
  align-items: center;
  display: grid;
  grid-template-columns: 22px minmax(82px, 1fr);
  gap: 6px;
  justify-content: center;
  margin: 3px 0;
}

.minmax > div + div {
  margin-top: 8px;
}

.minmax p {
  background: #f8fafc;
  border: 1px solid #ccd5df;
  border-radius: 6px;
  line-height: 1.2;
  margin: 0;
  min-height: 34px;
  min-width: 82px;
  padding: 7px 9px;
  text-align: center;
}

.minmax p:focus,
.table input:focus,
.table textarea:focus,
nav a:focus,
.btn:focus,
.btn1:focus {
  border-color: var(--ars-focus) !important;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.18) !important;
  outline: none !important;
}

.table input,
.table textarea {
  background: #f8fafc;
  border: 1px solid #ccd5df;
  border-radius: 6px;
  color: var(--ars-ink-soft);
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.table .btn-check {
  clip: rect(0, 0, 0, 0) !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.table textarea {
  min-height: 112px;
  resize: vertical;
}

.btn-outline-warning {
  align-items: center;
  background: #fff !important;
  border-color: var(--ars-brand-strong) !important;
  border-radius: 7px !important;
  color: var(--ars-ink) !important;
  display: inline-flex;
  font-weight: 650 !important;
  justify-content: center;
  min-height: 38px;
  min-width: 98px;
}

.btn-outline-warning::after {
  color: var(--ars-ink) !important;
}

.btn-outline-warning:hover,
.btn-check:checked + .btn-outline-warning {
  background: var(--ars-brand) !important;
  border-color: var(--ars-brand) !important;
  color: var(--ars-ink) !important;
}

.btn-danger {
  border-radius: 7px !important;
  min-height: 38px;
}

.table button:not(.btn1) {
  border-radius: 7px;
  min-height: 38px;
}

.fixed {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--ars-line);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -16px 40px rgba(17, 19, 24, 0.16);
  padding: 12px 18px;
  max-width: 1320px !important;
}

.btn1 {
  background: var(--ars-brand) !important;
  border: 0 !important;
  border-radius: var(--ars-radius) !important;
  color: var(--ars-ink) !important;
  font-weight: 800 !important;
  height: 48px !important;
  min-width: 280px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn1:hover {
  background: #ffc83d !important;
  box-shadow: 0 10px 24px rgba(246, 183, 25, 0.32);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  header.bg-dark {
    position: static;
  }

  .logo {
    font-size: 24px;
  }

  nav a,
  header.bg-dark nav a.btn,
  header.bg-dark nav a.btn-outline-warning {
    flex: 1 1 220px;
    justify-content: center;
  }

  .table {
    display: block;
    margin: 14px 8px 104px;
    overflow: visible;
    width: calc(100% - 16px) !important;
  }

  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr:has(th.main__table-name) {
    display: none;
  }

  .table tr:not(.cat):not(.subCat):has(td) {
    background: #fff;
    border-bottom: 1px solid var(--ars-line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px 12px;
  }

  .table th,
  .table td {
    font-size: 14px;
    border: 0 !important;
    padding: 0;
  }

  .cat th {
    font-size: 16px !important;
    text-align: left !important;
    padding: 18px 16px !important;
  }

  .subCat th {
    padding: 11px 16px !important;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:first-child {
    font-size: 16px;
    font-weight: 750;
    grid-column: 1 / -1;
    line-height: 1.35;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(2)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(3)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(4)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(5)::before {
    color: var(--ars-muted);
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(2)::before {
    content: "Ед. изм.";
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(3)::before {
    content: "Кол-во";
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(4)::before {
    content: "Сроки";
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(5)::before {
    content: "Цена";
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(4) {
    grid-column: 1 / -1;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(6) {
    align-self: end;
    justify-self: end;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(6) label.label {
    display: block;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(6) .btn-outline-warning {
    min-width: 118px;
  }

  .minmax > div {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .main__table-name {
    min-width: 0;
  }

  .minmax {
    min-width: 0;
  }

  .fixed {
    left: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
  }

  .btn1 {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .table {
    border-radius: 6px;
    border-spacing: 0;
    display: table;
    margin: 14px 4px 240px;
    overflow: hidden;
    table-layout: fixed;
    width: calc(100% - 8px) !important;
  }

  .table tbody {
    display: table-row-group;
    width: auto;
  }

  .table tr,
  .table tr:has(th.main__table-name),
  .table tr:not(.cat):not(.subCat):has(td) {
    display: table-row;
    padding: 0;
    width: auto;
  }

  .table th,
  .table td {
    border: 1px solid var(--ars-line) !important;
    display: table-cell;
    font-size: 10px;
    line-height: 1.2;
    padding: 6px 3px;
    vertical-align: middle;
    overflow-wrap: break-word;
    width: auto;
  }

  .table th {
    font-size: 9px;
    font-weight: 800;
    text-align: center;
  }

  .table tr:has(th.main__table-name) > th {
    font-size: 0 !important;
    line-height: 1.1;
    padding: 7px 2px;
  }

  .table tr:has(th.main__table-name) > th::after {
    color: inherit;
    display: block;
    font-size: 9px;
    line-height: 1.1;
  }

  .table tr:has(th.main__table-name) > th:nth-child(1)::after {
    content: "Услуга";
  }

  .table tr:has(th.main__table-name) > th:nth-child(2)::after {
    content: "Ед.";
  }

  .table tr:has(th.main__table-name) > th:nth-child(3)::after {
    content: "Кол-во";
  }

  .table tr:has(th.main__table-name) > th:nth-child(4)::after {
    content: "Срок";
  }

  .table tr:has(th.main__table-name) > th:nth-child(5)::after {
    content: "Цена";
  }

  .table tr:has(th.main__table-name) > th:nth-child(6)::after {
    content: "Выбор";
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:first-child {
    display: table-cell;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.15;
    overflow-wrap: anywhere;
    width: auto;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(2)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(3)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(4)::before,
  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(5)::before {
    content: none;
    display: none;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(6) {
    display: table-cell;
  }

  .table tr:not(.cat):not(.subCat):has(td) > td:nth-child(6) .btn-outline-warning {
    min-width: 0;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(1),
  .table tr:not(.cat):not(.subCat) > td:nth-child(1) {
    width: 45%;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(2),
  .table tr:not(.cat):not(.subCat) > td:nth-child(2) {
    font-size: 8px;
    text-align: center;
    width: 6%;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(3),
  .table tr:not(.cat):not(.subCat) > td:nth-child(3) {
    font-size: 9px;
    text-align: center;
    width: 6%;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(4),
  .table tr:not(.cat):not(.subCat) > td:nth-child(4) {
    text-align: center;
    width: 13%;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(5),
  .table tr:not(.cat):not(.subCat) > td:nth-child(5) {
    font-size: 9px;
    text-align: center;
    width: 17%;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(6),
  .table tr:not(.cat):not(.subCat) > td:nth-child(6) {
    text-align: center;
    width: 14%;
  }

  .cat th {
    display: table-cell;
    font-size: 13px !important;
    padding: 12px 8px !important;
    text-align: center !important;
  }

  .subCat th {
    display: table-cell;
    font-size: 11px !important;
    padding: 8px 6px !important;
  }

  .main__table-name {
    font-size: 10px !important;
    min-width: 0;
  }

  .minmax {
    min-width: 0;
  }

  .minmax > div {
    display: grid;
    gap: 2px;
    font-size: 0;
    grid-template-columns: minmax(0, 1fr);
    margin: 2px 0;
  }

  .minmax p {
    border-radius: 4px;
    font-size: 9px;
    min-height: 22px;
    min-width: 0;
    padding: 4px 3px;
    text-align: center;
  }

  .btn-outline-warning {
    border-radius: 5px !important;
    font-size: 0 !important;
    min-height: 28px;
    min-width: 0;
    padding: 3px 3px !important;
    width: 100%;
  }

  .btn-outline-warning::after {
    content: "✓";
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
  }

  input[placeholder="Заголовок в браузере"],
  input[placeholder="Заголовок документа"],
  textarea[placeholder="Текст для этапов работ"] {
    scroll-margin-bottom: 130px;
  }
}

@media (max-width: 900px) {
  .table {
    display: block;
    overflow: hidden;
  }

  .table tbody {
    display: block;
  }

  .table tr:not(.cat):not(.subCat),
  .table tr:not(.cat):not(.subCat):has(td),
  .table tr:not(.cat):not(.subCat):has(th.main__table-name) {
    display: grid !important;
    gap: 0 !important;
    grid-template-columns: 36% 9.75% 11.25% 13% 17% 13%;
    width: 100%;
  }

  .table tr:has(td[colspan]),
  .table tr:has(th[colspan]) {
    display: block !important;
  }

  .table tr:has(td[colspan]) > td,
  .table tr:has(th[colspan]) > th {
    display: block;
    width: 100% !important;
  }

  .table tr:not(.cat):not(.subCat) > th,
  .table tr:not(.cat):not(.subCat) > td {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    grid-column: auto !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    justify-content: center;
    min-width: 0;
    width: 100% !important;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(1),
  .table tr:not(.cat):not(.subCat) > td:nth-child(1) {
    align-items: center !important;
    display: flex !important;
    justify-content: flex-start;
    text-align: left;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(2),
  .table tr:not(.cat):not(.subCat) > td:nth-child(2) {
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(4),
  .table tr:not(.cat):not(.subCat) > td:nth-child(4) {
    display: block;
  }

  .table tr:not(.cat):not(.subCat) > th:nth-child(6),
  .table tr:not(.cat):not(.subCat) > td:nth-child(6) {
    align-items: center !important;
    display: flex !important;
    justify-content: center;
    text-align: center;
  }

  .table tr:has(td[colspan]),
  .table tr:has(th[colspan]),
  .table tr:not(.cat):not(.subCat):has(> td:only-child) {
    display: block !important;
  }

  .table tr:has(td[colspan]) > td,
  .table tr:has(th[colspan]) > th,
  .table tr:not(.cat):not(.subCat):has(> td:only-child) > td {
    display: block !important;
    width: 100% !important;
  }
}
