:root {
  --bg: #f8f3e9;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --panel-border: rgba(217, 200, 171, 0.95);
  --text: #000000;
  --muted: #5f4634;
  --accent: #c06e32;
  --accent-strong: #9e5528;
  --accent-soft: #d4824a;
  --error: #9f2f2f;
  --success: #2e7d4f;
  --shadow: 0 18px 40px rgba(62, 42, 22, 0.12);
  --radius: 22px;
  --font: Arial, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 75% 45% at 50% -10%, rgba(192, 110, 50, 0.14), transparent 56%),
    radial-gradient(ellipse 55% 38% at 100% 0%, rgba(192, 110, 50, 0.08), transparent 48%),
    linear-gradient(180deg, #fffdf8 0%, #f8f3e9 48%, #f3eadc 100%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 40px 0 88px;
  display: grid;
  gap: 28px;
}

.hero {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.75), transparent 24%),
    radial-gradient(circle at 82% 0%, rgba(192, 110, 50, 0.08), transparent 28%),
    linear-gradient(135deg, #fff7ea 0%, #f8f3e9 52%, #f1e5d3 100%);
  border-radius: 30px;
  padding: 26px 42px 34px;
  color: #000000;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  border: 1px solid rgba(192, 110, 50, 0.28);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-soft), var(--accent), transparent);
  opacity: 0.95;
}

.hero__logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(192, 110, 50, 0.24);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(62, 42, 22, 0.12);
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6ead8 0%, #f0e3cf 100%);
  border: 1px solid rgba(192, 110, 50, 0.22);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #000000;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 46px);
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hero h1 span {
  display: block;
}

.hero p {
  margin: 0;
  color: #000000;
  max-width: 760px;
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#menu-link {
  display: inline-flex;
  width: fit-content;
  align-self: flex-start;
}

.panel {
  background: linear-gradient(180deg, #ffffff 0%, var(--panel) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel__header h2 {
  margin: 6px 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a1512 0%, #000000 100%);
  color: #f8f3e9;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(192, 110, 50, 0.35);
  box-shadow: 0 2px 8px rgba(62, 42, 22, 0.14);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent-strong);
  margin: 0;
  font-weight: 700;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 820px;
}

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

.form__lead-field {
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.form__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-strong);
}

.table {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(62, 42, 22, 0.08);
}

.table__head,
.item-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.8fr 0.8fr 60px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.table__head {
  background: linear-gradient(180deg, #f6ead8 0%, #f0e3cf 100%);
  color: #000000;
  font-weight: 700;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table__body {
  display: grid;
  gap: 0;
}

.item-row {
  border-bottom: 1px solid var(--panel-border);
  background: #fffdf8;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.item-row:last-child {
  border-bottom: none;
}

.item-row:hover {
  background: #f8efe2;
}

.select,
.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d9c8ab;
  background: #fffdf8;
  color: var(--text);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background-color 150ms ease;
}

.select:focus,
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 110, 50, 0.16);
  background: #ffffff;
}

.input.is-invalid,
.select.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(159, 47, 47, 0.14);
}

.item-row button {
  border: 1px solid rgba(192, 110, 50, 0.28);
  background: #fff7ea;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.item-row button:hover {
  background: var(--accent);
  color: #f8f3e9;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(62, 42, 22, 0.16);
}

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

.actions--between {
  justify-content: space-between;
}

