:root {
  --bg-top: #fff4d6;
  --bg-bottom: #ffd8b1;
  --card: rgba(255, 251, 244, 0.9);
  --card-border: rgba(84, 55, 24, 0.12);
  --text: #2d1b0f;
  --muted: #6d5440;
  --accent: #d6602d;
  --accent-dark: #ac461b;
  --accent-soft: #ffe2d2;
  --shadow: 0 24px 70px rgba(96, 53, 20, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 188, 120, 0.6), transparent 25%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

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

.card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.intro,
.generator-form {
  align-self: start;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.eyebrow,
.subcopy,
.helper-text,
.result-label,
.result-url {
  margin: 0;
}

.eyebrow {
  margin-bottom: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.subcopy {
  max-width: 34ch;
  margin-top: 18px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
}

.generator-form {
  margin-top: 28px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.secondary-label {
  margin-top: 16px;
}

.input-row {
  display: flex;
  gap: 12px;
}

input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(45, 27, 15, 0.14);
  border-radius: 16px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.78);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(214, 96, 45, 0.7);
  box-shadow: 0 0 0 4px rgba(214, 96, 45, 0.12);
  transform: translateY(-1px);
}

button {
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary-btn {
  padding: 16px 22px;
  color: #fffaf5;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  box-shadow: 0 14px 30px rgba(214, 96, 45, 0.24);
}

.secondary-btn {
  padding: 14px 18px;
  color: var(--text);
  background: var(--accent-soft);
}

.ghost-btn {
  padding: 10px 14px;
  color: var(--text);
  background: rgba(45, 27, 15, 0.06);
}

.helper-text {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
}

.helper-text.error {
  color: #a1261b;
}

.result-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 242, 232, 0.92));
}

.qr-frame {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 235, 220, 0.84));
  box-shadow: inset 0 0 0 1px rgba(84, 55, 24, 0.08);
}

#qr-image {
  width: min(100%, 320px);
  height: auto;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(45, 27, 15, 0.12);
}

#qr-canvas {
  display: none;
}

.result-meta {
  width: 100%;
  text-align: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.history-panel {
  grid-column: 1 / -1;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 248, 239, 0.78);
  box-shadow: inset 0 0 0 1px rgba(84, 55, 24, 0.08);
}

.admin-entry-panel,
.admin-card {
  grid-column: 1 / -1;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 248, 239, 0.78);
  box-shadow: inset 0 0 0 1px rgba(84, 55, 24, 0.08);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  background: rgba(45, 27, 15, 0.06);
  transition: transform 180ms ease, background-color 180ms ease;
}

.ghost-link:hover {
  transform: translateY(-2px);
}

.admin-shell {
  padding: 24px;
}

.admin-card {
  width: min(860px, 100%);
}

.admin-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-subcopy {
  margin: 8px 0 0;
  color: var(--muted);
}

.history-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.history-item.empty {
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.history-item-main {
  min-width: 0;
}

.history-item-name,
.history-item-url {
  margin: 0;
}

.history-item-name {
  font-weight: 700;
}

.history-item-url {
  margin-top: 6px;
  color: var(--muted);
  word-break: break-word;
}

.history-item-btn {
  flex-shrink: 0;
  padding: 10px 14px;
}

.result-label {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.result-url {
  margin: 10px 0 18px;
  word-break: break-word;
  color: var(--muted);
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
  background: rgba(45, 27, 15, 0.08);
  font-family: inherit;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
    place-items: stretch;
  }

  .card {
    grid-template-columns: 1fr;
    padding: 22px;
    border-radius: 24px;
  }

  .input-row {
    flex-direction: column;
  }

  .result-panel,
  .history-panel,
  .admin-entry-panel,
  .admin-card {
    padding: 18px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .history-item-btn,
  .ghost-link {
    width: 100%;
  }

  .action-row {
    flex-direction: column;
  }

  .history-item,
  .history-header,
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}
