body{background:inherit}.directory-page{max-width:1260px;margin:auto;padding:28px}.directory-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}.directory-header h1{margin:4px 0;font-size:28px;color:var(--color-text)}.eyebrow{margin:0;color:#3287a2;font-weight:600}.muted{color:var(--color-text-muted);font-size:14px}.people-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:20px}.person-card{position:relative;overflow:hidden;border:1px solid var(--color-border);border-radius:22px;background:rgba(255,255,255,.94);box-shadow:0 10px 28px rgba(43,77,108,.07)}.person-portrait{height:230px;width:100%;object-fit:cover;object-position:center 25%;background:#eaf1f8}.person-initial{height:230px;display:grid;place-items:center;background:linear-gradient(140deg,#e8f4fc,#d9e7f4);font-size:62px;color:#4482b2}.person-details{padding:20px}.person-details h2{font-size:20px;margin:0 0 8px;overflow-wrap:anywhere}.person-details p{margin:6px 0;color:var(--color-text-muted);overflow-wrap:anywhere}.person-details .homeroom{display:inline-block;padding:5px 10px;background:#eef5fb;color:#476f90;border-radius:9px;font-size:14px}.edit-person{margin-top:12px;width:100%}.empty-state{grid-column:1/-1;text-align:center;padding:56px 24px;border:1px dashed var(--color-border);border-radius:22px;background:rgba(255,255,255,.7);color:var(--color-text-muted)}dialog{width:min(540px,calc(100% - 28px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid var(--color-border);border-radius:22px;box-shadow:0 24px 80px #193b6240;box-sizing:border-box;overflow:auto}dialog::backdrop{background:#182c4666;backdrop-filter:blur(4px)}.dialog-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:20px}.dialog-header h2{margin:0;font-size:23px}.close-dialog{width:44px;height:44px;border:0;border-radius:12px;background:#edf2f7;font-size:26px;cursor:pointer}.photo-editor{display:flex;gap:16px;align-items:center;margin:20px 0}.photo-editor img,#photoPlaceholder{width:86px;height:100px;object-fit:cover;border-radius:14px;background:#edf4fb;flex-shrink:0}#photoPlaceholder{display:grid;place-items:center;font-size:26px;color:#477d9e}.photo-editor input{width:100%;font-size:14px}.photo-editor p{margin:7px 0}.field{margin:14px 0}.field label{display:block;margin-bottom:6px}.field input,.field select{width:100%;box-sizing:border-box;min-height:44px}.field input[readonly]{background:#f0f4f8}dialog footer{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}#pageError,#formError{color:#ac3434;background:#fff0ee;border-radius:12px;padding:12px}[hidden]{display:none!important}@media(max-width:600px){.directory-page{padding:16px}.directory-header{align-items:flex-start;flex-direction:column;margin-bottom:18px}.directory-header h1{font-size:24px}.people-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.person-portrait,.person-initial{height:170px}.person-details{padding:14px}.person-details h2{font-size:18px}.person-details p{font-size:14px}.person-details .homeroom{padding:4px 7px;font-size:13px}.photo-editor{align-items:flex-start}dialog{padding:18px}.field input,.field select{font-size:16px}}@media(max-width:360px){.people-grid{grid-template-columns:1fr}.person-portrait,.person-initial{height:240px}}

.directory-section{margin-bottom:28px}.directory-section>h2{font-size:19px;margin:0 0 16px;color:#466b8d}.heads-grid{display:flex;justify-content:center;gap:20px;flex-wrap:wrap}.heads-grid>.person-card{width:280px;max-width:100%;border-color:#98bedc;box-shadow:0 12px 32px #2875ab18}.heads-grid>.empty-state{width:100%;box-sizing:border-box;padding:24px}.heads-grid .empty-state .btn{margin:12px auto 0;display:block}.head-field{padding:12px;background:#eff6fc;border-radius:12px}.head-field input{width:20px;min-height:20px;margin-right:8px;vertical-align:middle}.head-field label{display:flex;align-items:center}.head-field p{margin:6px 0 0}.heads-grid>.person-card .person-details:before{content:'หัวหน้าฝ่าย';display:inline-block;font-size:12px;color:#326d9b;background:#e9f4fc;padding:4px 9px;border-radius:8px;margin-bottom:10px}body.administration-directory .heads-grid>.person-card .person-details:before{content:'ผู้อำนวยการโรงเรียน'}