.right-actions {
  display: flex;
  gap: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(62, 42, 22, 0.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(180deg, #d98234 0%, #c06e32 54%, #9e5528 100%);
  color: #f8f3e9;
  border-color: rgba(192, 110, 50, 0.55);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #1a1512 0%, #000000 100%);
  border-color: #000000;
  color: #f8f3e9;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(62, 42, 22, 0.18);
}

.btn.ghost {
  background: linear-gradient(180deg, #fffdf8 0%, #f5ecdc 100%);
  border-color: rgba(192, 110, 50, 0.25);
  color: var(--text);
}

.btn:hover {
  box-shadow: 0 8px 20px rgba(62, 42, 22, 0.16);
}

.status {
  min-height: 24px;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #fffdf8 0%, #f8efe2 100%);
  box-shadow: 0 6px 16px rgba(62, 42, 22, 0.06);
}

.status.pending {
  color: var(--muted);
}

.status.success {
  color: #1f6b41;
  background: linear-gradient(180deg, #f4fbf6 0%, #e7f5eb 100%);
  border-color: rgba(46, 125, 79, 0.24);
}

.status.error {
  color: #8f2d2d;
  background: linear-gradient(180deg, #fff7f7 0%, #fdecec 100%);
  border-color: rgba(159, 47, 47, 0.22);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.modal__card {
  position: relative;
  width: min(1120px, 96vw);
  max-height: calc(100dvh - 32px);
  background: linear-gradient(180deg, #ffffff 0%, var(--panel) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.modal__header,
.modal__footer {
  padding: 22px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__header {
  border-bottom: 1px solid var(--panel-border);
}

.modal__header h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal__close {
  border: 1px solid rgba(192, 110, 50, 0.28);
  border-radius: 14px;
  width: 46px;
  height: 46px;
  background: linear-gradient(180deg, #fffdf8 0%, #f5ecdc 100%);
  color: #000000;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.modal__close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #f8f3e9;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(62, 42, 22, 0.16);
}

.modal__content {
  padding: 18px 24px 0;
  display: grid;
  gap: 14px;
}

.modal__lead {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 600;
}

.modal-table {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.modal-table__head,
.modal-table__row {
  display: grid;
  grid-template-columns: 0.85fr 1.2fr 0.9fr 0.8fr;
  gap: 12px;
  padding: 14px 16px;
  align-items: center;
}

.modal-table__head {
  background: linear-gradient(180deg, #f6ead8 0%, #f0e3cf 100%);
  border-bottom: 1px solid var(--panel-border);
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 700;
}

.modal-table__body {
  max-height: 300px;
  overflow: auto;
}

.modal-table__row {
  font-size: clamp(15px, 1.7vw, 22px);
  border-bottom: 1px solid var(--panel-border);
  background: #fffdf8;
}

.modal-table__row:last-child {
  border-bottom: none;
}

.modal-table__empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.confirm-check {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-weight: 500;
  margin: 0;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px 16px;
  font-size: clamp(16px, 2vw, 28px);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f3e9 100%);
}

.confirm-check input {
  margin-top: 0;
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.modal__footer {
  border-top: 1px solid var(--panel-border);
  justify-content: flex-end;
  padding: 16px 24px 22px;
}

@media (max-width: 920px) {
  .modal {
    align-items: flex-start;
    padding: 10px;
  }

  .modal__card {
    width: min(1120px, 100%);
    max-height: calc(100dvh - 20px);
  }

  .table__head,
  .item-row {
    grid-template-columns: 1fr;
  }

  .table__head {
    position: static;
  }

  .item-row button {
    width: fit-content;
  }

  .actions--between {
    flex-direction: column;
    align-items: stretch;
  }

  .right-actions,
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__logo {
    width: 64px;
    height: 64px;
  }

  .btn,
  #add-row {
    width: 100%;
    text-align: center;
  }

  #menu-link {
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
  }

  .form__lead-field {
    max-width: none;
  }

  .modal__header h3 {
    font-size: 32px;
  }

  .modal__lead {
    font-size: 18px;
  }

  .modal-table__head,
  .modal-table__row {
    grid-template-columns: 1fr;
    font-size: 16px;
  }

  .confirm-check {
    font-size: 18px;
    align-items: flex-start;
  }

  .modal__footer {
    flex-direction: column;
    align-items: stretch;
    padding-top: 12px;
  }

  .modal__footer .btn {
    width: 100%;
  }
}
