/* =====================================================================
   รอบ 73: ใบสมัครเรียนออนไลน์ (prefix adm- / ws-apply)
   - หน้าสาธารณะ /apply, /apply/status อยู่ใน .ws ของ WebsiteLayout (สว่างเสมอ ใช้ตัวแปร --ws-*)
   - หน้าพนักงาน /school/admissions ใช้ตัวแปรของ app.css (รองรับโหมดมืด)
   - มือถือ 390px ห้ามเลื่อนแนวนอน
   ===================================================================== */

/* ---------- หัวสั้น (โรงเรียนที่ไม่มีเว็บไซต์) ---------- */
.ws .adm-head { background: var(--ws-surface); border-bottom: 1px solid var(--ws-line); }
.ws .adm-head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.ws .adm-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 200px; }
.ws .adm-brand .ws-logo-txt { background: var(--ws-accent); }
.ws .adm-lang { margin-top: 0; align-self: center; }

/* ---------- ฟอร์ม / การ์ด ---------- */
.ws .adm-sec { padding-top: clamp(24px, 5vw, 48px); }
.ws .adm-intro { margin: 0 0 18px; }
.ws .adm-intro .ws-h2 { margin-bottom: 4px; }
.ws .adm-year { margin: 0 0 10px; font-weight: 700; color: var(--ws-accent-strong); }
.ws .adm-form { gap: 18px; }
.ws .adm-fs { margin: 0; padding: 16px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: var(--ws-surface); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ws .adm-fs legend { padding: 0 6px; font-weight: 700; color: var(--ws-ink); }
.ws .adm-form select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--ws-line); border-radius: 12px;
  background: #FFFFFF; color: var(--ws-ink); font: inherit; font-size: 16px; font-weight: 400; max-width: 100%;
}
.ws .adm-form select:focus { outline: 2px solid var(--ws-accent); outline-offset: 0; border-color: transparent; }
.ws .adm-form input[type="file"] { min-height: 0; padding: 8px; background: var(--ws-bg-alt); }
.ws .adm-form .ws-field { min-width: 0; }
.ws .adm-hint { margin: 0; font-size: .82rem; font-weight: 400; color: var(--ws-muted); }
.ws .adm-more { border-top: 1px dashed var(--ws-line); padding-top: 10px; }
.ws .adm-more summary { cursor: pointer; font-weight: 600; color: var(--ws-accent-strong); margin-bottom: 12px; }
.ws .adm-consent { padding: 14px 16px; border-radius: var(--ws-radius); background: var(--ws-accent-tint); }
.ws .adm-privacy { margin: 0 0 10px; font-size: .88rem; color: var(--ws-muted); }
.ws .adm-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; }
.ws .adm-check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--ws-accent); }
.ws .adm-submit { align-self: stretch; justify-content: center; min-height: 52px; font-size: 1.05rem; }
@media (min-width: 560px) { .ws .adm-submit { align-self: flex-start; } }

.ws .adm-card { padding: 22px; border-radius: var(--ws-radius-lg); background: var(--ws-surface); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow); overflow-wrap: anywhere; }
.ws .adm-done { text-align: center; }
.ws .adm-done-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #E7F6EC; color: #1C6B3A; margin-bottom: 10px; }
.ws .adm-no-label { margin: 8px 0 0; color: var(--ws-muted); }
.ws .adm-no { margin: 2px 0 6px; font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: .04em; color: var(--ws-accent-strong); }
.ws .adm-pre { white-space: pre-line; }
.ws .adm-done-act { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.ws .adm-closed-track { margin: 14px 0 0; }

/* ---------- ติดตามสถานะ ---------- */
.ws .adm-result { margin: 0 0 18px; }
.ws .adm-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ws .adm-result-no { font-weight: 800; font-size: 1.15rem; }
.ws .adm-dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.ws .adm-dl dt { color: var(--ws-muted); }
.ws .adm-dl dd { margin: 0; font-weight: 600; }
.ws .adm-result-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--ws-bg-alt); }
.ws .adm-track-new { margin-top: 16px; }

