:root {
  --ink: #17212b;
  --muted: #617083;
  --line: #d9e1ea;
  --brand: #1f7a6d;
  --brand-dark: #15574e;
  --soft: #eef7f4;
  --warn: #ad5d10;
  --danger: #b3261e;
  --bg: #f6f8fb;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.page-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
h1, h2, h3 { margin: 0 0 12px; }
p { line-height: 1.65; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(18, 29, 43, .04);
}
.stat { font-size: 34px; font-weight: 700; color: var(--brand-dark); }
.muted { color: var(--muted); }

label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--brand-dark); }
.btn.warning { background: var(--warn); border-color: var(--warn); }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.alert.success { border-color: #79b79f; background: #eef9f3; }
.alert.error { border-color: #df9b96; background: #fff2f1; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f0f4f8; white-space: nowrap; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-weight: 700; font-size: 12px; }

.score-row { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fff; }
.score-options { display: grid; grid-template-columns: repeat(5, minmax(78px, 1fr)); gap: 8px; }
.score-options label {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-weight: 400;
  background: #fbfcfd;
}
.score-options input { width: auto; }
.evidence { width: 86px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #e9f5f0, #f6f8fb 55%, #edf2f7);
}
.login .card { width: min(430px, 100%); }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px 14px; }
  .container { padding: 16px; }
  .score-options { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .card, .table-wrap { box-shadow: none; border-color: #aaa; }
}
