:root {
    --font-thai: "NotoSansThai", sans-serif;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-100.ttf") format("truetype");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-200.ttf") format("truetype");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-300.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-400.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-500.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-600.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-700.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-800.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "NotoSansThai";
    src: url("fonts/NotoSansThai-900.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #172033;
    --muted: #607086;
    --line: #dbe3ef;
    --soft: #f3f7fb;
    --panel: #ffffff;
    --blue: #1967d2;
    --teal: #00897b;
    --gold: #c98700;
    --red: #c5221f;
    --green: #0f9d58;
    --shadow: 0 18px 50px rgba(23, 32, 51, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #eef4f8;
    font-family: var(--font-thai);
    line-height: 1.65;
}

button,
input,
select,
textarea,
table {
    font-family: var(--font-thai);
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(16px, 4vw, 56px);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 270px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    font-weight: 700;
}

.brand strong,
.brand span {
    display: block;
}

.brand span {
    color: var(--muted);
    font-size: 13px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a {
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--blue);
    background: #e9f1ff;
}

main {
    padding: 26px clamp(16px, 4vw, 56px) 50px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: 24px;
    align-items: stretch;
    min-height: 260px;
    padding: clamp(24px, 5vw, 48px);
    margin-bottom: 24px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(16, 60, 120, .92), rgba(0, 137, 123, .82)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='460' viewBox='0 0 1200 460'%3E%3Crect width='1200' height='460' fill='%233b6ea5'/%3E%3Cpath d='M0 320 C220 240 360 380 560 300 C760 220 920 260 1200 140 L1200 460 L0 460 Z' fill='%239ec7d7' opacity='.36'/%3E%3Cpath d='M120 110 H1080 V124 H120 ZM190 160 H1010 V168 H190 ZM270 208 H930 V216 H270 Z' fill='%23ffffff' opacity='.22'/%3E%3C/svg%3E");
    background-size: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero h1,
.page-title h1 {
    margin: 0;
    line-height: 1.25;
}

.hero h1 {
    max-width: 850px;
    font-size: clamp(28px, 4.2vw, 48px);
}

.hero p {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 8px;
    color: inherit;
    font-weight: 700;
    letter-spacing: 0;
    opacity: .8;
}

.trust-card {
    align-self: end;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
}

.trust-card strong,
.trust-card span {
    display: block;
}

.trust-card span {
    margin-top: 8px;
    color: rgba(255, 255, 255, .86);
}

.split-layout,
.dashboard-grid,
.admin-grid,
.detail-grid {
    display: grid;
    gap: 20px;
}

.split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    align-items: start;
}

.dashboard-grid,
.admin-grid,
.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(23, 32, 51, .06);
}

.panel {
    padding: clamp(18px, 3vw, 28px);
}

.panel.narrow {
    max-width: 560px;
    margin: 40px auto;
}

.panel h2,
.panel h3,
.panel h1 {
    margin-top: 0;
}

.panel-head,
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    margin: 8px 0 22px;
}

.page-title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.form-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 14px;
}

.form-step:first-of-type {
    margin-top: 0;
}

.form-step b {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--blue);
}

.form-step h2 {
    margin: 0;
    font-size: 21px;
}

label {
    display: block;
    margin-bottom: 14px;
    font-weight: 700;
}

label small,
.muted {
    display: block;
    color: var(--muted);
    font-weight: 400;
}

