:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #f9faf7;
  --ink: #161719;
  --muted: #687076;
  --line: #dfe4df;
  --line-strong: #c8d0c8;
  --brand: #e93535;
  --brand-dark: #bd2028;
  --navy: #1d2733;
  --teal: #128978;
  --teal-soft: #e2f4ef;
  --gold: #b98018;
  --gold-soft: #fff3d8;
  --shadow: 0 18px 45px rgba(29, 39, 51, 0.12);
  --shadow-soft: 0 8px 24px rgba(29, 39, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 340px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.brand {
  margin: 0;
  color: var(--navy);
  text-align: center;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 850;
}

.subtitle {
  margin: 6px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.35;
  font-weight: 650;
}

.portal-card {
  width: min(520px, 100%);
  margin: 34px auto 26px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portal-title,
.portal-note {
  margin: 0;
  text-align: left;
}

.portal-title {
  padding: 26px 28px 8px;
  color: var(--navy);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.06;
  font-weight: 860;
}

.portal-note {
  padding: 0 28px 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 650;
}

.field-stack {
  display: grid;
  gap: 14px;
  padding: 24px 28px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.field {
  display: grid;
  gap: 8px;
}

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

.label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.control,
.amount-control {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control:focus,
.amount-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(18, 137, 120, 0.12);
}

.amount-control {
  padding-left: 44px;
}

.phone-row,
.amount-wrap {
  position: relative;
}

.phone-row::before {
  content: "US";
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.phone-row .control {
  padding-left: 54px;
}

.primary-btn,
.danger-btn,
.blue-btn,
.small-btn,
.ghost-btn {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn,
.danger-btn {
  width: 100%;
  color: white;
  background: var(--brand);
  box-shadow: 0 12px 22px rgba(233, 53, 53, 0.24);
}

.primary-btn:hover,
.danger-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.blue-btn {
  min-width: 210px;
  padding: 0 24px;
  color: white;
  background: var(--teal);
  box-shadow: 0 12px 22px rgba(18, 137, 120, 0.2);
}

.blue-btn:hover {
  background: #0f7366;
  transform: translateY(-1px);
}

.ghost-btn {
  min-width: 180px;
  padding: 0 22px;
  color: var(--navy);
  background: #edf0ed;
}

.small-btn {
  min-height: 38px;
  padding: 0 22px;
  color: var(--brand-dark);
  background: #ffe7e7;
  border: 1px solid #ffc8c8;
}

.entry-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 26px;
}

.activity-launch {
  width: min(520px, 100%);
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--navy);
  text-align: left;
  padding: 0 22px;
}

.activity-launch strong {
  display: block;
  font-size: 1.08rem;
}

.activity-launch span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.secondary-link {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.verify-name {
  margin: 34px 0 18px;
  color: var(--navy);
  text-align: center;
  font-size: clamp(2.15rem, 5vw, 3.9rem);
  font-weight: 720;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1050px, 100%);
  margin: 18px auto;
}

.info-row {
  display: contents;
}

.pill {
  min-height: 118px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.pill strong {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill span {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.2;
  font-weight: 780;
}

.decision-panel {
  width: min(1050px, 100%);
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.45fr);
  gap: 14px;
}

.action-box {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.check-list strong {
  grid-column: 1 / -1;
  color: var(--navy);
  font-size: 0.92rem;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 720;
}

.check-list input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.mode-grid input {
  position: absolute;
  opacity: 0;
}

.mode-grid span {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  text-align: center;
  font-weight: 850;
}

.mode-grid input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #0c5f55;
  box-shadow: inset 0 0 0 1px var(--teal);
}

.amount-wrap::before {
  content: "$";
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 850;
}

.points-wrap::before {
  content: "";
}

.full-btn {
  width: 100%;
}

.side-actions {
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 24px;
  font-size: 1.15rem;
  font-weight: 850;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 760;
}

.result {
  text-align: center;
}

.result-name {
  margin: 42px 0 18px;
  color: var(--navy);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 760;
}

.contact-lines {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.contact-lines div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.score {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
  color: var(--navy);
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
}

.score div {
  min-height: 128px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold-soft);
  border: 1px solid #f4d99f;
}

.score div:last-child {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.rule {
  width: min(760px, 100%);
  margin: 22px auto 18px;
  border-top: 1px solid var(--line-strong);
}

.reminder {
  width: min(760px, 100%);
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-style: normal;
  font-weight: 650;
}

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 23, 25, 0.56);
  backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  padding: 28px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 52px 24px 0;
  color: var(--navy);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.15;
}

.modal-copy {
  margin: -14px 0 18px;
  color: var(--muted);
  font-weight: 650;
}

.staff-modal {
  width: min(620px, 100%);
}

.staff-manager-form {
  display: grid;
  gap: 16px;
}

.text-area {
  min-height: 170px;
  padding-top: 14px;
  resize: vertical;
  line-height: 1.35;
}

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

.text-btn {
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.close-btn {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  background: #fff;
}

.report-table th {
  background: var(--navy);
  color: white;
  padding: 13px 10px;
  text-align: left;
  white-space: nowrap;
}

.report-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf0ed;
  color: #30353a;
  text-align: left;
}

.report-table tbody tr:nth-child(even) {
  background: #fafbf9;
}

.empty-row {
  color: var(--muted);
  font-style: italic;
}

.notice {
  width: min(520px, 100%);
  margin: 14px auto 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff1f1;
  border: 1px solid #ffc8c8;
  color: #98202a;
  font-weight: 750;
}

.modal .notice {
  width: 100%;
  margin: 0 0 16px;
  background: var(--teal-soft);
  border-color: #b9e4dc;
  color: #006b60;
}

.notice.is-error {
  background: #fff1f1;
  border-color: #ffc8c8;
  color: #98202a;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .info-strip,
  .decision-panel,
  .contact-lines,
  .score,
  .filters {
    grid-template-columns: 1fr;
  }

  .decision-panel {
    padding: 10px;
  }

  .check-list {
    grid-template-columns: 1fr;
  }

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

  .side-actions {
    min-height: 210px;
  }

  .report-table {
    min-width: 860px;
  }
}
