:root {
  --ink: #17211d;
  --muted: #65716b;
  --line: #d8ded9;
  --surface: #ffffff;
  --soft: #f4f7f5;
  --saffron: #d97706;
  --green: #1f7a4d;
  --teal: #0f766e;
  --red: #b42318;
  --amber: #a15c07;
  --blue: #315f96;
  --shadow: 0 14px 34px rgba(23, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--teal);
  text-decoration: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(216, 222, 217, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.topbar nav a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf8;
  padding: 3px;
}

.language-toggle a {
  min-height: 32px;
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 850;
}

.language-toggle a.active {
  background: var(--ink);
  color: #ffffff;
}

main {
  padding: 48px 28px;
}

.shell,
.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.public-shell {
  display: grid;
  gap: 24px;
}

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

.intro {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--saffron);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: 46px;
}

h2 {
  font-size: 24px;
}

.intro p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.lookup-form,
.result-panel,
.edit-form,
.upload-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

button,
.primary,
.danger {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  background: var(--teal);
  color: white;
}

.danger {
  background: var(--red);
  color: white;
}

.results {
  display: grid;
  gap: 18px;
}

.result-panel {
  padding: 22px;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.message-block {
  margin: 18px 0 0;
  max-width: 840px;
  white-space: pre-line;
  color: #2f3b36;
}

.contact-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 14px 0 0;
  color: #2f3b36;
  line-height: 1.55;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #0f8f55;
  border-radius: 8px;
  background: #f1fff7;
  color: #087643;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.whatsapp-link:hover,
.whatsapp-link:focus-visible {
  background: #dffbea;
  outline: none;
}

.paid-panel {
  border-left: 6px solid var(--green);
}

.pending-panel {
  border-left: 6px solid var(--amber);
}

.verify-panel {
  border-left: 6px solid var(--blue);
}

.payment-area {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.qr-box {
  display: grid;
  width: 220px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #aeb8b0;
  border-radius: 8px;
  background: var(--soft);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-card {
  display: grid;
  gap: 14px;
}

.payment-qr-box {
  width: 100%;
  aspect-ratio: 1378 / 1068;
  border-style: solid;
  background: #ffffff;
}

.payment-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.payment-details h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.payment-details dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.payment-details div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.payment-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.payment-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.upload-form {
  display: grid;
  gap: 12px;
}

.file-field {
  position: relative;
}

.file-field input[type="file"] {
  position: absolute;
  inset: 25px 0 0;
  width: 100%;
  height: calc(100% - 25px);
  cursor: pointer;
  opacity: 0;
}

.file-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.file-button {
  display: grid;
  min-height: 46px;
  place-items: center;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 850;
}

.file-name {
  overflow: hidden;
  color: var(--muted);
  padding: 10px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.alert.error {
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: #fff1f0;
  color: var(--red);
}

.admin-head {
  display: grid;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 28px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.tabs a.active {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar button {
  background: var(--ink);
  color: white;
}

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

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf8;
  color: #46514b;
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.status-paid {
  background: #e8f7ef;
  color: var(--green);
}

.status-pending {
  background: #fff6df;
  color: var(--amber);
}

.status-submitted {
  background: #eaf2fb;
  color: var(--blue);
}

.status-rejected {
  background: #fff1f0;
  color: var(--red);
}

.small-link {
  font-weight: 800;
}

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

.wide,
.form-actions,
.edit-form .alert {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-list {
  display: grid;
  gap: 16px;
}

.upload-item {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
}

.upload-preview {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.details-grid div {
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
}

.review-actions {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  gap: 12px;
  align-items: center;
}

.review-actions form {
  display: flex;
  gap: 10px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 820px) {
  .topbar {
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
  }

  main {
    padding: 24px 12px 36px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .brand small {
    font-size: 10px;
  }

  .topbar nav {
    flex-wrap: nowrap;
    gap: 7px;
  }

  .topbar nav > a {
    font-size: 12px;
  }

  .language-toggle {
    padding: 2px;
  }

  .language-toggle a {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .public-shell {
    gap: 18px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.16;
  }

  h2 {
    font-size: 21px;
  }

  .intro p:not(.eyebrow) {
    font-size: 15px;
  }

  .lookup-form,
  .result-panel {
    padding: 16px;
  }

  .lookup-form,
  .toolbar,
  .payment-area,
  .edit-form,
  .upload-item,
  .review-actions {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-heading,
  .review-actions form {
    flex-direction: column;
    gap: 10px;
  }

  .qr-box {
    width: min(190px, 100%);
    justify-self: center;
  }

  .payment-card {
    justify-items: stretch;
  }

  .payment-qr-box {
    width: min(320px, 100%);
    justify-self: center;
  }

  .payment-details {
    width: 100%;
  }

  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  input,
  select,
  textarea,
  button,
  .primary,
  .danger {
    min-height: 48px;
  }

  .lookup-form .primary,
  .upload-form .primary {
    width: 100%;
  }

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

  .file-button {
    min-height: 44px;
  }

  .file-name {
    min-height: 44px;
    text-align: center;
  }

  .contact-note {
    align-items: stretch;
  }

  .whatsapp-link {
    justify-content: center;
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brand strong {
    max-width: 36vw;
  }

  .language-toggle a {
    padding-inline: 7px;
  }

  h1 {
    font-size: 26px;
  }
}