/* ---------- ป้ายสถานะ (ใช้ทั้งหน้าสาธารณะและพนักงาน) ---------- */
.adm-st { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; background: #EEF0F3; color: #3D4350; }
.adm-st-new { background: #FFF4D6; color: #6B4A00; }
.adm-st-reviewing { background: #E6F0FB; color: #1D4E89; }
.adm-st-interview { background: #EFE7FB; color: #5B2D91; }
.adm-st-accepted, .adm-st-enrolled { background: #E7F6EC; color: #1C6B3A; }
.adm-st-waitlist { background: #FDF0D8; color: #7A4B00; }
.adm-st-rejected { background: #FBE8E6; color: #B3261E; }
.adm-st-withdrawn { background: #EEF0F3; color: #5B6170; }
.adm-dup { display: inline-flex; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #FBE8E6; color: #B3261E; }
/* รอบ 98: หลังร้านโหมดมืด — ป้ายสีพาสเทลสว่างจ้าบนพื้นมืด → ใช้สีของธีม (หน้าสาธารณะไม่มี data-theme จึงเหมือนเดิม) */
html[data-theme="dark"] .adm-st { background: var(--chip); color: var(--ink); }
html[data-theme="dark"] .adm-st:is(.adm-st-new, .adm-st-waitlist) { background: var(--warn-soft); color: var(--warn-text); }
html[data-theme="dark"] .adm-st.adm-st-reviewing { background: var(--info-soft); color: var(--info-text); }
html[data-theme="dark"] .adm-st.adm-st-interview { background: color-mix(in srgb, #8B5CF6 22%, var(--surface)); color: #C9B6F7; }
html[data-theme="dark"] .adm-st:is(.adm-st-accepted, .adm-st-enrolled) { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] :is(.adm-st.adm-st-rejected, .adm-dup) { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .adm-st.adm-st-withdrawn { background: var(--chip); color: var(--muted); }

/* ---------- บล็อกเว็บไซต์ "สมัครเรียน" ---------- */
.ws .ws-apply { padding: clamp(20px, 4vw, 32px); border-radius: var(--ws-radius-lg); background: var(--ws-surface); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow); }
.ws .ws-apply-year { margin: 12px 0 8px; font-weight: 700; }
.ws .ws-apply-grades { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.ws .ws-apply-grades li { padding: 4px 12px; border-radius: 999px; background: var(--ws-accent-soft); color: var(--ws-accent-strong); font-weight: 700; font-size: .9rem; }
.ws .ws-apply-act { margin: 16px 0 0; }

/* ---------- หน้าพนักงาน ---------- */
.adm-head-act { display: flex; gap: 8px; align-items: center; }
.adm-status-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; max-width: 100%; }
.adm-schip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; }
.adm-schip em { font-style: normal; font-weight: 700; color: var(--muted); }
.adm-schip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.adm-schip.on em { color: var(--brand-strong); }
.adm-table .adm-row-new td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.adm-table td { overflow-wrap: anywhere; }

.adm-detail { display: flex; flex-direction: column; gap: 14px; }
.adm-d-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-d-enrolled { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-d-warn { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink); overflow-wrap: anywhere; }
.adm-d-sec { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.adm-d-sec h3 { margin: 0; font-size: 1rem; }
.adm-d-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.adm-d-row .field { margin: 0; min-width: 0; flex: 1 1 160px; }
.adm-d-row .adm-grow { flex: 2 1 200px; }
.adm-d-row select, .adm-d-row input { width: 100%; max-width: 100%; }
.adm-d-wa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-d-enrol { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--ok-soft); }
.adm-detail .adm-dl { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.adm-detail .adm-dl dt { color: var(--muted); }
.adm-detail .adm-dl dd { margin: 0; overflow-wrap: anywhere; }
.adm-d-health { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); }
.adm-d-health p, .adm-d-note p { margin: 4px 0 0; }
.adm-d-sec textarea { width: 100%; max-width: 100%; }
.adm-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.adm-files a { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; font-size: .82rem; }
.adm-files img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--chip); }
.adm-events { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.adm-events li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.adm-enrol-next { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }

.adm-set { display: flex; flex-direction: column; gap: 14px; }
.adm-set-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.adm-set-head h2 { margin: 0 0 4px; }
.adm-set-state { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.adm-set-state .is-on { color: var(--ok); }
.adm-set-state .is-off { color: var(--muted); }
.adm-set-fs { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.adm-set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.adm-set-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.adm-set-grid .field, .adm-set-two .field { margin: 0; min-width: 0; }
.adm-set-two textarea, .adm-set-fs textarea { width: 100%; max-width: 100%; }
.adm-set-h { margin: 6px 0 0; font-size: .98rem; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem; }
.adm-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.adm-chip input { accent-color: var(--brand); }

@media (max-width: 600px) {
  .adm-set-state { align-items: flex-start; text-align: left; }
  .adm-detail .adm-dl { grid-template-columns: minmax(0, 1fr); }
  .adm-detail .adm-dl dd { margin-bottom: 6px; }
}
