:root {
  color: #302530;
  background: #f8f4f1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 42px 24px 80px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

#admin-login[hidden],
#admin-app[hidden] {
  display: none !important;
}

.login-card,
.hero,
.panel,
.metric-card {
  border: 1px solid #eadfe5;
  box-shadow: 0 14px 36px rgb(62 23 48 / 7%);
}

.login-card {
  width: min(100%, 460px);
  padding: 34px;
  border-radius: 24px;
  background:
    radial-gradient(circle at right top, rgb(204 238 52 / 33%), transparent 34%),
    linear-gradient(135deg, #fff 0%, #fff5fa 100%);
}

.login-form,
.dialog form {
  display: grid;
  gap: 8px;
}

.login-form {
  margin-top: 26px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: 24px;
  background:
    radial-gradient(circle at right top, rgb(204 238 52 / 33%), transparent 32%),
    linear-gradient(135deg, #fff 0%, #fff5fa 100%);
}

.hero-actions,
.dialog-actions,
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #a94172;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  color: #4b1238;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  color: #352435;
  font-size: 1.4rem;
}

.lead {
  margin-bottom: 0;
  color: #746672;
  line-height: 1.55;
}

.notice {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid #ead89a;
  border-radius: 14px;
  background: #fff8e8;
  color: #6d5420;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #d92770;
  border-radius: 11px;
  background: linear-gradient(135deg, #e91e63, #f06292);
  color: #fff;
  font-weight: 700;
}

.button:hover:not(:disabled) {
  box-shadow: 0 5px 14px rgb(233 30 99 / 25%);
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button--secondary,
.text-button,
.icon-button {
  border-color: #e6ccd9;
  background: #fff;
  color: #a94172;
}

.text-button {
  min-height: 42px;
  padding: 10px 4px;
  border: 0;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
  background: #fff;
}

.metric-label {
  color: #857684;
  font-size: 0.82rem;
  font-weight: 600;
}

.metric-value {
  color: #542143;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.metric-value--small {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.panel {
  padding: 28px;
  border-radius: 22px;
  background: #fff;
}

.panel-heading,
.filters {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.filters {
  align-items: end;
  justify-content: flex-start;
  margin: 8px 0 18px;
}

.filters label,
.dialog label,
.login-form label {
  display: grid;
  gap: 6px;
  color: #4d3847;
  font-size: 0.86rem;
  font-weight: 700;
}

.filters label {
  flex: 1;
  min-width: 180px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #ddcbd5;
  border-radius: 11px;
  background: #fff;
  color: #392d37;
  padding: 8px 12px;
}

input[readonly],
select:disabled {
  background: #f7f1f4;
  color: #6d5d68;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(233 30 99 / 24%);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #f0e6eb;
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #f0e6eb;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fff7fa;
  color: #886d7c;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fffafd;
}

.code-cell {
  color: #a94172;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.link-cell a {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  color: #a94172;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.empty-cell {
  padding: 32px;
  color: #847683;
  text-align: center;
}

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mark {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a5a10;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: middle;
}

.mark--off {
  background: #f3e8ee;
  color: #8d4d68;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.check-row input {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid #e7d3de;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 80px rgb(44 16 43 / 28%);
}

.picker-hint {
  margin: 0;
  color: #746672;
  font-size: 0.8rem;
  font-weight: 600;
}

.product-picker {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #ddcbd5;
  border-radius: 11px;
  background: #fff;
}

.product-picker button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0e6eb;
  background: #fff;
  color: #392d37;
  padding: 9px 12px;
  text-align: left;
}

.product-picker button:last-child {
  border-bottom: 0;
}

.product-picker button.is-selected,
.product-picker button:hover {
  background: #fff0f5;
}

.dialog::backdrop {
  background: rgb(46 20 38 / 42%);
}

.review-dialog-description,
.form-result {
  margin: 0;
  color: #746672;
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-result--error {
  color: #b62b24;
}

.form-result--ok {
  color: #287446;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 900px) {
  .hero,
  .panel-heading,
  .filters,
  .metrics {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page {
    padding: 24px 14px 48px;
  }
}
