body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f4f7f9;
  padding: 20px;
  color: #1a1a1a;
}
.container {
  background: white;
  padding: 40px;
  border-radius: 4px;
  width: 100%;
  max-width: 1100px;
  margin: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Панель */
.admin-panel {
  background: #fff;
  padding: 25px;
  border: 2px solid #2c3e50;
  margin-bottom: 40px;
  border-radius: 8px;
}
.field {
  margin-bottom: 15px;
}
.row-flex {
  display: flex;
  gap: 15px;
}
.flex-1 {
  flex: 1;
}
.flex-2 {
  flex: 2;
}
label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #34495e;
  text-transform: uppercase;
}
input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.btn-add {
  background: #27ae60;
  color: white;
  flex: 2;
  cursor: pointer;
  border: none;
  font-weight: bold;
  padding: 15px;
  border-radius: 4px;
}
.btn-clear {
  background: #95a5a6;
  color: white;
  flex: 1;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-weight: bold;
}

/* ТЗ */
.header-info {
  text-align: center;
  border-bottom: 5px double #000;
  padding-bottom: 10px;
  margin-bottom: 40px;
  font-size: 24px;
  font-weight: 900;
}

.order-item-block {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 30px;
  border: 1px solid #000;
  padding: 25px;
  margin-bottom: 50px;
  position: relative;
  page-break-inside: avoid;
}

.item-specs h3 {
  margin: 0 0 10px 0;
  font-size: 22px;
  border-bottom: 1px solid #000;
}
.item-summary {
  background: #2c3e50;
  color: white;
  padding: 10px;
  font-size: 13px;
  font-weight: bold;
  margin: 10px 0;
}

.side-header {
  font-size: 12px;
  font-weight: bold;
  margin-top: 20px;
  border-left: 5px solid #27ae60;
  padding: 5px;
  background: #f1f1f1;
}

.pcb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 55px 0 10px 5px;
  position: relative;
  border-left: 2px solid #000;
  margin-bottom: 25px;
}
.led-box {
  width: 24px;
  height: 24px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  position: relative;
  background: #fff;
  flex-shrink: 0;
}
.label-t {
  position: absolute;
  top: -22px;
  font-weight: bold;
  font-size: 12px;
  color: #000;
}
.in-label {
  position: absolute;
  top: 30px;
  left: 0;
  color: red;
  font-size: 10px;
  font-weight: 900;
  border: 2px solid red;
  padding: 2px 4px;
  white-space: nowrap;
  background: white;
  z-index: 10;
}

.map-box {
  text-align: center;
  border: 1px solid #eee;
  background: #fafafa;
  padding: 10px;
}
.grand-total-box {
  margin-top: 40px;
  padding: 25px;
  border: 2px solid #000;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
}

.print-btn {
  background: #2c3e50;
  color: white;
  width: 100%;
  padding: 15px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}
/* Синяя линия спайки внутри ряда */
.soldering-line-inner {
  position: absolute;
  right: -3px; /* Центрируем между ячейками */
  top: 0;
  height: 100%;
  width: 3px;
  background-color: rgb(34, 34, 161);
  z-index: 10; /* Добавьте эти строки: */
  -webkit-print-color-adjust: exact; /* Для Chrome, Edge, Safari */
  print-color-adjust: exact; /* Стандарт */
}
/* Универсальный класс красной кнопки удаления */
.btn-delete-action {
  display: inline-block;
  background-color: #e74c3c; /* Красный цвет */
  color: #ffffff; /* Белый текст */
  border: none;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-top: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-delete-action:hover {
  background-color: #c0392b; /* Темно-красный при наведении */
}

.btn-delete-action:active {
  transform: translateY(1px); /* Эффект нажатия */
  box-shadow: none;
}
@media print {
  /* Скрываем всё лишнее */
  .no-print {
    display: none !important;
  }
  .btn-delete-action {
    display: none !important;
  }
  /* Убираем внешние отступы страницы */
  body {
    background: white;
    padding: 0;
    margin: 0;
  }
  .container {
    box-shadow: none;
    max-width: 90%;
    border: none;
    padding: 10px;
  }
  .order-item-block {
    display: grid;
    /* 1fr - левая часть, 100px - правая (схема). 
           Уменьшаем правую часть, чтобы она "прижалась" левее */
    grid-template-columns: 1fr 100px;
    gap: 0px; /* Убираем зазор между текстом и схемой */
    width: 100%;
    border: 1px solid #000;
    padding: 5px;
  }

  /* Дополнительно смещаем саму схему внутри её контейнера */
  .map-box {
    text-align: left; /* Прижимаем SVG к левому краю колонки */
    margin-left: -20px; /* Принудительно двигаем схему еще левее, наезжая на пустое место */
  }

  .map-box svg {
    width: 100px; /* Делаем чуть компактнее */
    height: auto;
  }

  /* Делаем заголовки компактнее */
  .item-specs h3 {
    font-size: 16px;
    margin-bottom: 5px;
  }
  .item-summary {
    padding: 5px;
    font-size: 10px;
    margin: 5px 0;
    font-weight: 600;
  }
  .side-header {
    font-size: 10px;
    margin-top: 8px;
    padding: 2px;
  }

  /* Ужимаем ряды диодов */
  .pcb-row {
    padding: 25px 0 2px 5px; /* Уменьшили верхний отступ под "ВХОД" */
    gap: 2px; /* Диоды ближе друг к другу */
    margin-bottom: 5px;
  }

  .led-box {
    width: 18px; /* Уменьшили размер квадратика (было 24) */
    height: 18px;
    font-size: 10px; /* Шрифт "X" мельче */
  }

  /* Надписи над диодами */
  .label-t {
    top: -18px;
    font-size: 9px;
  }

  .in-label {
    top: 2px;
    font-size: 8px;
  }

  /* Общий итог в конце */
  .grand-total-box {
    margin-top: 20px;
    padding: 10px;
    font-size: 10px;
    border: 2px solid #000;
  }
  /* Создаем контейнер для номера страницы внизу каждой страницы */
  body {
    counter-reset: page; /* Инициализируем счетчик */
  }

  .page-number::after {
    /* Формат: Страница 1 из 5 */
    content: "Страница " counter(page) " из " counter(pages);
    counter-increment: page; /* Увеличиваем на каждой странице */

    position: fixed;
    bottom: 0;
    right: 0;
    font-size: 10pt;
    color: #666;
  }
}

@page {
  size: auto; /* автоматический размер листа */
  margin: 5mm; /* минимальные поля, чтобы убрать системные надписи */
}
