.product-save-callout {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgb(216 240 111 / 24%);
  border-radius: 14px;
  background: rgb(216 240 111 / 8%);
}

.product-save-callout strong {
  display: block;
  color: white;
  font-size: 12px;
}

.product-save-callout p {
  margin: 4px 0 0;
  color: #adb6c4;
  font-size: 10px;
  line-height: 1.45;
}

.product-save-callout button {
  min-height: 38px;
  border: 1px solid var(--lime);
  border-radius: 10px;
  background: var(--lime);
  color: var(--nav);
  font-size: 11px;
  font-weight: 850;
}

.product-save-callout button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.products-page {
  min-height: calc(100vh - 72px);
}

.products-topbar {
  align-items: center;
}

.products-topbar .primary-button,
.products-empty .primary-button,
.product-dialog-actions .primary-button {
  margin-top: 0;
}

.products-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.products-toolbar > p {
  margin: 0 0 11px;
  color: var(--ink-soft);
  font-size: 11px;
}

.products-toolbar > p strong {
  color: var(--ink);
}

.product-search {
  display: grid;
  width: min(420px, 100%);
  gap: 7px;
}

.product-search span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.product-search input {
  height: 45px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 74%);
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.product-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(243 111 69 / 12%);
}

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

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgb(255 254 250 / 90%);
  box-shadow: 0 14px 38px rgb(31 39 51 / 5%);
}

.product-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card-heading h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.035em;
}

.product-card-code {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 800;
}

.product-card-meta {
  margin: 6px 0 15px;
  color: var(--ink-soft);
  font-size: 10px;
}

.product-card-price {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-card-price span,
.product-card-stats span {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.product-card-price strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 27px;
  letter-spacing: -0.055em;
}

.product-card-price small {
  color: #68920c;
  font-size: 10px;
  font-weight: 750;
}

.product-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 15px 0;
}

.product-card-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.product-card-notes {
  min-height: 31px;
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.product-card-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.product-card-actions button:first-child {
  border-color: var(--nav);
  background: var(--nav);
  color: white;
}

.product-card-actions .delete-product:hover {
  border-color: #e8a18f;
  color: var(--accent-dark);
}

.products-feedback,
.products-empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: rgb(255 255 255 / 42%);
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.products-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.empty-product-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px 17px 17px 6px;
  background: var(--lime);
  color: var(--nav);
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-4deg);
}

.products-empty h2 {
  margin: 6px 0 0;
  font-size: 21px;
}

.products-empty p {
  max-width: 42ch;
  margin: 0 0 8px;
  line-height: 1.55;
}

.product-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 90px rgb(21 32 51 / 28%);
}

.product-dialog::backdrop {
  background: rgb(21 32 51 / 48%);
  backdrop-filter: blur(3px);
}

.product-dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.product-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 3px;
}

.product-dialog-heading h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -0.045em;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink-soft);
  font-size: 20px;
}

.dialog-field {
  display: grid;
  gap: 7px;
}

.dialog-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.dialog-field small {
  color: #9298a1;
  font-size: 9px;
  font-weight: 600;
}

.dialog-field input,
.dialog-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
  padding: 11px 12px;
}

.dialog-field input {
  height: 44px;
}

.dialog-field textarea {
  resize: vertical;
}

.dialog-field input:focus,
.dialog-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(243 111 69 / 12%);
}

.dialog-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgb(243 111 69 / 28%);
  border-radius: 10px;
  background: rgb(243 111 69 / 8%);
  color: var(--accent-dark);
  font-size: 10px;
}

.product-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 16px;
  border: 1px solid rgb(216 240 111 / 34%);
  border-radius: 12px;
  background: var(--nav);
  box-shadow: 0 18px 44px rgb(21 32 51 / 24%);
  color: white;
  font-size: 11px;
  font-weight: 750;
}

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

@media (max-width: 720px) {
  .products-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .products-toolbar > p {
    margin: 0;
  }

  .product-search {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-topbar .primary-button {
    width: 100%;
  }

  .product-dialog form {
    padding: 19px;
  }

  .product-dialog-actions > button {
    flex: 1;
  }
}
