:root {
  color-scheme: light;
  --ink: #10295f;
  --muted: #5d70a5;
  --line: #ccd7f3;
  --surface: #ffffff;
  --page: #f5f7ff;
  --accent: #2f45a8;
  --accent-strong: #17327f;
  --accent-soft: #edf2ff;
  --club-red: #e33a35;
  --club-red-strong: #bd2324;
  --danger: #bd2324;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(16, 41, 95, 0.12);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  display: block;
  height: 6px;
  margin: -28px -28px 22px;
  background: linear-gradient(90deg, var(--club-red), var(--accent));
}

.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.heading {
  margin-bottom: 28px;
}

.heading p {
  margin: 0 0 6px;
  color: var(--club-red);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 20px;
}

form {
  display: grid;
  gap: 20px;
}

fieldset {
  display: grid;
  gap: 20px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset:disabled {
  opacity: 0.58;
}

.verification-step {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

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

.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

dialog {
  width: min(720px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 41, 95, 0.24);
}

dialog::backdrop {
  background: rgba(16, 41, 95, 0.36);
}

input:focus,
select:focus {
  outline: 3px solid rgba(47, 69, 168, 0.18);
  border-color: var(--accent);
}

.section-title,
.dialog-heading,
.dialog-actions,
.category-heading,
.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#receipts {
  display: grid;
  gap: 18px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--accent-soft);
}

.category-table {
  display: grid;
  gap: 10px;
}

.category-heading h3 {
  margin: 0;
  font-size: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  background: var(--accent-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  width: 220px;
  white-space: nowrap;
}

.table-actions button + button {
  margin-left: 8px;
}

#receipt-form {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.dialog-heading {
  align-items: flex-start;
}

#cancel-receipt {
  width: 40px;
  padding: 0;
}

.dialog-actions {
  padding-top: 4px;
}

.dialog-actions > div {
  display: flex;
  gap: 10px;
}

.file-note {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

button,
.button-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  min-height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: white;
}

.remove {
  color: var(--danger);
}

.remove:hover {
  border-color: var(--club-red);
  color: var(--club-red-strong);
}

.remove[hidden] {
  display: none;
}

.summary {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 18px;
}

.confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.confirmation-check input {
  flex: 0 0 auto;
  margin-top: 1px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#status,
#email-status,
#otp-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

pre {
  margin-top: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--accent-soft);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 960px);
    padding: 20px 0;
  }

  .panel {
    padding: 20px;
  }

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

  .section-title,
  .dialog-actions,
  .category-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions > div {
    display: grid;
  }

  .table-actions {
    width: auto;
  }

  h1 {
    font-size: 26px;
  }
}
