:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --primary: #0d3b86;
  --secondary: #1b6ed7;
  --text: #1e293b;
  --muted: #6b7280;
  --border: #d1d5db;
  --success: #16a34a;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #edf2ff 0%, #f8fafc 100%);
  color: var(--text);
}

.page-header {
  padding: 32px 24px 48px;
  background: linear-gradient(135deg, #0f4fb8 0%, #1d4ed8 45%, #2563eb 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 100vh;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.22), transparent 35%);
  pointer-events: none;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-shadow: 0 8px 24px rgba(2, 6, 23, 0.24);
}

.subtitle {
  margin: 0 0 6px;
  font-size: 1rem;
  opacity: 0.95;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.search-wrap {
  min-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto;
  width: min(900px, 100%);
}

.search-wrap label {
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
}

.search-input {
  width: 100%;
  padding: 24px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1.45rem;
  font-weight: 800;
  min-height: 84px;
  background: rgba(255, 255, 255, 0.97);
  outline: none;
  color: #0f172a;
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.16);
}

.search-input::placeholder {
  color: #64748b;
  font-weight: 600;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4), 0 14px 36px rgba(2, 6, 23, 0.16);
}

.search-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.search-wrap button,
.secondary-button {
  padding: 16px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
  font-size: 1rem;
  min-height: 56px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28);
}

/* Claim form styles */
.claim-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.claim-button {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: white;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(59,130,246,0.18);
  border: none;
  cursor: pointer;
}

.claim-form {
  width: 100%;
  max-width: 720px;
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(2,6,23,0.06);
}

.claim-form h3 {
  margin: 0 0 8px 0;
}

.grant-selection {
  margin-top: 14px;
  border: 4px solid #d4af37;
  border-radius: 26px;
  background: linear-gradient(180deg, #f5f7fb 0%, #eef3ff 100%);
  padding: 18px 18px 12px;
  box-shadow: inset 0 0 0 2px rgba(13, 59, 134, 0.12), 0 12px 28px rgba(13, 59, 134, 0.12);
}

.grant-selection h4 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  letter-spacing: 0.04em;
  color: var(--primary);
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
}

.grant-amount-list {
  display: grid;
  gap: 0;
  border: 2px solid rgba(13, 59, 134, 0.7);
  border-radius: 12px;
  overflow: hidden;
}

.grant-option {
  display: grid;
  grid-template-columns: 46px minmax(120px, 1.2fr) 52px minmax(120px, 1.1fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(13, 59, 134, 0.35);
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.15s ease;
}

.grant-option:last-child {
  border-bottom: none;
}

.grant-option:hover {
  background: rgba(219, 234, 254, 0.75);
}

.grant-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin: 0 auto;
}

.grant-clearance {
  color: #d62828;
  font-weight: 900;
  font-size: 1.1rem;
  text-align: left;
}

.grant-arrow {
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  line-height: 1;
}

.grant-amount {
  color: #0b8a38;
  font-weight: 900;
  font-size: 1.1rem;
  text-align: left;
}

.claim-form .form-row input,
.claim-form .form-row textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.search-status {
  margin: 0;
  font-size: 1.08rem;
  color: #f8fafc;
  opacity: 0.99;
  text-align: center;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

main {
  max-width: 1000px;
  margin: -36px auto 40px;
  padding: 0 18px 32px;
}

.results-view {
  display: grid;
  gap: 20px;
}

.results-card,
.table-section,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  width: min(100%, 760px);
}

.results-card {
  display: grid;
  gap: 16px;
}

.results-card h2 {
  margin: 0 0 4px;
}

.admin-access {
  margin-top: 4px;
}

.admin-card h2,
.admin-card h3 {
  margin-top: 0;
}

.error-message {
  margin: 0;
  color: #b91c1c;
  font-size: 0.95rem;
}

.table-section {
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

tbody tr:hover {
  background: #f8fafc;
}

tr.highlight-row {
  background: #fef3c7;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.status-delivered { background: #d1fae5; color: #166534; }
.status-notyet { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1d4ed8; }

#winnerForm {
  display: grid;
  gap: 16px;
  width: 100%;
}

.form-row {
  display: grid;
  gap: 8px;
  width: 100%;
}

label {
  font-weight: 600;
}

input,
select,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

input,
select {
  padding: 14px 16px;
  background: white;
  min-height: 50px;
}

button {
  padding: 14px 18px;
  background: var(--secondary);
  border: none;
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(30, 58, 138, 0.17);
}

.note {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 720px) {
  .page-header {
    text-align: center;
    justify-content: center;
  }
  .search-wrap {
    width: 100%;
    min-width: unset;
  }
  .search-row {
    flex-direction: column;
  }
}
