:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #08213d;
  --muted: #6d7d95;
  --line: #d8e1ec;
  --green: #16a060;
  --blue: #2864e8;
  --red: #b41425;
  --gold: #ffcc22;
  --shadow: 0 18px 48px rgba(8, 33, 61, .14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, rgba(255, 204, 34, .18), transparent 28rem), var(--bg);
}

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

.public-page,
.admin-page {
  min-height: 100vh;
}

.report-shell,
.admin-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.report-panel,
.admin-login,
.admin-dashboard {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.report-panel,
.admin-login {
  max-width: 760px;
  padding: 30px;
}

.brand-row,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  justify-content: flex-start;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  color: #061221;
  font-weight: 900;
  background: linear-gradient(135deg, #dbeafe, var(--gold));
}

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

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.report-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #50617c;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 100, 232, .13);
}

small {
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #1fc976, #2585ff);
  color: #ffffff;
  padding: 14px 18px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(31, 201, 118, .24);
}

button:disabled {
  cursor: wait;
  opacity: .64;
}

.ghost-button {
  color: var(--ink);
  background: #edf3fb;
  box-shadow: none;
}

.turnstile-box {
  min-height: 72px;
}

.result-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #b7ebcb;
  background: #eafff1;
}

.result-box.error,
.error-text {
  color: var(--red);
}

.result-box.error {
  border-color: #f5b6bd;
  background: #fff0f2;
}

.admin-login {
  margin: 6vh auto 0;
  padding: 28px;
}

.admin-dashboard {
  padding: 24px;
}

.admin-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  padding-top: 20px;
}

.report-list-panel,
.report-detail {
  min-height: 560px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.report-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.report-card,
.detail-card,
.response-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.report-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  box-shadow: none;
}

.report-card strong {
  word-break: break-word;
}

.report-card.active {
  border-color: var(--green);
  background: #effff5;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: #e7eefc;
  color: #1d50c6;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.detail-card {
  padding: 18px;
}

.detail-card h2 {
  margin: 0 0 10px;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 10px;
}

.message-box {
  white-space: pre-wrap;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.attachment-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
  background: #ffffff;
  word-break: break-word;
}

.response-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.response-card {
  padding: 12px;
  margin-top: 10px;
  background: #ffffff;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(8, 18, 33, .22);
}

.loading[hidden] {
  display: none;
}

.loading span {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 6px solid rgba(255, 255, 255, .72);
  border-top-color: var(--green);
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.rotate-notice {
  display: none;
}

@media (max-width: 900px) {
  .report-shell,
  .admin-shell {
    width: calc(100vw - 20px);
    padding: 12px 0;
  }

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

  .brand-row,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 18, 33, .92);
    color: #ffffff;
    text-align: center;
  }

  .rotate-notice div {
    display: grid;
    gap: 8px;
  }

  .rotate-notice strong {
    font-size: 28px;
  }
}
