:root {
  color-scheme: light;
  --nav: #14283e;
  --ink: #152c40;
  --muted: #4f6575;
  --line: #dbe6eb;
  --accent: #08716c;
  --accent-deep: #075752;
  --paper: #fff;
  --surface: #f3f7fa;
  font: 16px/1.55 system-ui, "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); }
a { color: var(--accent-deep); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #136bb4; outline-offset: 3px; }
.frame { max-width: 1250px; margin: 0 auto; padding-inline: 26px; }
.skip { position: absolute; left: 12px; top: -100px; background: white; padding: 8px 12px; z-index: 2; }
.skip:focus { top: 12px; }
.topbar { color: white; background: var(--nav); border-bottom: 1px solid #34495c; }
.top-inner { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: white; text-decoration: none; font-size: 21px; font-weight: 750; letter-spacing: .025em; line-height: 1.25; }
.brand small { display: block; color: #d5e3eb; font-size: 12px; font-weight: 500; margin-top: 3px; letter-spacing: 0; }
.mark { background: #92ead9; color: #0b4442; border-radius: 12px; width: 43px; height: 43px; display: grid; place-items: center; font-size: 18px; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 13px; font-size: 13px; }
.account strong, .account span { display: block; overflow-wrap: anywhere; }
.account span { color: #d0e0ea; }
.account a { color: #e7f7f5; }
.nav-bar { background: white; border-bottom: 1px solid var(--line); }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--ink); padding: 11px 14px; border-bottom: 3px solid transparent; font-weight: 650; font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent-deep); background: #effaf7; border-color: var(--accent); }
.notice { margin: 18px 0 6px; padding: 9px 13px; border: 1px solid #cde5e1; border-radius: 8px; background: #eaf6f3; color: #214d4a; font-size: 13px; }
.notice strong { margin-right: 5px; }
.page-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin: 24px 0 20px; }
.eyebrow { font-size: 12px; color: var(--accent-deep); font-weight: 750; margin-bottom: 3px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(24px,3.2vw,36px); line-height: 1.25; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p, .hint { color: var(--muted); }
.page-heading p, .login > p { margin-top: 6px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; min-width: 0; }
.card-head { margin-bottom: 14px; }
.card-head p, .hint { font-size: 13px; }
.guest { min-height: 56vh; }
.login { width: min(100%, 460px); margin: 42px auto 24px; padding: 27px; }
.login form { margin: 17px 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 650; font-size: 14px; text-decoration: none; cursor: pointer; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-deep); }
.secondary { color: var(--accent-deep); border-color: #bfdbd5; background: #f6fbfa; }
.secondary:hover { background: #e6f5f0; }
.top-button { color: white; border-color: #657789; background: transparent; min-height: 34px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form > .button-row, .card > .button-row { margin-top: 13px; }
.stack { display: grid; gap: 12px; }
.narrow { max-width: 480px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 42px; background: white; color: var(--ink); border: 1px solid #b9cbd4; border-radius: 8px; padding: 8px 10px; font: inherit; font-weight: 400; }
.field textarea { resize: vertical; }
.field select { text-overflow: ellipsis; }
.required { color: #a7332c; }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: inline-flex; gap: 8px; align-items: center; padding-top: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; background: white; }
.metric:hover { border-color: var(--accent); }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 29px; line-height: 1.35; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { padding: 9px 11px; text-align: left; vertical-align: top; }
th { color: #324d60; background: #edf4f8; font-size: 13px; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
td:first-child { white-space: nowrap; }
.status, .prototype { display: inline-block; border-radius: 999px; padding: 2px 8px; font-weight: 650; font-size: 12px; }
.status { color: #254966; background: #e8f2fb; white-space: nowrap; }
.status-submitted, .status-returned { color: #744b12; background: #fff2d8; }
.status-closed, .status-resolved { color: #175749; background: #dff5ed; }
.prototype { color: #674b1e; background: #fff2cf; }
.empty { padding: 17px; border: 1px dashed #c3d3db; border-radius: 8px; color: var(--muted); }
.bars { margin-top: 9px; }
.bar { margin: 6px 0; }
.bar label { display: flex; justify-content: space-between; font-size: 13px; }
meter { width: 100%; height: 12px; }
.stat-list { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; margin: 12px 0 0; padding: 0; }
.stat-list li { display: flex; gap: 8px; background: #edf4f8; padding: 5px 9px; border-radius: 8px; font-size: 13px; }
.pagination { display: flex; justify-content: end; align-items: center; gap: 9px; margin-top: 13px; font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 0 0 16px; }
.facts div { background: #f3f7fa; border-radius: 8px; padding: 8px; }
dt { font-size: 12px; color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.detail-copy p, .timeline p { white-space: pre-wrap; margin-bottom: 8px; }
.action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.action { display: grid; align-content: start; gap: 8px; border: 1px solid var(--line); padding: 12px; border-radius: 8px; }
.action .button-row { margin: 0; }
.upload { margin-top: 10px; display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.file-list, .timeline { margin: 8px 0 0; padding-left: 20px; }
.file-list li { overflow-wrap: anywhere; }
.file-list span, .timeline small { color: var(--muted); font-size: 12px; }
.timeline li { padding: 5px 0 7px; }
details { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
details[open] form { margin-top: 12px; }
summary { cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.footer { margin-top: 20px; padding-bottom: 20px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; gap: 0; }
  .filter-grid, .facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .frame { padding-inline: 12px; }
  .top-inner, .page-heading { align-items: start; }
  .top-inner { flex-wrap: wrap; }
  .account { width: 100%; justify-content: space-between; gap: 7px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 7px 8px; font-size: 13px; }
  .page-heading { flex-direction: column; gap: 8px; margin-top: 15px; }
  .card { padding: 12px; }
  .login { padding: 19px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .form-grid, .action-grid { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
