:root {
  color-scheme: light;
  --ink: #19233a;
  --muted: #52617a;
  --line: #dfe5ef;
  --bg: #f5f7fb;
  --white: #fff;
  --accent: #5639be;
  --accent-dark: #412699;
  --accent-soft: #eee9fb;
  font-family: system-ui, "Noto Sans Thai", "Sarabun", sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent-dark); text-decoration-thickness: .08em; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #896aef; outline-offset: 3px; }
svg { width: 1.2rem; height: 1.2rem; display: block; flex: none; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.3vw, 2.8rem); line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 1.35rem; line-height: 1.4; }
h3 { font-size: 1.08rem; line-height: 1.4; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 15px; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); padding: 2px 7px 28px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.035em; }
.brand small { display: block; font-size: .78rem; color: var(--muted); }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; background: #28204d; color: #e4dcff; }
.brand-mark svg { width: 23px; height: 23px; }
nav { display: grid; gap: 5px; }
nav a, .sidebar-source { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 600; }
nav a:hover, .sidebar-source:hover { background: var(--bg); color: var(--ink); }
nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }
.sidebar-source { margin-top: auto; }
main { margin-left: 236px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 69px; padding: 10px clamp(16px, 3.5vw, 45px); border-bottom: 1px solid var(--line); background: var(--white); }
.topbar > span { font-weight: 700; }
.content { max-width: 1310px; margin: auto; padding: 30px clamp(16px, 3.5vw, 45px) 48px; display: grid; gap: 26px; }
.hero { position: relative; padding: clamp(24px, 4vw, 43px); color: var(--white); border-radius: 19px; overflow: hidden; isolation: isolate; background: linear-gradient(112deg, #201b42 20%, #3b2a70 100%); }
.hero::after { content: ""; position: absolute; inset: -95px -120px auto auto; width: 440px; height: 440px; border-radius: 50%; z-index: -1; background: repeating-radial-gradient(circle, transparent 0 26px, #c7b6ff20 27px 28px, transparent 29px 39px); mask-image: linear-gradient(115deg, transparent 8%, black 75%); }
.hero p { color: #e3ddf7; margin-top: 10px; max-width: 42rem; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
.section-heading p, .page-intro p { margin-top: 4px; color: var(--muted); }
.page-intro { display: grid; gap: 6px; }
.search-form { display: grid; grid-template-columns: minmax(170px, 2fr) minmax(155px, 1.25fr) minmax(110px, .65fr) auto; align-items: end; gap: 12px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field label { font-size: .9rem; font-weight: 650; }
input, select, textarea { background: var(--white); color: var(--ink); border: 1px solid #cbd4e2; border-radius: 8px; width: 100%; min-height: 44px; padding: 8px 11px; }
input::placeholder, textarea::placeholder { color: #617088; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352617a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { resize: vertical; min-height: 85px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.chips { margin-top: 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid #ddd5f5; border-radius: 99px; background: #f7f4fd; color: var(--accent-dark); padding: 4px 10px; font-size: .87rem; }
.chip:hover, .chip[aria-pressed="true"] { border-color: #a48bdc; background: var(--accent-soft); }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; font-weight: 660; font-size: .91rem; text-decoration: none; white-space: nowrap; }
.primary { background: var(--accent); color: var(--white); }
.primary:hover { background: var(--accent-dark); }
.neutral, .icon-button { background: var(--white); border-color: #d7dfeb; color: var(--ink); }
.neutral:hover, .icon-button:hover { background: var(--bg); }
.subtle { background: var(--accent-soft); color: var(--accent-dark); }
.subtle:hover { background: #e5dcfa; }
.icon-button { min-width: 42px; padding: 7px; }
.button:disabled { opacity: .55; cursor: default; }
.categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category { display: grid; gap: 9px; align-content: start; padding: 16px; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.category:hover, .category[aria-pressed="true"] { border-color: #956fe6; background: #fbf9ff; }
.category-icon { width: 37px; height: 37px; border-radius: 10px; }
.lavender { background: #eee8fb; color: #5b3bb1; }
.mint { background: #e2f3ee; color: #17614f; }
.sky { background: #e5eefb; color: #275a9a; }
.peach { background: #f9eee0; color: #81501c; }
.category strong { line-height: 1.35; }
.category small { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #f5f7fb; color: #46546c; font-size: .85rem; }
td { font-size: .93rem; }
td strong { display: block; }
td small, .muted { color: var(--muted); }
.filters { margin-bottom: 14px; }
.evidence-detail { margin: 7px 0 11px; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: 3px 8px; border-radius: 6px; line-height: 1.35; white-space: nowrap; background: #eaf0f7; color: #384a66; font-size: .81rem; font-weight: 650; }
.status.good { background: #e0f3e9; color: #155638; }
.status.wait { background: #fbf0dc; color: #784e12; }
.status.bad { background: #fce8eb; color: #8d2635; }
.row-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.row-actions .button { min-height: 34px; padding: 5px 9px; font-size: .84rem; }
.stack { display: grid; gap: 12px; }
.reader { max-width: 78ch; }
.reader ul { padding-left: 1.3em; margin: 8px 0 0; }
.empty { padding: 30px 15px; text-align: center; color: var(--muted); background: var(--bg); border-radius: 10px; }
.empty p { margin-bottom: 12px; }
.compact { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.compact .field { flex: 1 1 230px; }
dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 15px; padding: 0; color: var(--ink); background: var(--white); box-shadow: 0 18px 65px #1915353a; }
dialog::backdrop { background: #17172d77; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.fields { padding: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .wide { grid-column: 1 / -1; }
.toast { position: fixed; z-index: 2; bottom: 20px; right: 20px; max-width: calc(100% - 40px); padding: 10px 14px; border-radius: 9px; color: var(--white); background: #28204d; box-shadow: 0 4px 20px #17172d33; }
@media (max-width: 1150px) {
  .search-form { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
@media (max-width: 890px) {
  .sidebar { position: static; width: auto; padding: 11px 14px 7px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 2px 3px 10px; }
  nav { display: flex; flex-wrap: wrap; gap: 3px; }
  nav a { padding: 6px 9px; min-height: 40px; gap: 6px; }
  .sidebar-source { display: none; }
  main { margin-left: 0; }
}
@media (max-width: 610px) {
  .topbar { min-height: 57px; }
  .content { padding-top: 16px; gap: 18px; }
  .panel { padding: 14px; }
  .categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-form .field:first-child { grid-column: 1 / -1; }
  .search-form > .button { grid-column: 1 / -1; }
  table { min-width: 590px; }
  .fields { grid-template-columns: 1fr; }
}
