.admin-fiscal-main {
  display: grid;
  gap: 22px;
}

.admin-fiscal-hero {
  align-items: center;
}

.fiscal-environment-badge,
.fiscal-counter,
.fiscal-product-state,
.fiscal-order-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.fiscal-environment-badge {
  color: #5f4200;
  background: #fff3c4;
  border: 1px solid #e4c76c;
  white-space: nowrap;
}

.fiscal-runtime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fiscal-runtime-card {
  display: grid;
  gap: 6px;
  min-height: 126px;
  padding: 18px;
  border: 1px solid #dce5df;
  border-radius: 18px;
  background: #ffffff;
  color: #17231c;
  box-shadow: 0 10px 26px rgba(18, 54, 33, 0.06);
}

.fiscal-runtime-card span,
.fiscal-runtime-card small {
  color: #5a6a60;
}

.fiscal-runtime-card strong {
  font-size: 1.08rem;
}

.fiscal-runtime-card.is-ready {
  border-color: #92c5a4;
  background: #f4fbf6;
}

.fiscal-runtime-card.is-pending,
.fiscal-runtime-card.is-locked {
  border-color: #e6cf8b;
  background: #fffaf0;
}

.fiscal-section {
  color: #17231c;
  background: #ffffff;
}

.fiscal-form {
  display: grid;
  gap: 18px;
}

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

.fiscal-form label,
.fiscal-product-search,
.fiscal-order-lookup label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.fiscal-form label > span,
.fiscal-product-search > span,
.fiscal-order-lookup label > span {
  color: #34463a;
  font-size: 0.82rem;
  font-weight: 800;
}

.fiscal-form input,
.fiscal-form select,
.fiscal-form textarea,
.fiscal-product-search input,
.fiscal-order-lookup input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd8cf;
  border-radius: 10px;
  padding: 10px 12px;
  color: #15211a;
  background: #ffffff;
  font: inherit;
}

.fiscal-form textarea {
  resize: vertical;
  min-height: 130px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.45;
}

.fiscal-form .fiscal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d7e1da;
  border-radius: 12px;
  background: #f8fbf9;
}

.fiscal-form .fiscal-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #257d48;
}

.fiscal-form .fiscal-check > span {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.fiscal-form :disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.fiscal-form input:focus-visible,
.fiscal-form select:focus-visible,
.fiscal-form textarea:focus-visible,
.fiscal-product-search input:focus-visible,
.fiscal-order-lookup input:focus-visible,
.fiscal-product-row:focus-visible,
.fiscal-product-dialog button:focus-visible {
  outline: 3px solid rgba(37, 125, 72, 0.28);
  outline-offset: 2px;
  border-color: #257d48;
}

.fiscal-form .is-wide {
  grid-column: span 2;
}

.fiscal-form .is-full {
  grid-column: 1 / -1;
}

.fiscal-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.fiscal-form-actions small {
  color: #627067;
}

.fiscal-product-search {
  max-width: 420px;
  margin: 4px 0 16px;
}

.fiscal-product-list {
  display: grid;
  gap: 8px;
}

.fiscal-product-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #dce5df;
  border-radius: 13px;
  background: #ffffff;
  color: #17231c;
  text-align: left;
  cursor: pointer;
}

.fiscal-product-row:hover {
  border-color: #9fbeaa;
  background: #f8fbf9;
}

.fiscal-product-identity,
.fiscal-product-codes {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fiscal-product-identity strong,
.fiscal-product-identity small,
.fiscal-product-codes span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fiscal-product-identity small,
.fiscal-product-codes span {
  color: #627067;
  font-size: 0.82rem;
}

.fiscal-product-state.is-ready,
.fiscal-order-state.is-ready {
  color: #14572d;
  background: #e5f6ea;
  border: 1px solid #a9d8b6;
}

.fiscal-product-state.is-pending,
.fiscal-order-state.is-pending,
.fiscal-counter {
  color: #6c4b00;
  background: #fff4cd;
  border: 1px solid #e6cf8b;
}

.fiscal-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #cbd8cf;
  border-radius: 12px;
  color: #627067;
  background: #fafcfb;
}

.fiscal-order-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  max-width: 800px;
}

.fiscal-order-result {
  display: grid;
  gap: 15px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #f9fbfa;
}

.fiscal-order-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.fiscal-order-heading > div {
  display: grid;
  gap: 4px;
}

.fiscal-order-heading small {
  color: #627067;
}

.fiscal-missing-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #704e08;
}

.fiscal-document-card {
  display: grid;
  gap: 9px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #cdd9d1;
  background: #ffffff;
}

.fiscal-document-card code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 9px;
  border-radius: 8px;
  background: #eef3ef;
  color: #243329;
}

.fiscal-document-card .admin-secondary-button,
.fiscal-order-actions .admin-primary-button {
  justify-self: start;
}

.fiscal-order-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fiscal-order-actions small {
  color: #627067;
}

.fiscal-product-dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: #17231c;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(12, 36, 22, 0.28);
}

.fiscal-product-dialog::backdrop {
  background: rgba(11, 31, 19, 0.58);
}

.fiscal-product-dialog > .fiscal-form,
.fiscal-dialog-heading {
  padding: 0 24px 24px;
}

.fiscal-dialog-heading {
  padding-top: 8px;
}

.fiscal-dialog-heading h2,
.fiscal-dialog-heading p {
  margin-top: 0;
}

.fiscal-dialog-heading > p:last-child {
  color: #627067;
}

.fiscal-dialog-close {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px 0;
}

.fiscal-dialog-close button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #26372c;
  background: #edf3ef;
  font-size: 1.6rem;
  cursor: pointer;
}

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

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

  .fiscal-product-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .fiscal-product-codes {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 700px) {
  .fiscal-runtime-grid,
  .fiscal-form-grid,
  .fiscal-order-lookup {
    grid-template-columns: 1fr;
  }

  .fiscal-form .is-wide,
  .fiscal-form .is-full {
    grid-column: auto;
  }

  .fiscal-product-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .fiscal-product-codes {
    grid-column: auto;
    grid-row: auto;
  }

  .fiscal-product-state {
    justify-self: start;
  }

  .fiscal-order-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fiscal-environment-badge {
    white-space: normal;
  }

  .fiscal-product-dialog > .fiscal-form,
  .fiscal-dialog-heading {
    padding-left: 16px;
    padding-right: 16px;
  }
}