em {
    color: var(--red);
    font-style: normal;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(25, 103, 210, .18);
    border-color: var(--blue);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.check-row input {
    width: 18px;
    min-height: 18px;
    margin-top: 4px;
}

.confirm {
    margin-top: 22px;
}

.anonymous-note {
    padding: 12px 14px;
    color: #6f4d00;
    background: #fff7df;
    border: 1px solid #f1d58d;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.file-drop {
    padding: 18px;
    border: 1px dashed #93a8c3;
    border-radius: 8px;
    background: #f7fbff;
    text-align: center;
}

.file-drop input {
    max-width: 340px;
    margin: 0 auto 8px;
}

.file-drop span {
    display: block;
    font-size: 18px;
}

.file-list {
    color: var(--muted);
    font-size: 14px;
}

.primary-btn,
.secondary-btn,
.small-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-btn {
    color: #fff;
    background: var(--blue);
}

.primary-btn:hover {
    background: #1257b5;
}

.secondary-btn,
.small-link {
    color: var(--blue);
    background: #fff;
    border-color: #b8c8df;
}

.small-link {
    min-height: 34px;
    padding: 6px 10px;
}

.tracking-form {
    display: grid;
    gap: 12px;
}

.tracking-card {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    background: var(--soft);
    border-radius: 8px;
}

.tracking-card strong {
    display: block;
    font-size: 18px;
}

.timeline {
    margin: 20px 0 0;
    padding-left: 22px;
    border-left: 2px solid var(--line);
    list-style: none;
}

.timeline li {
    position: relative;
    margin-bottom: 18px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
}

.timeline span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.timeline p {
    margin: 6px 0 0;
}

.compact {
    font-size: 14px;
}

.alert {
    max-width: 1180px;
    margin: 0 auto 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid;
    background: #fff;
}

.alert.success {
    color: #0b5f38;
    border-color: #a9dec5;
    background: #eefaf4;
}

.alert.error {
    color: #9f1f1c;
    border-color: #efb2ae;
    background: #fff1f0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric {
    padding: 18px;
}

.metric span,
.metric small {
    display: block;
    color: var(--muted);
}

.metric strong {
    display: block;
    margin: 6px 0;
    font-size: 34px;
    line-height: 1;
}

.donut {
    display: grid;
    place-items: center;
    width: min(260px, 70vw);
    aspect-ratio: 1;
    margin: 12px auto 20px;
    border-radius: 50%;
    position: relative;
}

.donut::after {
    content: "";
    position: absolute;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
}

.donut span {
    position: relative;
    z-index: 1;
    font-size: 28px;
    font-weight: 700;
}

.legend,
.bar-list,
.doc-list,
.stack-form {
    display: grid;
    gap: 12px;
}

.legend div,
.bar-row > div,
.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: 0 0 auto;
}

.legend div {
    justify-content: flex-start;
}

.legend strong {
    margin-left: auto;
}

.bar-row i {
    display: block;
    height: 10px;
    overflow: hidden;
    background: #e6edf6;
    border-radius: 999px;
}

.bar-row b {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--blue));
}

.doc-item {
    display: block;
    padding: 14px;
    color: inherit;
    text-decoration: none;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.doc-item strong,
.doc-item span {
    display: block;
}

.doc-item span {
    color: var(--muted);
    font-size: 14px;
}

.risk-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.risk-cell {
    min-height: 110px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    text-align: center;
    font-weight: 700;
}

.risk-cell span {
    font-weight: 400;
    font-size: 13px;
}

.risk-cell.low,
.risk-badge.low {
    background: var(--green);
}

.risk-cell.medium,
.risk-badge.medium {
    background: var(--gold);
}

.risk-cell.high,
.risk-badge.high {
    background: var(--red);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.pill,
.risk-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.pill {
    color: #174ea6;
    background: #e8f0fe;
}

.risk-badge {
    color: #fff;
}

.detail-row {
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.detail-row span {
    flex: 0 0 155px;
    color: var(--muted);
}

.detail-row strong {
    font-weight: 500;
    overflow-wrap: anywhere;
}

.center {
    text-align: center;
}

.site-footer {
    padding: 22px clamp(16px, 4vw, 56px);
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
    .site-header,
    .page-title,
    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .split-layout,
    .dashboard-grid,
    .admin-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    main {
        padding-inline: 12px;
    }

    .brand {
        min-width: 0;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .grid-2,
    .metric-grid,
    .risk-matrix {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 22px;
    }

    .metric strong {
        font-size: 28px;
    }

    .detail-row {
        display: block;
    }
}
