/* Shared visual system. Page-specific business logic stays in each page. */
html:root {
    color-scheme:light;
    --theme-purple:#51338b; --theme-purple-light:#7250b1; --theme-purple-hover:#3e256f;
    --theme-orange:#a43f12; --theme-orange-hover:#84330f;
    --orange-on-dark:#ff9b5e; --orange-hover-on-dark:#ffb180;
    --orange-tint:#fff1e8; --orange-border:#eebda2;
    --bg-light:#f5f4f9; --surface:#fff; --surface-soft:#f5f1fa;
    --text-dark:#282235; --text-muted:#625b70; --border-color:#ddd7e7;
    --success:#23734b; --danger:#b52d49; --warning:var(--theme-orange); --info:#28619a;
    --border-radius:16px; --card-radius:16px; --input-radius:10px; --icon-radius:12px;
    --input-bg:#fff; --box-shadow:0 4px 20px #30204008;
}
* { box-sizing:border-box; }
html { scroll-padding-top:110px; }
body { margin:0; font-family:'Sarabun',Tahoma,sans-serif; font-size:16px; background:var(--bg-light); color:var(--text-dark); line-height:1.75; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font-family:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
a,button,input,select,textarea { touch-action:manipulation; }
:focus-visible { outline:3px solid #9569d3; outline-offset:4px; }
button:disabled { cursor:not-allowed; }
.skip-link { position:fixed; top:12px; left:16px; transform:translateY(-160%); padding:10px 18px; background:#fff; color:#51338b; border-radius:10px; z-index:10001; }
.skip-link:focus { transform:translateY(0); }
body .navbar { background:#fff; border-bottom:1px solid var(--border-color); box-shadow:none; padding:16px max(24px,calc((100vw - 1240px)/2)); gap:28px; }
body .nav-brand { color:#302441; gap:10px; }
body .nav-brand img { height:42px; box-shadow:none; padding:0; border-radius:0; }
body .brand-title { color:#302441; font-size:15px; letter-spacing:1.4px; }
body .brand-sub { color:#777183; font-size:10px; letter-spacing:2px; }
body .nav-links a { color:#51495f; border:0; border-radius:4px; font-size:14px; padding:9px 14px; transition:background .18s,color .18s; }
body .nav-links a:hover { color:var(--theme-orange); background:var(--orange-tint); transform:none; }
body .nav-links a.active { color:var(--theme-orange); background:var(--orange-tint); font-weight:700; text-decoration:underline; text-underline-offset:5px; }
body .nav-auth .btn-login { color:#51338b; border:1px solid #c6b8d8; background:#fff; border-radius:4px; padding:10px 18px; box-shadow:none; font-size:14px; }
body .nav-auth .btn-login:hover { color:#51338b; background:#f5f1fb; border-color:#b5a0d5; transform:none; box-shadow:none; }
body .nav-profile { background:#f4f0f9; color:#302441; border-color:#e1d9ed; }
body .profile-name { color:#302441; } body .profile-role { color:#666074; }
body .btn-logout-icon { color:#786088; }
body .page-wrapper { padding-top:38px; }
body .header-title { margin-bottom:30px; }
body .header-title h2 { letter-spacing:-.5px; font-size:clamp(24px,3vw,32px); }
body .card,body .info-card,body .search-card,body .breakdown-card,body .chart-card,body .map-card,body .controls-row,body .table-responsive { border:1px solid var(--border-color); box-shadow:var(--box-shadow); border-radius:16px; }
body a.card { transition:transform .2s,border-color .2s,box-shadow .2s; }
body a.card:hover { transform:translateY(-4px); border-color:#c8b5e4; box-shadow:0 12px 28px #51338b0c; }
body input:not([type=checkbox]):not([type=radio]):not([type=file]),body select,body textarea { border-radius:10px; min-height:46px; border-color:#d9d8e4; font-size:16px; }
body input:focus,body select:focus,body textarea:focus { border-color:#8d6bbd; box-shadow:0 0 0 3px #7250b115; }
body .form-step { border:1px solid var(--border-color); box-shadow:var(--box-shadow); border-radius:18px; }
body .btn-primary,body .btn-submit-login { background:#51338b; box-shadow:none; border-radius:10px; }
body .btn-container .btn { border-radius:10px; }
body th { background:#f5f3fa; color:#625674; font-size:13px; letter-spacing:.15px; }
body td { border-bottom-color:#eeedf3; }
body tbody tr:hover { background:#faf8fe; }
body .table-responsive { overflow-x:auto; }
body .modal-box,body .modal-content { border-radius:20px; box-shadow:0 24px 80px #20133326; max-height:90dvh; overflow-y:auto; }
body footer { color:#787385; font-size:12px; padding:28px 20px; }
.eyebrow { color:#9c7dca; font-size:11px; letter-spacing:2.5px; font-weight:700; }
.hero .hero-content { max-width:1240px; text-align:left; margin:auto; display:grid; grid-template-columns:1.15fr 1fr; gap:28px; align-items:center; }
body .hero { --success:#8ed4b1; --danger:#ffb2c2; --theme-orange:var(--orange-on-dark); background:#211535; padding:62px max(24px,calc((100vw - 1240px)/2)) 56px; border-radius:0; margin-bottom:0; box-shadow:none; }
body .hero::before { display:none; }
body .hero h1 { color:#fff; font-size:clamp(32px,4vw,51px); line-height:1.4; letter-spacing:-1px; margin:18px 0; }
body .hero p { color:#c3b8d3; font-size:15px; line-height:1.95; margin-bottom:24px; }
body .hero-badge { color:#e0d5ec; background:none; border:0; border-left:1px solid #a491b9; border-radius:0; box-shadow:none; padding:0 0 0 12px; font-size:13px; margin:0 0 0 12px; letter-spacing:0; }
body .countdown-box { display:flex; flex-direction:column; align-items:flex-start; background:transparent; padding:0 0 0 14px; border:0; border-left:2px solid var(--theme-orange); border-radius:0; box-shadow:none; margin:22px 0; }
body .countdown-title { color:#b8a9cb; font-size:12px; }
body .countdown-timer { color:var(--theme-orange); font:600 19px 'Sarabun',sans-serif; font-variant-numeric:tabular-nums; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
body :is(.btn-cta,.secondary-link) { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:10px 20px; border:1px solid; border-radius:4px; font:600 16px/1.5 'Sarabun',sans-serif; text-decoration:none; transition:background .18s,border-color .18s; }
body .btn-cta { background:var(--orange-on-dark); color:#291809; border-color:var(--orange-on-dark); box-shadow:none; }
body .btn-cta:hover { background:var(--orange-hover-on-dark); border-color:var(--orange-hover-on-dark); transform:none; box-shadow:none; }
body .btn-cta[aria-disabled=true] { background:#3a3048; color:#e0d5ec; border-color:#655970; cursor:not-allowed; }
body .secondary-link { color:#fff; border-color:#a491b9; }
body .secondary-link:hover { background:#ffffff14; }
.orbit-art { width:100%; max-width:500px; justify-self:center; }
.home-page main.container { margin:0 auto 56px; max-width:1280px; padding:42px 20px 0; }
.home-page .section-title { font-size:21px; margin-bottom:20px; }
.home-page .action-grid { gap:20px; }
.home-page a.card { align-items:flex-start; text-align:left; padding:28px; border-radius:8px; box-shadow:none; }
body.home-page a.card:hover { transform:none; box-shadow:none; border-color:#a491b9; }
.home-page .card-icon { width:48px; height:48px; border-radius:6px; margin-bottom:18px; box-shadow:none; }
.home-page .card-icon svg { width:24px; height:24px; }
.home-page .card-title { font-size:19px; margin-bottom:8px; }
.home-page .card-desc { color:#737083; font-size:14px; line-height:1.8; }
.journey { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; border-bottom:1px solid var(--border-color); padding:0 0 32px; margin:0 0 32px; }
.journey-item { display:flex; gap:13px; align-items:flex-start; }
.journey-number { display:grid; place-items:center; flex-shrink:0; width:32px; height:32px; border-radius:50%; color:#775791; background:#eee9f5; font-size:12px; font-weight:700; }
.journey-item h3 { font-size:14px; margin:0 0 4px; } .journey-item p { font-size:12px; color:#777183; margin:0; }
.field-label { display:block; color:#51495e; font-size:13px; font-weight:600; margin-bottom:7px; }
.search-field { flex:1; min-width:0; }
.search-field input { width:100% !important; min-width:0; text-align:left; letter-spacing:0; }
.search-card .search-box { align-items:flex-end; }
.search-help { color:#736a80; font-size:13px; margin:16px 0 0; }
@media(min-width:1101px) { body .nav-left { flex:0 0 auto; } body .nav-mobile-wrapper { flex:1; } body .nav-center { flex:1; } }
@media(max-width:700px) { .hero .hero-content { grid-template-columns:1fr; gap:0; } body .hero { padding:36px 22px 32px; } .orbit-art { max-width:290px; grid-row:2; margin:-5px auto -22px; } body .hero h1 { font-size:32px; } .hero-actions>* { flex:1; white-space:nowrap; } .home-page main.container { padding-top:28px; } .journey { grid-template-columns:1fr; gap:18px; padding-bottom:24px; margin-bottom:26px; } .home-page .action-grid { grid-template-columns:1fr; } body .header-title { margin-bottom:22px; } body .page-wrapper { padding-top:24px; } body .search-card { padding:22px; } .search-card .search-box { flex-direction:column; align-items:stretch; gap:16px; } body .search-box button { width:100%; min-height:48px; } .hero .hero-badge { font-size:11px; } body .modal-box { width:calc(100% - 28px); padding:26px 22px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto !important; } *,*::before,*::after { animation:none !important; transition:none !important; } }

/* Shared components for public pages, registration, and administration.
   Keep these selectors above the page rules in specificity, while letting
   responsive.css own layouts and ux.css own validation/connection states. */
body .page-wrapper>.container {
    border:1px solid var(--border-color);
    border-top:4px solid var(--theme-purple);
    border-radius:var(--border-radius);
    box-shadow:var(--box-shadow);
}
body.contact-page .page-wrapper>.container,
body.status-page .page-wrapper>.container { border:0; background:transparent; box-shadow:none; }
body .header-title { padding-bottom:24px; border-bottom:1px solid var(--border-color); }
body .header-title h2 { color:var(--theme-purple); line-height:1.5; }
body :is(.subtitle,.header-desc) { color:var(--text-muted); font-size:16px; line-height:1.8; }
body :is(.section-title,.breakdown-title,.card-header h3) { color:var(--theme-purple); line-height:1.6; }
body :is(.card-desc,.search-help,.hint,.upload-help,.info-label,.review-label,.last-updated,.search-feedback) { color:var(--text-muted); }
body :is(.field-label,.input-group>label) { font-size:15px; color:var(--text-dark); font-weight:600; }
body :is(.hint,.upload-help,.last-updated) { font-size:13px; }
body :is(.journey-item p,.journey-number) { font-size:14px; }
body :is(.journey-item p,.welcome-links a,.welcome-nav>a:last-child,.welcome-bottom) { color:var(--text-muted); }
body .journey-item h3 { font-size:16px; }
body .journey-number { width:auto; height:auto; background:none; color:var(--theme-orange); font-variant-numeric:tabular-nums; }
body .eyebrow { color:#d3b8f4; font-size:12px; letter-spacing:1.8px; }
body .hero p,body .welcome-hero p { color:#e0d5ec; font-size:16px; }
body .welcome-hero { background:#211535; }
body .welcome-hero h1 span { color:var(--orange-on-dark); }
body .countdown-title { color:#dfd1ee; font-size:14px; }
body .menu-toggle.open { background:var(--orange-tint); border-color:var(--orange-border); }
body .menu-toggle.open span:nth-child(1),body .menu-toggle.open span:nth-child(3) { background:var(--theme-orange); }
body .brand-sub { color:var(--text-muted); letter-spacing:1.2px; font-size:11px; }
body .nav-links a.disabled-link { color:var(--text-muted) !important; opacity:1; }
body .admin-links-row { background:transparent; border:0; box-shadow:none; }
body .nav-links a.admin-link { color:var(--theme-purple); border-radius:4px; }
body .nav-links a.admin-link:hover,body .nav-links a.admin-link.active { color:var(--theme-purple); background:#eee7f7; box-shadow:none; }
body .mobile-section-title { color:var(--theme-purple); border-color:var(--border-color); }
body .card-desc { color:var(--text-muted); }
body :is(.setting-card,.panel,.chart-section,.slider-container) {
    background:var(--surface); border:1px solid var(--border-color);
    border-radius:var(--border-radius); box-shadow:var(--box-shadow);
}
body .setting-card { border-top:3px solid var(--theme-purple); }
body :is(.setting-card.card-orange,.setting-card.card-blue,.setting-card.card-green,.setting-card.card-dark) { border-top-color:var(--theme-purple); }
body :is(.info-card,.map-card,.search-card) { border-top:3px solid var(--theme-purple); }
body :is(.info-card,.map-card,.search-card,.setting-card):hover { transform:none; box-shadow:var(--box-shadow); }
body :is(.breakdown-card,.setting-box,.qualifications-box) { background:var(--surface-soft); border:1px solid var(--border-color); }
body .form-step { border:0; box-shadow:none; }
body input:not([type=checkbox]):not([type=radio]):not([type=file]),
body select,body textarea {
    background:var(--surface); border:1px solid #bcb2ca; color:var(--text-dark);
    box-shadow:none; line-height:1.5;
}
body input::placeholder,body textarea::placeholder { color:#756c80; opacity:1; }
body input:focus,body select:focus,body textarea:focus {
    outline:2px solid var(--theme-purple); outline-offset:2px;
    border-color:var(--theme-purple); box-shadow:0 0 0 4px #51338b12;
}
body :is(input[type=checkbox],input[type=radio]) { accent-color:var(--theme-purple); }
body input[type=file] { background:var(--surface-soft); border:1px dashed #a99abc; padding:12px; border-radius:10px; font-size:14px; }
body input[type=file]::file-selector-button { font:inherit; font-weight:600; padding:10px 14px; margin-right:12px; background:#eee7f7; color:var(--theme-purple); border:1px solid #cfc0e2; border-radius:8px; cursor:pointer; }
body :is(.btn,.btn-primary,.btn-submit,.btn-submit-login,.btn-save-all,.btn-save-modal,.btn-submit-edit,.btn-add,.btn-smart,.btn-view-slip,.btn-reupload,.tab-btn,.btn-action,.btn-refresh,.btn-page,.btn-save-inline,.btn-cancel,.btn-cancel-edit,.btn-edit,.btn-delete,.ux-button) {
    border-radius:10px; font-family:inherit; font-weight:600; line-height:1.5;
    box-shadow:none; transition:background .18s,border-color .18s,color .18s;
}
body :is(.btn-primary,.btn-submit,.btn-submit-login,.btn-save-all,.btn-save-modal,.btn-submit-edit,.btn-add,.btn-smart,.btn-view-slip,.search-box button,.btn-reupload) {
    background:var(--theme-purple); color:#fff; border:1px solid var(--theme-purple);
    box-shadow:none; border-radius:10px;
}
body :is(.btn-primary,.btn-submit,.btn-submit-login,.btn-save-all,.btn-save-modal,.btn-submit-edit,.btn-add,.btn-smart,.btn-view-slip,.search-box button,.btn-reupload):hover:not(:disabled) {
    background:var(--theme-purple-hover); color:#fff; transform:none; box-shadow:none;
}
body :is(.btn-outline,.btn-cancel,.btn-cancel-edit,.btn-refresh,.btn-page,.btn-save-inline) { background:#fff; color:var(--theme-purple); border:1px solid #c6b8d8; }
body :is(.btn-outline,.btn-cancel,.btn-cancel-edit,.btn-refresh,.btn-page,.btn-save-inline):hover:not(:disabled) { background:#eee7f7; color:var(--theme-purple-hover); border-color:#a38abc; transform:none; box-shadow:none; }
body .tab-btn { background:#f2eff7; color:#5c526b; border:1px solid var(--border-color); font-size:16px; }
body .tab-btn.active { background:var(--theme-purple); color:#fff; border-color:var(--theme-purple); box-shadow:none; }
body .tab-btn:hover:not(.active) { background:#e9e0f4; color:var(--theme-purple); }
body :is(button,.btn):disabled { background:#e8e4ee; color:#6b6278; border-color:#d6cede; opacity:1; box-shadow:none; transform:none; }
body .year-badge,body .ann-date { background:var(--orange-tint); color:var(--theme-orange); border:1px solid var(--orange-border); box-shadow:none; border-radius:4px; }
body :is(.badge,.status-badge) { font-size:14px; line-height:1.6; padding:7px 12px; border-radius:8px; }
body :is(.badge-wait,.status-wait) { color:var(--theme-orange); background:var(--orange-tint); border:1px solid var(--orange-border); }
body :is(.badge-success,.status-pass) { color:#20613f; background:#eaf6ef; border:1px solid #a9d3b9; }
body :is(.badge-danger,.status-fail) { color:#a12640; background:#fff0f3; border:1px solid #e7afbc; }
body .step-item.active .step-circle { background:var(--theme-purple); border-color:var(--theme-purple); box-shadow:0 0 0 5px #51338b15; transform:none; }
body .progress-bar { background:var(--theme-purple); }
body .step-circle { box-shadow:none; }
body .step-title { color:var(--text-muted); }
body .stat-card { background:#fff; color:var(--text-dark); border:1px solid var(--border-color); border-top:4px solid var(--stat-accent,var(--theme-purple)); border-radius:16px; box-shadow:var(--box-shadow); }
body .stat-card.bg-purple { --stat-accent:var(--theme-purple); background:#f2ecfa; }
body .stat-card.bg-orange { --stat-accent:var(--theme-orange); background:var(--orange-tint); }
body .stat-card.bg-success { --stat-accent:#23734b; background:#edf7f0; }
body .stat-card.bg-danger { --stat-accent:#b52d49; background:#fff0f3; }
body .stat-card.bg-info { --stat-accent:#28619a; background:#eef4fb; }
body .stat-number { color:var(--stat-accent,var(--theme-purple)); font-size:clamp(36px,4vw,52px); font-variant-numeric:tabular-nums; }
body .stat-title { color:var(--text-dark); font-size:16px; font-weight:600; }
body .stat-bg-icon { opacity:.08; }
body .stat-bg-icon svg { fill:var(--stat-accent,var(--theme-purple)); }
body .stat-card.clickable:hover { transform:translateY(-2px); box-shadow:0 8px 24px #30204010; }
body th { background:#eee8f6; color:#443254; font-size:14px; font-weight:700; padding-top:16px; padding-bottom:16px; border-bottom:1px solid #cfc1de; }
body td { color:var(--text-dark); font-size:15px; line-height:1.7; border-bottom-color:var(--border-color); }
body tbody tr:nth-child(even) { background:#faf9fc; }
body tbody tr:hover { background:#f1ebf8; }
body .table-scroll-hint { color:var(--text-muted); font-size:13px; }
body :is(.modal-header,.modal-footer) { border-color:var(--border-color); }
body .swal2-popup { font-family:inherit; border-radius:18px; color:var(--text-dark); }
body .swal2-styled.swal2-confirm { background:var(--theme-purple) !important; border-radius:10px; min-height:44px; box-shadow:none !important; }
body .swal2-styled.swal2-cancel { background:#eee8f6 !important; color:var(--theme-purple) !important; border-radius:10px; min-height:44px; }
body footer { color:var(--text-muted); font-size:13px; border-top:1px solid var(--border-color); }
body :is(a,button,input,select,textarea,[tabindex]):focus-visible { outline:3px solid var(--theme-purple); outline-offset:3px; }
body :is(.hero,.welcome-hero) :is(a,button):focus-visible { outline-color:var(--orange-on-dark); }
