:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --ink: #16212f;
  --muted: #617084;
  --line: #d8e0ea;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --panel: #ffffff;
  --danger: #b42318;
}

* {
  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;
  background: var(--bg);
  color: var(--ink);
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 16px 40px rgba(22, 33, 47, 0.08);
}

.admin-shell {
  padding-bottom: 18px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.admin-topbar h1 {
  margin-bottom: 0;
}

.brand-heading {
  display: grid;
  gap: 8px;
}

.brand-logo {
  width: 176px;
  height: auto;
  display: block;
}

.payment-heading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  width: 100%;
}

.payment-eyebrow {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.nav-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.nav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-tab {
  margin-top: 20px;
}

.delete-panel {
  margin-top: 20px;
}

.heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.payment-heading {
  max-width: none;
}

.compact-heading {
  margin-bottom: 18px;
}

.records-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
}

.search-field {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.14;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: grid;
  gap: 8px;
  color: #27364a;
  font-weight: 650;
  font-size: 14px;
}

input,
select,
button {
  min-height: 44px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input[type="file"] {
  padding: 10px 12px;
}

button {
  border: 0;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #8f1d14;
}

.upload-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfe;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.mapping {
  margin-top: 24px;
}

.meta {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-weight: 600;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.top-actions {
  margin-top: 0;
  margin-bottom: 16px;
}


.download {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  background: #e7f5f3;
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
}

.status {
  margin-top: 20px;
  min-height: 24px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.hidden {
  display: none;
}

.auth-shell {
  width: min(520px, calc(100% - 32px));
}

.auth-panel {
  margin-top: 8vh;
}

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

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

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

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

th {
  background: #f5f8fb;
  color: #27364a;
}

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

.select-cell {
  width: 42px;
  text-align: center;
}

.select-cell input {
  width: 18px;
  min-height: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 12px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.pagination button {
  min-height: 36px;
  padding: 0 12px;
}

.items-list {
  display: grid;
  gap: 10px;
}

.item-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.item-detail {
  display: grid;
  gap: 4px;
}

.item-detail small {
  color: var(--muted);
  line-height: 1.35;
}

.item-row input {
  width: 20px;
  min-height: 20px;
}

.payment-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  font-size: 20px;
}

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

  .panel {
    padding: 20px;
  }

  .file-row,
  .grid,
  .records-header {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    display: grid;
  }

  .payment-heading-bar {
    align-items: flex-start;
  }

  .pagination {
    justify-content: flex-start;
  }
}
