:root {
  --ink: #172f29;
  --muted: #536a61;
  --green: #17674f;
  --line: #cedbd1;
  --soft: #f3f6ef;
  font:
    15px/1.55 system-ui,
    'PingFang SC',
    sans-serif;
  color: var(--ink);
  background: var(--soft);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
aside {
  width: 210px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #143f35;
  color: white;
  padding: 35px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand b {
  display: inline-grid;
  place-items: center;
  background: #d7f58e;
  color: #174638;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  font: 750 21px system-ui;
}
.side-title {
  margin: 30px 12px 12px;
  color: #a9c4b8;
  font-size: 12px;
}
nav {
  display: grid;
  gap: 5px;
}
nav a {
  padding: 12px 14px;
  color: #d8e7de;
  border-radius: 8px;
  text-decoration: none;
}
nav a[aria-current] {
  background: #356351;
  color: white;
  font-weight: 650;
}
aside small {
  margin-top: auto;
  color: #c4d5c8;
}
.shell {
  margin-left: 210px;
}
header {
  min-height: 64px;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 4vw;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
  color: var(--muted);
  font-size: 13px;
}
a {
  color: var(--green);
}
main {
  max-width: 1310px;
  margin: auto;
  padding: 34px 4vw 60px;
}
.top,
.row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.top {
  margin-bottom: 24px;
}
.top p,
small,
.sub {
  color: var(--muted);
}
h1 {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -1px;
  line-height: 1.2;
  margin: 0;
}
h2 {
  font-size: 19px;
  margin: 0 0 14px;
}
p {
  margin: 6px 0 12px;
}
.top p {
  margin: 8px 0 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
}
.card,
article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.card strong {
  font-size: 32px;
  display: block;
  margin: 7px 0;
  font-variant-numeric: tabular-nums;
}
.card:first-child {
  background: #e8f3d7;
}
.card small {
  font-size: 12px;
}
article {
  margin: 18px 0;
}
.chart {
  display: flex;
  align-items: end;
  gap: 3%;
  height: 95px;
  margin: 16px 0 0;
  border-bottom: 1px solid var(--line);
}
.chart i {
  flex: 1;
  background: #73a88e;
  border-radius: 3px 3px 0 0;
}
.chart i:nth-last-child(-n + 3) {
  background: #286e55;
}
.cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
.cols article {
  margin-bottom: 0;
}
.btn,
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 14px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 14px;
}
th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid #e3ebe4;
  text-align: left;
}
th {
  font-weight: 550;
  color: var(--muted);
  font-size: 12px;
}
tbody tr:last-child td {
  border: 0;
}
.tag {
  padding: 3px 9px;
  border-radius: 20px;
  background: #eaf2e9;
  color: #285640;
  font-size: 12px;
}
.warn {
  background: #fff0ca;
  color: #795219;
}
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.steps span {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.steps .on {
  background: #daeec7;
  color: #174c39;
}
.field {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  max-width: 570px;
}
.field input,
.field select,
textarea {
  width: 100%;
  border: 1px solid #a5b8ab;
  border-radius: 7px;
  padding: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea {
  max-width: 570px;
  min-height: 100px;
}
.panel-note {
  padding: 12px 14px;
  border-left: 3px solid #79a883;
  background: #f1f6ee;
  margin: 12px 0;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
.compact {
  margin: 7px 0;
}
.bar0 {
  height: 29%;
}
.bar1 {
  height: 40%;
}
.bar2 {
  height: 36%;
}
.bar3 {
  height: 54%;
}
.bar4 {
  height: 49%;
}
.bar5 {
  height: 72%;
}
.bar6 {
  height: 64%;
}
.bar7 {
  height: 83%;
}
.bar8 {
  height: 76%;
}
.bar9 {
  height: 93%;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 16px;
  right: 18px;
  background: #143f35;
  color: white;
  border-radius: 9px;
  padding: 10px 18px;
  z-index: 4;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #66ad8b;
  outline-offset: 2px;
}
@media (max-width: 820px) {
  aside {
    position: static;
    width: auto;
    padding: 12px 16px;
  }
  .brand {
    font-size: 19px;
  }
  .brand b {
    width: 29px;
    height: 29px;
    font-size: 16px;
  }
  .side-title,
  aside small {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    margin-top: 9px;
    gap: 2px;
  }
  nav a {
    white-space: nowrap;
    padding: 7px 9px;
    font-size: 13px;
  }
  .shell {
    margin: 0;
  }
  header {
    min-height: 44px;
    padding: 0.45rem 16px;
  }
  main {
    padding: 22px 16px;
  }
  .cols {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .card,
  article {
    padding: 15px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}

[hidden] {
  display: none !important;
}
.auth-card {
  max-width: 34rem;
  margin: clamp(1rem, 6vh, 4rem) auto;
}
.form-error {
  color: #a12727;
}
.form-error:empty {
  display: none;
}
.session-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}
.session-controls a {
  overflow-wrap: anywhere;
}

:root[lang='th'] {
  font-family: system-ui, 'Noto Sans Thai', 'Thonburi', 'Leelawadee UI', sans-serif;
  line-height: 1.65;
}
:root[lang='th'] h1,
:root[lang='th'] h2 {
  letter-spacing: normal;
}
#language {
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45em 0.65em;
}
@media (max-width: 560px) {
  header {
    justify-content: flex-end;
  }
  .workspace-path {
    display: none;
  }
}
