:root {
  font-family: Tahoma, "Noto Sans Thai", sans-serif;
  color: #21364b;
  background: #f3f6fb;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
aside {
  width: 245px;
  background: #112a46;
  color: white;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 28px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}
.brand > b {
  background: #27496d;
  border-radius: 12px;
  padding: 12px;
  font-size: 20px;
}
.brand small {
  display: block;
  font-size: 11px;
  color: #b9cadc;
  margin-top: 5px;
}
nav {
  display: grid;
  gap: 8px;
}
nav button {
  border: 0;
  text-align: left;
  background: transparent;
  color: #c9d5e3;
  min-height: 44px;
}
nav button.active {
  background: #23466f;
  color: white;
}
main {
  margin-left: 245px;
  padding: 32px 28px;
  max-width: 1750px;
}
h1 {
  font-size: 26px;
  margin: 0 0 7px;
}
h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
h3 {
  font-size: 18px;
  margin: 0;
}
p {
  line-height: 1.65;
  margin: 8px 0;
  color: #607386;
}
button,
.button {
  font-family: inherit;
  border: 0;
  border-radius: 8px;
  background: #2674c3;
  color: white;
  padding: 11px 17px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.secondary {
  background: #e9eff6;
  color: #355270;
}
.danger {
  background: #fff0ee;
  color: #ab3127;
}
input,
select {
  font: inherit;
  padding: 11px;
  border: 1px solid #d6e0eb;
  border-radius: 8px;
  background: white;
  width: 100%;
  color: #21364b;
}
input:focus,
select:focus {
  outline: 2px solid #75a6dd;
}
label {
  display: grid;
  gap: 7px;
}
small {
  font-size: 11px;
}
.header,
.toolbar,
.panel-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card,
.month-picker,
.hero,
.metrics article,
.toolbar {
  background: white;
  border: 1px solid #e0e7ef;
  border-radius: 13px;
}
.month-picker {
  margin: 25px 0;
  padding: 22px;
}
.month-picker .intro {
  display: flex;
  justify-content: space-between;
}
.eyebrow {
  color: #2270bc;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.month-cards {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}
.month-card {
  flex: 1;
  background: #f4f8fd;
  border: 1px solid #dce7f4;
  color: #315679;
  text-align: left;
  padding: 18px;
  display: grid;
  gap: 8px;
}
.month-card.active {
  border: 2px solid #2779c9;
  background: #edf5ff;
}
.month-card strong {
  font-size: 17px;
}
.month-card small {
  color: #6a7c90;
}
.hero {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.period-controls {
  display: flex;
  gap: 8px;
  min-width: 330px;
}
.period-controls input {
  width: 100px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.metrics article {
  padding: 18px;
  color: #718196;
}
.metrics strong {
  display: block;
  font-size: 30px;
  color: #254c76;
  margin: 8px 0;
}
.formula {
  background: #edf5fe;
  color: #355779;
  padding: 14px 18px;
  border: 1px solid #dbe9f9;
  border-radius: 10px;
  line-height: 1.7;
  margin: 18px 0;
}
.toolbar {
  padding: 12px;
  margin: 18px 0;
}
.toolbar input {
  max-width: 460px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: white;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1230px;
  font-size: 12px;
}
th {
  background: #244c7d;
  color: white;
  text-align: center;
  padding: 16px 10px;
  font-weight: 600;
  white-space: nowrap;
}
td {
  padding: 17px 10px;
  border-bottom: 1px solid #e6ecf3;
  text-align: center;
  white-space: nowrap;
}
td.name-cell {
  text-align: left;
  min-width: 220px;
}
td small {
  display: block;
  color: #8090a2;
  margin-top: 5px;
}
.score-cell {
  font-weight: 700;
  color: #1d65a5;
}
.row-open {
  cursor: pointer;
}
.row-open:hover {
  background: #f0f6fd;
}
.row-open:focus {
  outline: 2px solid #609bd6;
  outline-offset: -2px;
}
.badge {
  padding: 5px 10px;
  border-radius: 20px;
  background: #e9edf3;
  color: #718092;
  font-size: 11px;
  display: inline-block;
}
.fit {
  background: #e4f5ee;
  color: #23895d;
}
.low {
  background: #fff0e2;
  color: #ba6e25;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(760px, 94vw);
  max-height: 90vh;
  box-shadow: 0 20px 70px #12345640;
}
dialog::backdrop {
  background: #122a4680;
}
.panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid #e4ebf3;
}
.panel-body {
  padding: 24px;
}
.person-kpis,
.form-grid,
.calculation {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.person-kpis {
  background: #f0f6fe;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.person-kpis span,
.calculation span {
  display: block;
  color: #718196;
  font-size: 12px;
}
.person-kpis strong,
.calculation strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}
.calculation {
  margin: 20px 0;
  background: #f5f8fc;
  border-radius: 10px;
  padding: 18px;
}
.pdf-attachment {
  border: 1px solid #dfe7f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pdf-attachment input {
  margin-top: 12px;
}
.actions {
  justify-content: flex-end;
  margin-top: 20px;
}
.text-fit {
  color: #23895d;
}
.text-low {
  color: #b27023;
}
.muted {
  color: #778b9e;
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 520px;
  padding: 15px 20px;
  background: #123454;
  color: white;
  border-radius: 10px;
  z-index: 20;
}
.login {
  max-width: 450px;
  margin: 25px auto;
  padding: 25px;
}
.login label {
  margin: 15px 0;
}
.review-note {
  padding: 12px;
  background: #fff5df;
  border-radius: 8px;
  line-height: 1.7;
}
.history-entry {
  padding: 12px;
  border-bottom: 1px solid #e0e7ef;
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
@media (max-width: 850px) {
  aside {
    position: static;
    width: 100%;
    padding: 14px;
  }
  .brand {
    margin-bottom: 10px;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
  }
  main {
    margin-left: 0;
    padding: 20px 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero,
  .header {
    align-items: flex-start;
    flex-direction: column;
  }
  .period-controls {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
  }
  .month-cards {
    flex-direction: column;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .form-grid,
  .calculation {
    grid-template-columns: 1fr 1fr;
  }
}
textarea {
  font: inherit;
  border: 1px solid #d6e0eb;
  border-radius: 8px;
  padding: 11px;
  width: 100%;
  min-height: 85px;
  color: #21364b;
}
.pdf-attachment label {
  margin: 12px 0;
}
