:root {
  --ink: #172033;
  --muted: #5d6474;
  --line: #d8e3f4;
  --paper: #ffffff;
  --soft: #f4f8ff;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --teal: #0f9f8f;
  --yellow: #ffd166;
  --coral: #ff6b6b;
  --green: #19a974;
  --shadow: 0 14px 34px rgba(23, 32, 51, 0.11);
  --soft-shadow: 0 6px 18px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Tahoma, "Noto Sans Thai", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.12) 0%, rgba(15, 159, 143, 0.08) 46%, rgba(255, 209, 102, 0.2) 100%),
    var(--soft);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(23, 32, 51, 0.06);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.main-nav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 8px;
  font-size: 24px;
  box-shadow: var(--soft-shadow);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--blue-dark);
  background: #eaf1ff;
  border-color: #cfe0ff;
  transform: translateY(-1px);
}

main {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  align-items: stretch;
  gap: 20px;
  padding: 28px 0;
}

.intro-text,
.intro-panel,
.form-card,
.list-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.intro-text {
  padding: 32px;
  border-left: 8px solid var(--yellow);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.intro-text h1 {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 1.25;
}

.intro-text p {
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.intro-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--soft-shadow);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.2);
}

.secondary-link {
  background: var(--teal);
}

.secondary-link:hover,
.secondary-link:focus-visible {
  background: #0c7f73;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 159, 143, 0.18);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.intro-panel {
  padding: 24px;
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #fff9e8 0%, #ffffff 100%);
}

.intro-panel div {
  min-height: 108px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 32, 51, 0.06);
}

.panel-number {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--blue-dark);
}

.panel-label {
  color: var(--muted);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 12px;
}

.form-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 8px solid var(--blue);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.accent-card {
  border-top-color: var(--teal);
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.page-hero {
  margin: 28px 0 20px;
  padding: 32px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow);
}

.found-hero {
  border-left-color: var(--yellow);
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: 36px;
  line-height: 1.25;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.single-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.wide-form {
  width: 100%;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c9d4e8;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="file"] {
  padding: 9px 12px;
  background: #f9fbff;
}

input::placeholder,
textarea::placeholder {
  color: #8c96aa;
}

input:hover,
textarea:hover {
  border-color: #aebfe0;
  background: #fcfdff;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:hover,
button:focus-visible {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.2);
}

.success-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #b8ead3;
  border-radius: 8px;
  color: #0d6f4d;
  background: #e7f8f0;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(25, 169, 116, 0.1);
}

[hidden] {
  display: none !important;
}

.list-section {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

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

.item-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 32, 51, 0.07);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.item-card:hover {
  border-color: #bfd0ec;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.11);
  transform: translateY(-1px);
}

.item-card.lost {
  border-left: 8px solid var(--coral);
}

.item-card.found {
  border-left: 8px solid var(--teal);
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.type-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(23, 32, 51, 0.08);
}

.type-badge {
  color: #ffffff;
  background: var(--coral);
}

.found .type-badge {
  background: var(--teal);
}

.status-badge {
  color: var(--blue-dark);
  background: #eaf1ff;
}

.status-badge.done {
  color: #0d6f4d;
  background: #e7f8f0;
}

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

.item-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.item-details div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}

.item-details dt {
  color: var(--muted);
  font-weight: 700;
}

.item-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.status-row button {
  width: auto;
  min-width: 136px;
  background: var(--green);
}

.status-row button:hover,
.status-row button:focus-visible {
  background: #0f7f58;
  box-shadow: 0 10px 24px rgba(25, 169, 116, 0.18);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  border: 2px dashed #c9d4e8;
  border-radius: 8px;
  background: #fbfdff;
}

@media (max-width: 860px) {
  .header-inner,
  .intro-section,
  .form-grid,
  .items-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .intro-text h1 {
    font-size: 28px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

  .intro-text,
  .intro-panel,
  .form-card,
  .list-section,
  .page-hero {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .brand {
    align-items: flex-start;
  }

  .main-nav {
    width: 100%;
  }

  .main-nav a {
    flex: 1 1 130px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--line);
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .item-top,
  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .status-row button {
    width: 100%;
  }
}
