:root {
  color-scheme: light;
  --bg-1: #f3eee6;
  --bg-2: #eef4fb;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.58);
  --text: #132033;
  --muted: #5e6977;
  --line: rgba(19, 32, 51, 0.12);
  --shadow: 0 24px 80px rgba(11, 22, 36, 0.12);
  --shadow-soft: 0 14px 40px rgba(11, 22, 36, 0.08);
  --primary: #0f766e;
  --primary-strong: #0b5f58;
  --secondary: #1d4ed8;
  --warning: #b45309;
  --success: #166534;
  --radius: 26px;
  --radius-sm: 18px;
  --radius-xs: 14px;
  --gap: 20px;
  --font-body: "Segoe UI", "Trebuchet MS", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.16), transparent 30%),
    radial-gradient(circle at 86% 6%, rgba(29, 78, 216, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(19, 32, 51, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 32, 51, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 78%);
  opacity: 0.75;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  position: relative;
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 8px);
  padding: 34px 36px 32px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.22), rgba(15, 118, 110, 0) 68%);
  filter: blur(6px);
  pointer-events: none;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}

.hero h1,
.panel h2,
.section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #10203a;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 4vw, 4.4rem);
  line-height: 0.95;
}

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

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-pills span,
.status-chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #274057;
}

.hero-panel {
  border-radius: calc(var(--radius) + 8px);
  padding: 24px;
}

.panel {
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 1.5rem;
  line-height: 1.05;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding-top: 4px;
}

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

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

.metric-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  box-shadow: var(--shadow-soft);
  padding: 16px;
  min-height: 122px;
}

.metric-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.status-banner {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(29, 78, 216, 0.08));
  padding: 14px 16px;
  color: #20404d;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.form-panel,
.result-panel,
.list-panel {
  padding: 24px;
}

.form-panel {
  position: relative;
}

.form-message {
  display: none;
  margin-bottom: 18px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid transparent;
}

.form-message.is-visible {
  display: block;
}

.form-message.success {
  background: rgba(220, 252, 231, 0.72);
  border-color: rgba(22, 101, 52, 0.18);
  color: var(--success);
}

.form-message.error {
  background: rgba(254, 226, 226, 0.82);
  border-color: rgba(185, 28, 28, 0.18);
  color: #991b1b;
}

.ghost-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    opacity 0.16s ease;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
  color: #284158;
  border: 1px solid var(--line);
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  padding: 14px 22px;
  box-shadow: 0 18px 32px rgba(15, 118, 110, 0.22);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.84);
  color: #284158;
  border: 1px solid var(--line);
  padding: 14px 22px;
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.ghost-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.section {
  border-radius: 22px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.68);
  padding: 18px;
}

.section + .section {
  margin-top: 16px;
}

.section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(19, 32, 51, 0.08);
}

.section > summary::-webkit-details-marker {
  display: none;
}

.summary-note {
  font-size: 0.86rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: #21354c;
  font-weight: 600;
}

.form-grid label span {
  font-size: 0.86rem;
  color: #31455a;
}

.form-grid input,
.form-grid textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(19, 32, 51, 0.12);
  background: rgba(248, 250, 252, 0.92);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.form-grid textarea {
  resize: vertical;
  min-height: 110px;
}

.form-grid input:focus,
.form-grid textarea:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.side-stack {
  display: grid;
  gap: 24px;
}

.result-content {
  display: grid;
  gap: 18px;
}

.empty-state {
  border-radius: 22px;
  border: 1px dashed rgba(19, 32, 51, 0.18);
  background: rgba(255, 255, 255, 0.62);
  padding: 20px;
  color: var(--muted);
}

.empty-state strong,
.empty-state p {
  display: block;
}

.empty-state strong {
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state.compact {
  padding: 16px;
}

.result-card {
  padding-bottom: 20px;
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.status-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.is-success {
  background: rgba(220, 252, 231, 0.9);
  color: var(--success);
}

.status-pill.is-warning {
  background: rgba(254, 243, 199, 0.92);
  color: var(--warning);
}

.status-pill.is-muted {
  background: rgba(241, 245, 249, 0.92);
  color: #526072;
}

.source-pill {
  background: rgba(224, 242, 254, 0.9);
  color: #1d4ed8;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-tile {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72));
  padding: 14px 16px;
}

.result-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.result-value {
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.result-value.mono {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions a,
.result-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #274057;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 14px;
}

.result-actions a.primary-link,
.result-actions button.primary-link {
  background: linear-gradient(135deg, var(--secondary), #133f9e);
  border-color: transparent;
  color: white;
}

.qr-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.qr-frame {
  border-radius: 20px;
  border: 1px solid rgba(19, 32, 51, 0.12);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(235, 242, 248, 0.88));
  padding: 12px;
}

.qr-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 14px;
}

.qr-meta {
  display: grid;
  gap: 10px;
}

.qr-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.copy-box {
  display: grid;
  gap: 10px;
}

.copy-code {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  line-height: 1.45;
  color: #203245;
  word-break: break-all;
  border-radius: 18px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(248, 250, 252, 0.92);
  padding: 14px;
  max-height: 172px;
  overflow: auto;
}

.table-shell {
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.history-table thead th {
  position: sticky;
  top: 0;
  background: rgba(246, 249, 252, 0.96);
  color: #415467;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(19, 32, 51, 0.08);
}

.history-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(19, 32, 51, 0.06);
  vertical-align: top;
}

.history-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.04);
}

.history-date {
  display: grid;
  gap: 4px;
}

.history-date strong {
  font-size: 0.96rem;
}

.history-date span,
.history-meta {
  color: var(--muted);
  font-size: 0.83rem;
}

.status-stack {
  display: grid;
  gap: 6px;
}

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

.row-actions a {
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.row-actions a.primary-link {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-strong);
}

.empty-row {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.customers-list {
  display: grid;
  gap: 12px;
}

.customer-card {
  border-radius: 20px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.76);
  padding: 16px;
  display: grid;
  gap: 10px;
}

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

.customer-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.customer-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.customer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-stats span {
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(19, 32, 51, 0.08);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #294158;
}

.customer-meta {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.customer-meta strong {
  color: var(--text);
}

@media (max-width: 1180px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 14ch;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 1320px);
    padding-top: 16px;
  }

  .hero-copy,
  .panel {
    border-radius: 24px;
  }

  .hero-copy,
  .form-panel,
  .result-panel,
  .list-panel,
  .hero-panel {
    padding: 18px;
  }

  .metrics,
  .form-grid,
  .result-summary {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .qr-box {
    grid-template-columns: 1fr;
  }

  .result-actions,
  .form-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .result-actions a,
  .result-actions button {
    width: 100%;
    justify-content: center;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3.4rem);
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 16px, 1320px);
  }

  .hero-copy {
    padding: 16px;
  }

  .hero-pills span,
  .status-chip,
  .badge {
    width: 100%;
    justify-content: center;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}
