:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-soft: #10161f;
  --text: #f3f6fb;
  --muted: #a7b0c0;
  --line: #2d3644;
  --purple: #b88cff;
  --purple-strong: #9a6cf0;
  --green: #2fbf8f;
  --green-strong: #1f9a74;
  --danger: #ff8a8a;
  --focus: #6ea8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(184, 140, 255, .16), transparent 32rem),
    linear-gradient(180deg, #0b0f15 0%, var(--bg) 55%, #090c11 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #192231 0%, #151b23 52%, #21172c 100%);
  border: 1px solid var(--line);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 6px;
  color: var(--purple);
  font-size: 18px;
}

h3 {
  margin-bottom: 0;
  color: var(--purple);
  font-size: 16px;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.intro-actions,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.span-2 {
  grid-column: 1 / -1;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

.panel-title p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.fields {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fields.three {
  grid-template-columns: .5fr 1.2fr .8fr;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.segmented label {
  margin: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.segmented input:checked + span {
  border-color: var(--purple);
  background: var(--purple);
  color: #121620;
}

.count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.count-pill {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0f151e;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.add-store-button {
  min-height: 46px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #dce4f2;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="date"],
textarea,
.fixed-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f151e;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  font-weight: 400;
}

.fixed-field {
  display: block;
  background: #111926;
  color: var(--purple);
  font-weight: 700;
}

input::placeholder,
textarea::placeholder {
  color: #718096;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

textarea.long-text {
  min-height: 320px;
  overflow: hidden;
  resize: none;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, .14);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.primary {
  background: var(--purple);
  color: #121620;
}

.primary:hover {
  background: var(--purple-strong);
}

.secondary {
  border: 1px solid var(--line);
  background: #10161f;
  color: var(--purple);
}

.secondary:hover {
  border-color: var(--purple);
}

.ghost {
  padding: 8px 10px;
  background: transparent;
  color: var(--danger);
}

.plus-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--purple);
  border-radius: 50%;
  background: #10161f;
  color: var(--purple);
  font-size: 24px;
  line-height: 1;
}

.plus-button:hover {
  background: #1d2735;
}

.line-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.line-item label {
  margin-bottom: 0;
}

.store-forms {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.store-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.store-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.store-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fixed-pill {
  display: inline-block;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  background: #21172c;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
}

.participant-head {
  align-items: center;
  margin: 18px 0 12px;
}

.participant-head h2 {
  margin-bottom: 4px;
}

.participants-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.participant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.participant-row label {
  margin-bottom: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111926;
}

.switch-row p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.switch {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  color: var(--purple);
  font-size: 16px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slider {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #485466;
  transition: background .2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef4ff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .2s ease;
}

.switch input:checked + .slider {
  background: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(26px);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

.check-row input {
  margin-top: 2px;
}

.file-drop {
  display: grid;
  min-height: 100px;
  place-items: center;
  border: 1px dashed #536176;
  border-radius: 8px;
  background: #0f151e;
  color: var(--purple);
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.preview {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  color: #d8dfeb;
  line-height: 1.5;
}

.preview strong {
  color: var(--purple);
}

.preview-store {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.preview-label {
  display: inline-block;
  margin-top: 8px;
  color: var(--purple);
  font-weight: 800;
}

.visit-preview {
  max-height: 280px;
  margin-top: 6px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f151e;
}

.status-line {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(47, 191, 143, .12);
  color: var(--green);
  font-weight: 700;
}

.status-line.error {
  background: rgba(255, 138, 138, .12);
  color: var(--danger);
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .intro,
  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .fields.two,
  .fields.three,
  .segmented,
  .count-row,
  .participant-row {
    grid-template-columns: 1fr;
  }

  .line-item,
  .switch-row,
  .store-form-title {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .store-title-actions {
    justify-content: flex-start;
  }
}
