*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1rem;
  background: #f9f9f9;
  color: #1a1a1a;
}

main {
  max-width: 720px;
  margin: 0 auto;
}

h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }

/* ── Form ── */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}
.field label { font-weight: 600; margin-bottom: 0.25rem; }
.field input[type="text"],
.field input[type="file"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.field small { color: #666; font-size: 0.8rem; margin-top: 0.2rem; }
.req { color: #c00; }

/* ── Acknowledgment Section ── */
.acknowledgment-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.acknowledgment-section p { margin: 0 0 0.5rem 0; }
.acknowledgment-section ul { margin: 0.5rem 0 1rem 1.5rem; padding: 0; }
.acknowledgment-section li { margin-bottom: 0.5rem; }
.acknowledgment-section .field { margin-top: 1rem; margin-bottom: 0; }
.acknowledgment-section label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 600;
}
.acknowledgment-section input[type="checkbox"] {
  margin-right: 0.5rem;
  margin-top: 0.2rem;
  cursor: pointer;
  width: 1rem;
  height: 1rem;
}

/* ── Console radio fieldsets ── */
fieldset.field {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
}
fieldset.field legend { font-weight: 600; padding: 0 0.3rem; }
fieldset.field label {
  display: inline-flex;
  align-items: center;
  font-weight: normal;
  margin-right: 1.2rem;
  cursor: pointer;
}
fieldset.field input[type="radio"] { margin-right: 0.4rem; }

button {
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #0060df;
  color: #fff;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { background: #003eaa; }

.button-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.button-row #edit-btn { background: #666; }
.button-row #edit-btn:hover:not(:disabled) { background: #444; }

/* ── Messages ── */
.message {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.message.error   { background: #ffe4e4; border: 1px solid #f99; color: #900; }
.message.success { background: #e4ffe4; border: 1px solid #9f9; color: #060; }
.error { color: #900; }
.success { color: #060; }

/* ── Disclaimer box ── */
.disclaimer-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #856404;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #ddd;
}
th { background: #f0f0f0; font-weight: 600; }
tr:nth-child(even) td { background: #fafafa; }

/* ── Donate button ── */
.donate-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border-radius: 4px;
  background: #0060df;
  color: #fff;
  text-decoration: none;
}
.donate-btn:hover { background: #003eaa; }

/* ── Mapping page ── */
.drop-zone {
  min-height: 2rem;
  padding: 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.drop-zone.drag-over { background: #d0e8ff; }
.no-match { color: #aaa; font-style: italic; }

.pending-section { margin-top: 1.5rem; }
.pending-bucket {
  min-height: 3rem;
  padding: 0.5rem;
  border: 2px dashed #ccc;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  transition: background 0.15s;
}
.pending-bucket.drag-over { background: #fffbe0; border-color: #f0b400; }

/* ── Chips ── */
.chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #0060df;
  color: #fff;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
}
.chip.dragging { opacity: 0.5; }

/* ── Profile card ── */
.profile-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.profile-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; }
.profile-card dt { font-weight: 600; color: #555; }

/* ── Admin ── */
.admin-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.admin-actions a {
  color: #0060df;
  font-weight: 600;
  text-decoration: none;
}
.admin-actions a:hover { text-decoration: underline; }

tr.flagged td { background: #fff0f0 !important; }
.detail-row td { background: #f5f5f5 !important; padding: 1rem !important; }

.detail-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 2rem; margin-bottom: 1rem; max-width: 600px; }
.detail-info-row { display: contents; }
.detail-label { font-weight: 600; color: #555; font-size: 0.85rem; }
.detail-value { font-size: 0.9rem; }

.detail-splits-heading { margin: 0.75rem 0 0.4rem; font-size: 0.95rem; }
.splits-detail { width: 100%; font-size: 0.9rem; }
.splits-detail th, .splits-detail td { padding: 0.3rem 0.5rem; }
.split-missing td { color: #999; font-style: italic; }

button.btn-flag   { background: #c00; }
button.btn-unflag { background: #060; }

th[data-col] { cursor: pointer; user-select: none; }
th[data-col]:hover { background: #e4e4e4; }
th.sort-asc::after  { content: ' ▲'; font-size: 0.75em; color: #555; }
th.sort-desc::after { content: ' ▼'; font-size: 0.75em; color: #555; }

.reason-input {
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  width: 180px;
}

hr { margin: 2rem 0; border: none; border-top: 1px solid #ddd; }
