:root {
  --blue-900: #063d73;
  --blue-700: #087bc1;
  --blue-600: #0b8bd8;
  --blue-100: #eaf6ff;
  --orange: #f58220;
  --orange-dark: #d9660a;
  --ink: #17324d;
  --muted: #627588;
  --line: #dce8f1;
  --paper: #ffffff;
  --page: #f5f9fc;
  --success: #127a4a;
  --danger: #bd3e3e;
  --warning: #b66b00;
  --shadow: 0 12px 30px rgba(20, 72, 112, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--page);
  font-family: 'Noto Sans Thai', system-ui, sans-serif; font-size: 15px; line-height: 1.65;
  display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--orange-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.site-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.navbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--blue-900); line-height: 1.1; white-space: nowrap; }
.brand:hover { color: var(--blue-900); }
.brand strong { display: block; font: 600 18px 'Kanit', sans-serif; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.brand-mark { background: linear-gradient(145deg, var(--blue-700), var(--blue-900)); color: #fff; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font: 700 16px 'Kanit', sans-serif; box-shadow: 0 5px 12px rgba(7,123,193,.25); }
.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 18px; font-size: 14px; }
.nav-links > a:not(.btn) { color: var(--ink); font-weight: 500; }
.nav-links > a:not(.btn):hover { color: var(--blue-700); }
.user-chip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--blue-100); color: var(--blue-900); padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--orange); border-radius: 9px; padding: 10px 16px; background: var(--orange); color: #fff; font-weight: 600; line-height: 1.25; transition: .18s ease; }
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; transform: translateY(-1px); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-outline { background: #fff; color: var(--blue-700); border-color: var(--blue-700); }
.btn-outline:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-blue { background: var(--blue-700); border-color: var(--blue-700); }
.btn-blue:hover { background: var(--blue-900); border-color: var(--blue-900); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-full { width: 100%; }
.hero { min-height: 500px; display: grid; align-items: center; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 49% 51%; align-items: center; min-height: 500px; }
.hero-copy { padding: 52px 0 55px; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--orange-dark); background: #fff3e8; border-radius: 999px; padding: 6px 12px; font: 500 13px 'Kanit', sans-serif; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 15px 0 15px; color: var(--blue-900); font: 700 clamp(32px, 4vw, 50px)/1.22 'Kanit', sans-serif; letter-spacing: -.3px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 510px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-image { align-self: stretch; background-image: url('../images/hero-projects.png'); background-size: cover; background-position: center right; min-height: 430px; margin-right: min(-7vw, -60px); }
.section { padding: 68px 0; }
.section-white { background: #fff; }
.section-head { max-width: 675px; margin-bottom: 28px; }
.section-head h2, .page-title { margin-bottom: 8px; font: 600 29px/1.25 'Kanit', sans-serif; color: var(--blue-900); }
.section-head p, .page-subtitle { color: var(--muted); margin-bottom: 0; }
.process-grid, .feature-grid, .stats-grid { display: grid; gap: 18px; }
.process-grid { grid-template-columns: repeat(3, 1fr); }
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.stats-grid { grid-template-columns: repeat(3, 1fr); }
.process-card, .feature-card, .stat-card, .panel, .auth-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 5px 18px rgba(20,72,112,.04); }
.process-card { padding: 25px 22px; position: relative; overflow: hidden; }
.process-card::after { content: ''; width: 88px; height: 88px; position: absolute; right: -30px; top: -32px; border-radius: 50%; background: var(--blue-100); }
.process-card:nth-child(2)::after { background: #fff2e4; }
.process-card:nth-child(3)::after { background: #e7f6ef; }
.step-number { position: relative; z-index: 1; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; color: #fff; background: var(--blue-700); font: 600 17px 'Kanit', sans-serif; }
.process-card:nth-child(2) .step-number { background: var(--orange); }
.process-card:nth-child(3) .step-number { background: var(--success); }
.process-card h3, .feature-card h3 { margin: 15px 0 8px; font: 600 20px 'Kanit', sans-serif; }
.process-card p, .feature-card p { color: var(--muted); margin-bottom: 0; font-size: 14px; }
.feature-card { padding: 22px; }
.feature-icon { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 13px; background: var(--blue-100); color: var(--blue-700); font-size: 23px; }
.feature-card:nth-child(2) .feature-icon { background: #fff0e4; color: var(--orange-dark); }
.feature-card:nth-child(3) .feature-icon { background: #e9f7f0; color: var(--success); }
.stat-card { padding: 21px; background: linear-gradient(145deg, #fff, #f3faff); }
.stat-card strong { display: block; color: var(--blue-700); font: 600 32px 'Kanit', sans-serif; line-height: 1.1; }
.stat-card span { color: var(--muted); font-size: 14px; }
.cta-band { background: linear-gradient(112deg, var(--blue-900), var(--blue-700)); color: #fff; border-radius: 18px; padding: 35px 40px; display: flex; align-items: center; justify-content: space-between; gap: 25px; box-shadow: var(--shadow); }
.cta-band h2 { margin: 0 0 5px; font: 600 26px 'Kanit', sans-serif; }
.cta-band p { margin: 0; color: #dbefff; }
.cta-band .btn { background: #fff; border-color: #fff; color: var(--blue-900); white-space: nowrap; }
.page-hero { padding: 42px 0 27px; }
.page-title { margin: 0; }
.page-shell { padding-bottom: 65px; }
.panel { padding: 28px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel h2 { font: 600 23px 'Kanit', sans-serif; margin-bottom: 18px; color: var(--blue-900); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.panel-header h2 { margin: 0; }
.auth-wrap { min-height: calc(100vh - 177px); display: grid; place-items: center; padding: 42px 0 65px; }
.auth-card { width: min(100%, 540px); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 31px; margin-top: 0; }
.auth-card .intro { color: var(--muted); margin-bottom: 23px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: #36516b; font-size: 14px; font-weight: 600; }
.field small, .help { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea, input[type=file] { border: 1px solid #cbdce7; background: #fff; color: var(--ink); border-radius: 8px; padding: 10px 11px; outline: 0; width: 100%; transition: .15s; }
input[type=file] { padding: 8px; font-size: 13px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(11,139,216,.14); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.form-actions .muted-link { margin-left: auto; font-size: 14px; }
.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.role-option { border: 1px solid #cadce8; padding: 12px; border-radius: 10px; cursor: pointer; transition: .15s; }
.role-option:has(input:checked) { border-color: var(--blue-600); background: var(--blue-100); }
.role-option input { width: auto; margin-right: 7px; accent-color: var(--blue-700); }
.role-option strong { font-size: 14px; }
.role-option span { display: block; margin-left: 24px; color: var(--muted); font-size: 12px; }
.alert { margin-top: 18px; border-radius: 9px; padding: 11px 14px; font-size: 14px; border: 1px solid transparent; }
.flash-stack:empty { display: none; }
.alert-success { background: #ebf9f1; color: #126440; border-color: #bfebd2; }
.alert-warning { background: #fff6e6; color: #875300; border-color: #ffe0a5; }
.alert-danger { background: #fff0f0; color: #a52e2e; border-color: #ffcaca; }
.notice { background: var(--blue-100); border-left: 4px solid var(--blue-600); padding: 13px 15px; border-radius: 0 8px 8px 0; color: #315873; font-size: 14px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 21px; }
.project-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: linear-gradient(135deg,#fff,#f4faff); }
.project-card + .project-card { margin-top: 15px; }
.project-card h3 { margin: 0 0 9px; font: 500 20px/1.4 'Kanit', sans-serif; color: var(--blue-900); }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px 17px; color: var(--muted); font-size: 13px; }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; line-height: 1.35; }
.badge-draft, .badge-submitted { color: #9a5b00; background: #fff2d8; }
.badge-needs_revision { color: #a13030; background: #ffebeb; }
.badge-approved, .badge-active { color: #176c45; background: #e4f7ed; }
.badge-published { color: #075c9d; background: #e0f2ff; }
.submission-list { list-style: none; padding: 0; margin: 0; }
.submission-list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.submission-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.submission-list strong { display: block; font-size: 14px; }
.submission-list span { color: var(--muted); font-size: 12px; }
.upload-guide { display: grid; grid-template-columns: 50px 1fr; gap: 13px; align-items: start; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.upload-guide:last-child { border-bottom: 0; }
.file-type { display: grid; place-items: center; min-height: 34px; border-radius: 7px; background: #fff1e4; color: var(--orange-dark); font-weight: 700; font-size: 12px; }
.upload-guide strong { display: block; font-size: 14px; }
.upload-guide p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: #597188; font-weight: 600; background: #f3f8fb; }
th, td { padding: 12px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
td p { margin: 0; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.report-card { display: flex; flex-direction: column; position: relative; border: 1px solid var(--line); border-radius: 13px; padding: 21px; background: #fff; box-shadow: 0 6px 18px rgba(20,72,112,.05); }
.report-card h2 { font: 500 20px/1.4 'Kanit', sans-serif; color: var(--blue-900); margin: 15px 0 10px; }
.report-card p { font-size: 13px; color: var(--muted); }
.report-card .btn { margin-top: auto; }
.report-code { color: var(--orange-dark); font-weight: 600; font-size: 13px; }
.view-counter { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px; min-width: 48px; justify-content: center; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 2px 7px rgba(20,72,112,.15); color: var(--blue-900); font-size: 12px; font-weight: 700; }
.report-card > .report-code { padding-right: 62px; }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; max-width: none; }
.showcase-grid { gap: 17px; }
.showcase-card { overflow: hidden; padding: 0; }
.showcase-main-image { display: block; position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #dff1fb, #f8fbfd); overflow: hidden; }
.showcase-main-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.showcase-main-image:hover img { transform: scale(1.035); }
.showcase-body { padding: 16px 18px 18px; }
.showcase-body h2 { margin: 7px 0 7px; color: var(--blue-900); font: 500 19px/1.4 'Kanit', sans-serif; }
.showcase-meta { color: var(--muted); font-size: 13px; margin: 0; }
.showcase-thumbnails { display: flex; gap: 8px; margin-top: 15px; overflow-x: auto; padding-bottom: 2px; }
.showcase-thumbnails a { flex: 0 0 72px; height: 49px; overflow: hidden; border: 2px solid transparent; border-radius: 6px; background: var(--blue-100); }
.showcase-thumbnails a:first-child { border-color: var(--orange); }
.showcase-thumbnails img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-section { padding: 65px 0; background: radial-gradient(circle at 10% 10%, rgba(11,139,216,.13), transparent 28%), radial-gradient(circle at 90% 82%, rgba(245,130,32,.15), transparent 31%), linear-gradient(145deg, #edf8ff 0%, #fffaf5 100%); }
.pr-slider { position: relative; isolation: isolate; width: 100%; height: clamp(270px, 38vw, 500px); overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 24px; background: var(--blue-900); box-shadow: 0 20px 50px rgba(5, 62, 115, .24); }
.pr-slide { position: absolute; inset: 0; display: block; opacity: 0; pointer-events: none; transform: scale(1.03); transition: opacity .65s ease, transform 1.3s ease; color: #fff; }
.pr-slide.is-active { opacity: 1; pointer-events: auto; transform: scale(1); }
.pr-slide > img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.pr-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,34,66,.88) 0%, rgba(3,34,66,.56) 42%, rgba(3,34,66,.06) 75%), linear-gradient(0deg, rgba(0,0,0,.22), transparent 45%); }
.pr-content { position: absolute; left: clamp(20px, 4.8vw, 58px); bottom: clamp(22px, 4vw, 48px); display: block; max-width: min(570px, calc(100% - 100px)); padding: clamp(16px, 2.1vw, 25px); border: 1px solid rgba(255,255,255,.28); border-radius: 18px; background: linear-gradient(135deg, rgba(6,47,83,.82), rgba(8,81,132,.43)); box-shadow: 0 12px 35px rgba(0,0,0,.20); backdrop-filter: blur(12px); text-shadow: 0 2px 10px rgba(0,0,0,.23); }
.pr-kicker { display: block; color: #ffd3a9; font: 500 13px 'Kanit', sans-serif; letter-spacing: .6px; text-transform: uppercase; }
.pr-content strong { display: block; margin: 9px 0 7px; font: 600 clamp(25px, 3vw, 40px)/1.2 'Kanit', sans-serif; }
.pr-content small { display: -webkit-box; overflow: hidden; color: #ecf7ff; font-size: 15px; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-content em { display: inline-flex; align-items: center; gap: 9px; margin-top: 17px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.50); border-radius: 999px; font-size: 13px; font-style: normal; background: rgba(255,255,255,.12); }
.pr-content em b { color: #ffbf86; font-size: 18px; line-height: 1; }
.pr-arrow { position: absolute; z-index: 3; top: 50%; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(7,40,70,.30); color: #fff; font-size: 21px; transform: translateY(-50%); transition: .18s; }
.pr-arrow:hover { background: var(--orange); border-color: var(--orange); }.pr-prev { left: 20px; }.pr-next { right: 20px; }
.pr-dots { position: absolute; z-index: 3; right: 28px; bottom: 24px; display: flex; gap: 7px; }.pr-dots button { width: 8px; height: 8px; border: 0; border-radius: 99px; padding: 0; background: rgba(255,255,255,.55); transition: .2s; }.pr-dots button.is-active { width: 28px; background: var(--orange); }
.gallery-event-list { display: flex; gap: 9px; overflow-x: auto; margin: 0 0 21px; padding-bottom: 4px; }.gallery-event-list a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--blue-900); font-size: 13px; background: #fff; }.gallery-event-list a.is-active, .gallery-event-list a:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.pr-gallery-grid { gap: 17px; }.pr-gallery-card { overflow: hidden; padding: 0; }.pr-gallery-media { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #dcebf4; }.pr-gallery-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }.pr-gallery-media:hover img { transform: scale(1.06); }.pr-gallery-card .view-counter { top: 10px; right: 10px; }.pr-gallery-body { padding: 16px 18px 18px; }.pr-gallery-body h2 { margin: 7px 0 6px; color: var(--blue-900); font: 500 19px/1.4 'Kanit', sans-serif; }.pr-gallery-body p { margin: 0; color: var(--muted); font-size: 13px; }
.pr-view-layout { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 22px; }.pr-view-image { display: grid; place-items: center; min-height: 380px; overflow: hidden; border-radius: 15px; background: #082b4d; }.pr-view-image img { max-width: 100%; max-height: 72vh; display: block; }.pr-stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }.pr-stat { padding: 12px; border-radius: 10px; background: var(--blue-100); color: var(--blue-900); text-align: center; }.pr-stat strong { display: block; font: 600 24px 'Kanit', sans-serif; }.pr-stat span { font-size: 12px; }
.admin-image-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }.admin-image { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }.admin-image img { width: 100%; aspect-ratio: 1.2; display: block; object-fit: cover; }.admin-image div { padding: 8px; font-size: 11px; color: var(--muted); }.admin-image form { position: absolute; top: 6px; right: 6px; }.admin-image button { border: 0; border-radius: 6px; padding: 4px 6px; background: #fff; color: var(--danger); font-size: 11px; }
.empty-state { padding: 37px 20px; text-align: center; border: 2px dashed #cbdce7; border-radius: 13px; color: var(--muted); }
.empty-state strong { color: var(--blue-900); display: block; font: 500 21px 'Kanit', sans-serif; }
.filter-bar { display: flex; gap: 11px; align-items: end; margin-bottom: 20px; }
.filter-bar .field { flex: 1; }
.review-form { display: grid; grid-template-columns: 145px 1fr auto; align-items: end; gap: 9px; min-width: 500px; }
.review-form textarea { min-height: 39px; height: 39px; padding-block: 7px; }
.danger-text { color: var(--danger); }
.site-footer { background: #072d52; color: #d3e4f2; padding: 23px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 13px; }
.footer-inner strong { color: #fff; display: block; font: 500 16px 'Kanit', sans-serif; }
.footer-inner div span { display: block; color: #a8c7dd; font-size: 12px; }

@media (max-width: 840px) {
  .navbar { min-height: auto; padding: 12px 0; align-items: flex-start; }
  .nav-links { gap: 10px; flex-wrap: wrap; font-size: 13px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 45px 0 22px; }
  .hero-image { min-height: 330px; margin-right: 0; background-position: center; }
  .process-grid, .feature-grid, .report-grid, .showcase-grid { grid-template-columns: 1fr; }
  .pr-view-layout { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 28px; }
}
@media (max-width: 590px) {
  .container { width: min(100% - 28px, 1140px); }
  .navbar { gap: 10px; flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .user-chip { max-width: 110px; }
  .hero { min-height: 0; }
  .hero-image { min-height: 255px; }
  .pr-section { padding: 44px 0; }.pr-slider { height: clamp(275px, 82vw, 410px); border-radius: 17px; }.pr-content { left: 16px; right: 16px; bottom: 18px; max-width: none; padding: 15px; border-radius: 14px; }.pr-content small { font-size: 13px; }.pr-content em { margin-top: 11px; }.pr-prev { left: 12px; }.pr-next { right: 12px; }.pr-arrow { top: 36%; }.admin-image-list { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 45px 0; }
  .form-grid, .role-options, .stats-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .auth-card, .panel { padding: 21px; }
  .cta-band, .footer-inner { flex-direction: column; align-items: flex-start; }
  .section-head-row { align-items: flex-start; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .review-form { grid-template-columns: 1fr; min-width: 250px; }
}
