.add-inventory-page {
  min-width: 0;
  overflow-x: hidden;
  padding-bottom: 86px;
  background: #eef3f9;
}

.add-inventory-content {
  display: grid;
  gap: 42px;
  width: 100%;
  max-width: 100%;
  padding: 26px 28px 0;
}

.add-inventory-content > *,
.add-card,
.matrix-scroll,
.add-detail-grid,
.sector-grid,
.sector-grid label,
.detail-card label,
.option-card {
  min-width: 0;
  max-width: 100%;
}

.add-page-title h1 {
  margin: 0 0 10px;
  color: #151a24;
  font-size: 27px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.add-page-title p {
  margin: 0;
  color: #3f4a5b;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

.add-card {
  border: 1px solid #d9e2ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(21, 37, 64, 0.08);
}

.add-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0b5bd7;
}

.add-card-title h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
}

.add-card-title svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.3;
}

.sector-card {
  padding: 24px;
}

.sector-card > .add-card-title {
  padding-bottom: 22px;
  border-bottom: 1px solid #e1e6ef;
}

.journey-field {
  width: 230px;
  margin-top: 26px;
}

.sector-block {
  margin-top: 27px;
}

.sector-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 21px;
  color: #111827;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sector-block h3 svg {
  width: 19px;
  height: 19px;
  color: #005fdc;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 19px 22px;
  align-items: end;
}

.sector-grid label,
.journey-field label,
.detail-card label,
.control-grid label {
  display: grid;
  gap: 8px;
}

.sector-grid label span,
.journey-field span,
.detail-card label span,
.control-grid label span,
.days-field > span {
  color: #5c5f60;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
}

.sector-grid input,
.sector-grid select,
.journey-field select,
.detail-card input,
.control-grid input,
.control-grid select,
.fare-matrix input,
.fare-matrix select {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: #182233;
  background: #fff;
  outline: none;
}

.sector-grid input,
.sector-grid select,
.journey-field select,
.detail-card input,
.control-grid input,
.control-grid select {
  height: 37px;
  padding: 0 14px;
  font-size: 13px;
}

.sector-grid select,
.journey-field select,
.control-grid select,
.fare-matrix select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #59677a 50%),
    linear-gradient(135deg, #59677a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 13px) 16px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.with-icon {
  position: relative;
}

.with-icon > svg {
  position: absolute;
  left: 12px;
  bottom: 10px;
  width: 16px;
  height: 16px;
  color: #6a7280;
}

.with-icon input {
  padding-left: 34px;
}

.days-field {
  display: grid;
  gap: 7px;
  align-self: end;
}

.days-field > span {
  color: #202b3b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.days-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.days-row label {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #111827;
  font-size: 8px;
  font-weight: 900;
}

.days-row input {
  width: 14px;
  height: 14px;
  accent-color: #005bd8;
}

.sector-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  grid-column: span 2;
  min-width: 0;
}

.sector-buttons button,
.matrix-head button,
.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  font: inherit;
}

.sector-buttons button {
  flex: 1 1 175px;
  min-width: 0;
  padding: 10px 20px;
  border-radius: 999px;
  color: #fff;
  background: #0057d9;
  font-size: 13px;
  font-weight: 600;
}

.sector-buttons svg,
.matrix-head button svg,
.footer-btn svg {
  width: 15px;
  height: 15px;
}

.matrix-card {
  width: min(100%, 1400px);
  justify-self: center;
  overflow: hidden;
  padding: 25px 24px 26px;
}

.matrix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e6ef;
}

.matrix-head button {
  height: 35px;
  padding: 0 16px;
  border-radius: 7px;
  color: #005bd8;
  background: #f0f4ff;
  font-size: 14px;
  font-weight: 700;
}

.matrix-scroll {
  width: 100%;
  margin-top: 19px;
  overflow-x: auto;
}

.fare-matrix {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.fare-matrix th {
  padding: 13px 13px 12px;
  color: #5b6270;
  background: #eef1fb;
  font-size: 14px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.fare-matrix th:first-child,
.fare-matrix td:first-child {
  text-align: left;
}

.fare-matrix td {
  padding: 6px 9px;
  text-align: center;
}

.fare-matrix input,
.fare-matrix select {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  text-align: center;
}

.fare-matrix select {
  text-align: left;
}

.fare-matrix td:first-child select {
  width: 118px;
}

.fare-matrix td button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 28px;
  margin-inline: auto;
  color: #d71920;
  background: transparent;
}

.fare-matrix td button svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
}

