.pay-doc-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
}

.pay-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 2px 2px 4px;
}

.pay-doc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pay-doc-title-row img {
  width: 28px !important;
  min-width: 28px;
  max-width: 28px;
  height: 28px !important;
  min-height: 28px;
  max-height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
}

.pay-doc-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  line-height: 1.1;
}

.pay-doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: #50627a;
  font-size: 12px;
  font-weight: 700;
}

.pay-doc-breadcrumb strong {
  color: #0b63ce;
}

.pay-doc-header .actions {
  margin: 0;
}

.pay-doc-xml-import {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pay-doc-xml-import img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.pay-doc-section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.pay-doc-section {
  grid-column: span 12;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
}

.pay-doc-section.pay-doc-half {
  grid-column: span 6;
}

.pay-doc-section.pay-doc-third {
  grid-column: span 4;
}

.pay-doc-section.pay-doc-quarter {
  grid-column: span 3;
}

.pay-doc-section.pay-doc-two-thirds {
  grid-column: span 8;
}

.pay-doc-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.018em;
  text-transform: uppercase;
}

.pay-doc-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.pay-doc-fields > .field {
  grid-column: span 3;
  min-width: 0;
}

.pay-doc-fields > .field.pay-col-2 { grid-column: span 2; }
.pay-doc-fields > .field.pay-col-3 { grid-column: span 3; }
.pay-doc-fields > .field.pay-col-4 { grid-column: span 4; }
.pay-doc-fields > .field.pay-col-5 { grid-column: span 5; }
.pay-doc-fields > .field.pay-col-6 { grid-column: span 6; }
.pay-doc-fields > .field.pay-col-7 { grid-column: span 7; }
.pay-doc-fields > .field.pay-col-8 { grid-column: span 8; }
.pay-doc-fields > .field.pay-col-9 { grid-column: span 9; }
.pay-doc-fields > .field.pay-col-10 { grid-column: span 10; }
.pay-doc-fields > .field.pay-col-12 { grid-column: span 12; }

.pay-doc-section .field label {
  display: block;
  margin-bottom: 5px;
  color: #425466;
  font-size: 11px;
  font-weight: 800;
}

.pay-doc-section .field input,
.pay-doc-section .field select,
.pay-doc-section .field textarea {
  width: 100%;
  min-width: 0;
}

.pay-doc-section .field input[readonly] {
  background: #f5f7fb;
  color: #425466;
}

.pay-doc-input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.pay-account-search {
  margin-bottom: 6px;
}

.pay-doc-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px;
  border: 1px solid #4c8ee8;
  border-radius: 7px;
  background: var(--white);
  color: #0b63ce;
  font-size: 18px;
  cursor: pointer;
}

.pay-doc-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.pay-doc-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.pay-doc-table th,
.pay-doc-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  color: #425466;
  font-size: 11px;
  vertical-align: middle;
  text-align: left;
}

.pay-doc-table th {
  background: #f7f9fc;
  font-weight: 900;
}

.pay-doc-table input,
.pay-doc-table select {
  width: 100%;
  min-width: 68px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
}

.pay-doc-table .pay-item-index {
  width: 38px;
  text-align: center;
}

.pay-doc-table .pay-item-total {
  color: var(--primary);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.pay-doc-remove {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #9dafc6;
  border-radius: 6px;
  background: var(--white);
  color: #315c96;
  cursor: pointer;
}

.pay-doc-subtotal {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  padding-top: 9px;
  color: #425466;
  font-size: 12px;
  font-weight: 800;
}

.pay-doc-subtotal strong {
  min-width: 110px;
  color: var(--primary);
  font-size: 14px;
  text-align: right;
}

.pay-doc-total-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 39px;
  padding: 8px 12px;
  border-radius: 7px;
  background: #eef3ff;
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.pay-doc-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 12px;
  border: 1px dashed #6f9fdf;
  border-radius: 7px;
  background: #fbfcff;
  color: #49647f;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.pay-doc-upload strong {
  color: #0b63ce;
}

.pay-doc-parcels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.pay-doc-parcel-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8faff;
}

.pay-doc-hint {
  min-height: 18px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.pay-doc-hint[data-tone="success"] {
  color: #16803a;
}

.pay-save-success-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.pay-save-success-popup.is-open {
  display: flex;
}

.pay-save-success-dialog {
  display: flex;
  width: min(390px, calc(100vw - 40px));
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px;
  border: 1px solid #b9c9dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.38);
  color: #183b64;
  text-align: center;
}

.pay-save-success-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #16803a;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.pay-save-success-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.pay-save-success-button {
  min-width: 110px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #183b64;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pay-save-success-button:focus-visible {
  outline: 3px solid rgba(24, 59, 100, 0.32);
  outline-offset: 3px;
}

.pay-save-blocked-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.68);
}

.pay-save-blocked-popup.is-open { display: flex; }

.pay-save-blocked-dialog {
  display: flex;
  width: min(460px, calc(100vw - 40px));
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  border: 1px solid #f2b8b5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.48);
  color: #183b64;
  text-align: center;
}

.pay-save-blocked-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #c62828;
  color: #fff;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.pay-save-blocked-title {
  color: #a61b1b;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.pay-save-blocked-message {
  max-width: 390px;
  color: #334155;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.pay-save-blocked-button {
  min-width: 110px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #a61b1b;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pay-save-blocked-button:focus-visible {
  outline: 3px solid rgba(166, 27, 27, 0.3);
  outline-offset: 3px;
}

.pay-doc-hidden-meta {
  display: none;
}

.pay-supplier-register-btn {
  width: fit-content;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1769c2;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pay-supplier-register-btn:hover {
  text-decoration: underline;
}

.pay-supplier-registration-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  background: rgba(15, 23, 42, 0.64);
}

.pay-supplier-registration-dialog {
  width: min(1500px, calc(100vw - 40px));
  min-height: calc(100vh - 40px);
  border: 1px solid #b9c9dd;
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.42);
  overflow: hidden;
}

.pay-supplier-registration-content > .card {
  margin: 0;
  border: 0;
  box-shadow: none;
}

html[data-theme="dark"] .pay-doc-section,
html[data-theme="dark"] .pay-doc-search-btn,
html[data-theme="dark"] .pay-doc-table input,
html[data-theme="dark"] .pay-doc-table select,
html[data-theme="dark"] .pay-doc-remove {
  background: #1b2230;
}

html[data-theme="dark"] .pay-doc-table th,
html[data-theme="dark"] .pay-doc-section .field input[readonly],
html[data-theme="dark"] .pay-doc-parcel-row,
html[data-theme="dark"] .pay-doc-upload {
  background: #151b26;
}

html[data-theme="dark"] .pay-save-success-dialog {
  border-color: #53637a;
  background: #1b2230;
  color: #f4f7fb;
}

@media (max-width: 1100px) {
  .pay-doc-section.pay-doc-half,
  .pay-doc-section.pay-doc-third,
  .pay-doc-section.pay-doc-quarter,
  .pay-doc-section.pay-doc-two-thirds {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .pay-doc-header .actions,
  .pay-doc-header .actions button {
    width: 100%;
  }

  .pay-doc-fields > .field,
  .pay-doc-fields > .field[class*="pay-col-"] {
    grid-column: span 12;
  }
}