.add-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: min(100%, 1400px);
  justify-self: center;
}

.detail-card {
  min-height: 254px;
  padding: 24px;
}

.detail-card > .add-card-title {
  padding-bottom: 21px;
  border-bottom: 1px solid #e1e6ef;
}

.detail-card > label,
.option-card,
.detail-card h3,
.control-grid,
.departure-note {
  margin-top: 23px;
}

.phone-row {
  display: flex;
  gap: 4px;
}

.phone-row b {
  display: grid;
  place-items: center;
  width: 44px;
  height: 37px;
  border-radius: 7px;
  color: #fff;
  background: #0057d9;
  font-size: 12px;
}

.option-card {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 16px;
  border: 1px solid #dce3ec;
  border-radius: 9px;
}

.option-card + .option-card {
  margin-top: 13px;
}

.option-card input {
  width: 15px;
  height: 15px;
  accent-color: #0057d9;
  margin: 0;
}

.option-card span {
  display: grid;
  gap: 4px;
}

.option-card strong {
  color: #243044;
  font-size: 14px;
  font-weight: 700;
}

.option-card em {
  color: #626c7a;
  font-size: 13px;
  line-height: 1.35;
  font-style: normal;
}

.detail-card h3 {
  margin-bottom: 0;
  color: #5c5f60;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.departure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 0 9px;
  border-radius: 7px;
  color: #5c6574;
  background: #eef1ff;
  font-size: 13px;
  font-weight: 600;
}

.departure-note svg {
  width: 15px;
  height: 15px;
}

.add-inventory-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 70px;
  margin-top: 84px;
  padding: 0 31px;
  border-top: 1px solid #e4e9f1;
  background: #fff;
  box-shadow: 0 -6px 18px rgba(24, 39, 64, 0.04);
}

.add-inventory-footer p {
  margin: 0;
  color: #5f6672;
  font-size: 13px;
}

.add-inventory-footer > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 20px;
}

.footer-btn {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 0 20px;
  border-color: #dce3ec;
  border-radius: 999px;
  color: #111827;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}

.footer-btn.primary {
  min-width: 184px;
  color: #fff;
  background: #0057d9;
  border-color: #0057d9;
}

@media (max-width: 1320px) {
  .add-inventory-content {
    gap: 32px;
    padding: 24px 22px 0;
  }

  .sector-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sector-buttons {
    grid-column: span 2;
  }

  .add-detail-grid {
    gap: 20px;
  }
}

@media (min-width: 1321px) and (max-width: 1600px) {
  .sector-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sector-buttons {
    grid-column: span 2;
  }
}

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

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

  .add-detail-grid .detail-card:last-child {
    grid-column: 1 / -1;
  }
}

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

  .add-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    min-height: 0;
  }

  .add-inventory-footer {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 22px;
  }

  .add-inventory-footer > div {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-btn {
    flex: 1 1 150px;
  }
}

@media (max-width: 860px) {
  .add-detail-grid {
    grid-template-columns: 1fr;
  }

  .add-detail-grid .detail-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .add-inventory-page {
    padding-bottom: 0;
  }

  .add-inventory-content {
    gap: 24px;
    padding: 20px 14px 0;
  }

  .add-page-title h1 {
    font-size: 23px;
    line-height: 1.12;
  }

  .add-page-title p {
    font-size: 12px;
  }

  .sector-card,
  .matrix-card,
  .detail-card {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .journey-field {
    width: 100%;
  }

  .sector-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .sector-buttons {
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sector-buttons button {
    width: 100%;
    flex: 0;
  }

  .days-row {
    justify-content: space-between;
    gap: 8px;
  }

  .matrix-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-head button {
    width: 100%;
  }

  .fare-matrix {
    min-width: 960px;
  }

  .add-inventory-footer {
    position: static;
    margin-top: 32px;
    padding: 16px 14px;
  }

  .add-inventory-footer > div,
  .footer-btn,
  .footer-btn.primary {
    width: 100%;
  }

  .add-inventory-footer > div {
    justify-content: stretch;
  }
}

@media (max-width: 560px) {
  .sector-grid {
    gap: 16px;
  }

  .sector-block h3 {
    align-items: flex-start;
    font-size: 13px;
  }

  .sector-grid input,
  .sector-grid select,
  .journey-field select,
  .detail-card input,
  .control-grid input,
  .control-grid select {
    height: 40px;
  }

  .days-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .days-row label {
    width: 25px;
  }

  .phone-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .add-inventory-footer p {
    text-align: center;
  }
}
