/* =====================================================
   หน้าเข้าสู่ระบบ (login.php)
   ===================================================== */
.login-page {   /* จัดการ์ดกึ่งกลางแนวตั้ง เต็มความสูงจอที่เหลือ → เปิดมาพอดีจอ ไม่ต้องเลื่อน */
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));
    padding: 40px 20px 60px; overflow: hidden;   /* จัดการ์ดกึ่งกลางแนวตั้ง · ขอบล่างมากกว่าบนเล็กน้อย */
}
/* หน้าล็อคอิน: sticky footer → 100% การ์ดอยู่กึ่งกลาง footer ใต้ขอบจอพอดี · ซูม/ย่อจอ footer ตามมาเสมอ */
body:has(.login-page) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body:has(.login-page) .site-main { flex: 1 0 auto; display: flex; flex-direction: column; }
body:has(.login-page) .login-page { flex: 1 0 auto; min-height: 0; }
body:has(.login-page) .site-footer { flex-shrink: 0; }
.login-bg { display: none; }   /* ไม่ใช้ภาพถ่ายพื้นหลังแล้ว (เหลือลายเพชรอย่างเดียว) */
.login-band {   /* พื้นหลังลายเพชรชมพู (login-band.jpg) เต็มพื้นที่ + ชั้นชมพูบาง ๆ */
    position: absolute; inset: 0; z-index: 1;
    background-image:
        linear-gradient(120deg, rgba(247, 115, 154, .55), rgba(251, 149, 184, .45) 60%, rgba(239, 90, 136, .5)),
        url('../img/login-band.jpg');
    background-size: cover; background-position: center;
}

.login-card {
    position: relative; z-index: 2; width: min(470px, 100%);
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(120,20,60,.22);
}
.login-card-head {   /* โลโก้ + ชื่อระบบ รวมอยู่ในหัวการ์ด (ประหยัดพื้นที่) */
    background: linear-gradient(120deg, var(--pink-400), var(--pink-300));
    color: #fff; text-align: center; padding: 26px 24px 22px;
}
.login-card-head .login-logo {
    width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%;
    background: #fff; padding: 4px; box-shadow: 0 6px 18px rgba(120,20,60,.25);
}
.login-card-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 700; color: #fff; line-height: 1.3; }
.login-card-head p  { margin: 0; font-family: var(--font-head); font-size: 16px; font-weight: 400; opacity: .95; }
.login-card-body { padding: 26px 32px 30px; }

.form-group { margin-bottom: 22px; }
.form-label { display: block; font-family: var(--font-head); font-weight: 500; font-size: 16px; margin-bottom: 8px; color: var(--ink); }
.input-wrap { position: relative; }
.input-wrap > svg.lead {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; fill: var(--ink-soft);
}
.form-control {
    width: 100%; height: 54px; padding: 0 16px;
    border: 1px solid #dcd5df; border-radius: 10px; background: #f7f7f9;
    font-family: var(--font-body); font-size: 17px; color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control::placeholder { color: #9a929f; }
.form-control:focus { outline: none; border-color: var(--pink-400); background-color: #fff; box-shadow: 0 0 0 3px rgba(247, 115, 154, .14); }   /* เส้นขอบชมพู 1px + วงเรืองชมพูอ่อน 5px · ใช้ background-color ไม่ใช่ background → ไอคอนลูกศรของ select ไม่หาย */
/* ช่องที่มีไอคอนนำหน้า / ปุ่มแสดงรหัสผ่าน ต้องเว้นที่ให้ */
.input-wrap svg.lead ~ .form-control { padding-left: 46px; }
.input-wrap .form-control:has(~ .toggle-password),
.input-wrap .form-control.has-toggle { padding-right: 48px; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer;
    display: grid; place-items: center; border-radius: 8px; color: var(--ink-soft);
}
.toggle-password:hover { background: var(--pink-50); color: var(--pink-600); }
.toggle-password svg { width: 22px; height: 22px; fill: currentColor; }

.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; font-size: 15px; }
.form-check { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; }
.form-check input { width: 18px; height: 18px; accent-color: var(--pink-500); }

.btn-block { width: 100%; justify-content: center; height: 54px; font-size: 18px; border-radius: 10px; padding: 0 20px; }

.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
    font-size: 15px; margin-bottom: 20px;
}
.alert svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; fill: currentColor; }
.alert-error { background: #fff0f2; color: #b3263f; border: 1px solid #ffd0d8; }
.alert-success { background: #eefbf1; color: #1f7a3a; border: 1px solid #c8efd3; }

/* ---------- การ์ดล็อกอิน/ลงทะเบียนแบบเรียบ: การ์ดขาวล้วน โลโก้ + หัวข้อใหญ่ ปุ่มไล่สีทรงแคปซูล ลิงก์ข้อความด้านล่าง ---------- */
.login-plain { border-radius: 26px; box-shadow: 0 24px 70px rgba(120, 20, 60, .18); }
.login-plain .login-card-head { background: #fff; color: var(--ink); padding: 30px 32px 4px; }
.login-plain .login-card-head .login-logo { width: 82px; height: 82px; padding: 0; box-shadow: none; background: transparent; margin-bottom: 12px; }
.login-plain .login-card-head h1 { font-size: 30px; font-weight: 800; color: #2a1f3d; line-height: 1.2; margin-bottom: 6px; letter-spacing: .2px; }
.login-plain .login-card-head p { font-size: 15.5px; color: var(--pink-700); opacity: 1; }
.login-plain .login-card-body { padding: 18px 40px 24px; }
.login-plain .form-group { margin-bottom: 16px; }
.login-plain .form-label { font-weight: 600; font-size: 15.5px; margin-bottom: 6px; }
.login-plain .form-control { height: 52px; border-radius: 10px; background-color: #fff; border-color: #e6dfe8; font-size: 16px; }
.login-plain .form-control::placeholder { color: #a9a1ae; }
.login-plain .form-control:focus, .reg-card-form .form-control:focus { border-color: var(--pink-400); box-shadow: 0 0 0 3px rgba(247, 115, 154, .14); }   /* กันสีขอบเทาของการ์ดทับสีขอบตอนโฟกัส · วงเรืองบางลง */
.login-plain .toggle-password { right: 14px; color: var(--pink-500); }
.btn-pill { height: 54px; border-radius: 999px; font-size: 18px; font-weight: 700; margin-top: 6px; background: linear-gradient(100deg, var(--pink-700), var(--pink-500) 55%, var(--pink-400)); box-shadow: 0 12px 26px rgba(217, 64, 111, .32); }
.btn-pill:hover { background: linear-gradient(100deg, var(--pink-700), var(--pink-600) 55%, var(--pink-500)); box-shadow: 0 14px 30px rgba(217, 64, 111, .38); }
.login-plain .login-foot { margin: 16px 0 0; font-size: 15.5px; color: var(--ink-soft); }
.login-plain .login-foot a { color: var(--pink-700); font-weight: 600; }
.login-plain .login-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-plain .login-foot-sub { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.login-plain .alert { border-radius: 14px; }
/* ---------- หน้าลงทะเบียน (register.php) — หน้าเรียบ ๆ พื้นชมพูจาง: ลิงก์ย้อนกลับ, หัวข้อใหญ่, การ์ดเลือกบทบาท / ฟอร์มขาว ---------- */
.reg-page { background: #fbf6f8; min-height: calc(100vh - var(--header-h)); padding: 44px 0 70px; }
.reg-container { width: min(1180px, 100% - 40px); }
.reg-back { display: inline-block; margin-bottom: 26px; font-family: var(--font-head); font-weight: 500; font-size: 16px; color: var(--pink-700); }
.reg-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.reg-title { margin: 0 0 8px; font-size: 38px; font-weight: 800; color: #2a1f3d; line-height: 1.15; }
.reg-sub { margin: 0 0 30px; font-family: var(--font-head); font-size: 17px; color: var(--ink-soft); }
.reg-sub b { color: var(--ink); font-weight: 600; }
.reg-sub a { color: var(--pink-700); font-weight: 600; } .reg-sub a:hover { text-decoration: underline; text-underline-offset: 3px; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.role-pick { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 46px 30px 40px; border-radius: 20px; border: 1px solid #efe6ea; background: #fff; color: var(--ink); box-shadow: 0 6px 20px rgba(120, 20, 60, .05); transition: transform .15s, box-shadow .15s, border-color .15s; }
.role-pick:hover { transform: translateY(-4px); border-color: var(--pink-300); box-shadow: 0 18px 40px rgba(181, 47, 89, .14); }
.role-emoji { display: block; font-size: 60px; line-height: 1; margin-bottom: 16px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif; }
.role-pick strong { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #2a1f3d; }
.role-pick small { font-size: 15px; line-height: 1.6; color: var(--ink-soft); max-width: 340px; }
@media (max-width: 900px) { .role-grid { grid-template-columns: 1fr; width: 100%; } }   /* แท็บเล็ต/มือถือ: เรียงลงมา 3 แถว เต็มความกว้างจอ */
.reg-foot { margin: 28px 0 0; text-align: center; font-size: 15px; color: var(--ink-soft); }
.reg-foot a { color: var(--pink-700); font-weight: 600; } .reg-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.reg-card-form { padding: 36px 44px 34px; border-radius: 20px; border: 1px solid #efe6ea; box-shadow: 0 6px 20px rgba(120, 20, 60, .05); }
.reg-photo { display: flex; align-items: center; gap: 22px; margin-bottom: 30px; }
.reg-avatar { position: relative; width: 112px; height: 112px; flex: 0 0 112px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #fbeef3; border: 4px solid #f6dfe7; color: #e0a6bb; }
.reg-avatar svg { fill: currentColor; }
/* รูปตัวอย่าง: ยึดเต็มวงกลมเสมอ ครอปจากกึ่งกลาง (เหมือนหน้าแก้ไขโปรไฟล์ — iOS Safari คำนวณ height:100% ในกริดผิด จึงใช้ absolute) */
.reg-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }
.reg-photo .form-label { margin-bottom: 8px; }
.reg-h2 { margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #ece4e8; font-family: var(--font-head); font-weight: 700; font-size: 19px; color: #2a1f3d; }
.reg-card-form .form-grid + .reg-h2 { margin-top: 34px; }
.reg-form-split { display: flex; flex-direction: column; gap: 20px; }   /* หน้าสมัคร: แยกเป็นการ์ดตามหัวข้อ ฟอร์มเดียว ปุ่มเดียว */
.reg-form-split .reg-card-form { margin: 0; }
.reg-card-form .form-label { font-weight: 600; font-size: 15.5px; }
.reg-card-form .form-control { height: 52px; border-radius: 10px; background-color: #fff; border-color: #e6dfe8; font-size: 16px; }   /* background-color ไม่ใช่ background → ลูกศรของ select ไม่ซ้ำ */
.reg-card-form .form-control::placeholder { color: #a9a1ae; }
.reg-card-form .name-row { grid-template-columns: 200px 1fr 1fr; }
.reg-card-form .form-control.is-locked { background-color: #f6f4f7; color: var(--ink-soft); font-weight: 600; letter-spacing: 2px; cursor: default; }
.reg-pw-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; background: #f1edff; border: 1px solid #ddd3ff; color: #3d2f7a; font-size: 15px; line-height: 1.7; }
.reg-pw-note svg { flex: 0 0 22px; fill: #7c4dff; margin-top: 3px; }
.reg-pw-note b { color: #5b3fd4; font-weight: 700; }
.reg-note { display: flex; gap: 8px; align-items: flex-start; margin: 26px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff7e6; color: #8a5a00; font-size: 14px; line-height: 1.55; }
.reg-note svg { fill: currentColor; flex: 0 0 18px; margin-top: 2px; }
.reg-actions { margin-top: 26px; }
.reg-actions .btn-primary svg { fill: currentColor; }
.login-foot { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--ink-soft); }
.login-foot a { font-family: var(--font-head); }

@media (max-width: 600px) {
    /* หน้า login บนมือถือ: การ์ดยืดสูงขึ้น ขอบล่างมากกว่าบน (แทบไม่เห็น footer) */
    .login-page { padding: 34px 16px 58px; }   /* เว้นบน-ล่างมากขึ้น · ล่างมากกว่าบน */
    .login-card { border-radius: 22px; }
    .login-card-head { padding: 22px 18px 18px; }
    .login-card-head .login-logo { width: 76px; height: 76px; margin-bottom: 8px; }
    .login-card-head h1 { font-size: clamp(18px, 5.2vw, 22px); }
    .login-card-head p  { font-size: 14.5px; }
    .login-card-body { padding: 22px 20px 24px; }
    .login-card-body .form-group { margin-bottom: 18px; }
    .login-card-body .form-label { font-size: 15.5px; margin-bottom: 7px; }
    .login-card-body .form-control { height: 50px; font-size: 16px; border-radius: 10px; }   /* 16px กัน iOS ซูมอัตโนมัติ */
    .login-card-body .input-wrap > svg.lead { left: 14px; width: 18px; height: 18px; }
    .login-card-body .input-wrap svg.lead ~ .form-control { padding-left: 42px; }
    .login-card-body .btn-block { height: 50px; font-size: 17px; margin-top: 4px; }
    .login-foot { margin-top: 16px; font-size: 13.5px; }
    .reg-page { padding: 22px 0 44px; } .reg-container { width: min(1180px, 100% - 28px); } .reg-title { font-size: 30px; } .role-grid { grid-template-columns: 1fr; gap: 14px; } .role-pick { padding: 26px 18px 22px; } .role-emoji { font-size: 48px; margin-bottom: 10px; }
    .reg-card-form { padding: 22px 16px; } .reg-card-form .name-row { grid-template-columns: 1fr; }
    /* รูปโปรไฟล์บนมือถือ: วงกลมสูงพอดีกับบล็อกข้อความ (หัวข้อ + ปุ่มเลือกไฟล์ + คำอธิบาย) */
    .reg-photo { gap: 18px; align-items: center; margin-bottom: 26px; }
    .reg-avatar { width: 100px; height: 100px; flex-basis: 100px; } .reg-avatar svg { width: 58px; height: 58px; }
    .reg-photo > div:last-child { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
    .reg-photo .form-label { font-size: 16px; margin-bottom: 6px; }
    .reg-photo .form-file { display: inline-block; width: auto; max-width: 100%; text-align: left; font-size: 14px; }
    .reg-photo .form-file::file-selector-button { display: inline-block; width: auto; padding: 6px 10px; margin: 0 6px 0 0; font-size: 13px; }
    .reg-photo .form-file { font-size: 13px; align-self: flex-start; }
    .reg-photo .form-hint { font-size: 13px; margin-top: 6px; }
    .reg-h2 { font-size: 17px; } .reg-sub { font-size: 15.5px; } .reg-back { margin-bottom: 18px; }
    .reg-card-form .form-grid { gap: 14px; }
    .reg-pw-note { padding: 12px 14px; font-size: 14px; }
    .reg-actions { flex-direction: row; justify-content: flex-end; gap: 10px; } .reg-actions .btn { width: auto; }
    /* การ์ด login มือถือ: ยืดบน-ล่างให้โปร่งขึ้น ช่องกรอกสูงขึ้น แต่คุมให้พอดีจอ (เห็นครบถึงลิงก์ลงทะเบียน) */
    .login-plain .login-card-head { padding: 26px 24px 6px; } .login-plain .login-card-head h1 { font-size: 27px; margin-bottom: 6px; } .login-plain .login-card-head p { font-size: 15px; }
    .login-plain .login-card-head .login-logo { width: 74px; height: 74px; margin-bottom: 10px; }
    .login-plain .login-card-body { padding: 22px 24px 26px; }
    .login-plain .form-group { margin-bottom: 16px; }
    .login-plain .form-label { font-size: 15.5px; margin-bottom: 7px; }
    .login-plain .login-card-body .form-control { height: 54px; border-radius: 13px; font-size: 16px; }
    .login-plain .btn-pill { height: 54px; margin-top: 8px; }
    .login-plain .login-foot { margin-top: 16px; font-size: 14.5px; }
    .login-plain .login-foot-sub { margin-top: 4px; }   /* บรรทัดคำอธิบายชิดกับบรรทัดลงทะเบียนมากขึ้น */
}

/* ---------- หน้าหลังล็อกอิน (dashboard ตัวอย่าง) ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head h1 { font-size: 30px; margin: 0; }
.dash-head p { margin: 0; color: var(--ink-soft); }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- โปรไฟล์ของฉัน (me.php) ---------- */
.me-section { background: #f4f5f9; }
.me-head { margin-bottom: 22px; }
.me-page-title { display: flex; align-items: center; gap: 12px; font-size: 28px; margin: 0 0 4px; }
.me-page-icon {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--pink-500), var(--pink-400)); color: #fff; box-shadow: 0 4px 14px rgba(239, 90, 136, .28);
}
.me-page-icon svg { fill: currentColor; }
.me-head .btn-light { border-color: var(--line); }
.me-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.me-side { text-align: center; padding: 36px 26px 30px; }
.me-photo {
    width: 190px; height: 190px; margin: 0 auto 22px; border-radius: 50%; overflow: hidden;
    background: var(--pink-50); color: var(--pink-300); display: grid; place-items: center;
    border: 5px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(120, 20, 60, .14);
}
.me-photo { position: relative; }
.me-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }
.me-photo svg { width: 90px; height: 90px; fill: currentColor; }
.me-name { font-size: 25px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; overflow-wrap: anywhere; }
.me-dept { font-size: 16px; color: var(--ink-soft); }
.me-role { font-size: 15.5px; color: var(--muted); margin-top: 4px; }
.me-divider { height: 1px; background: var(--line); margin: 24px 0 22px; }
.me-actions { display: flex; flex-direction: column; gap: 10px; }
.me-actions .btn { justify-content: center; width: 100%; }
.me-actions .btn-cancel { justify-content: center; }
.me-actions .btn svg { fill: currentColor; }
.me-main { padding: 26px 30px 30px; }
.me-sec + .me-sec { margin-top: 34px; }   /* ทุกส่วนอยู่ในกรอบเดียว เว้นช่องว่างระหว่างส่วน */
.sec-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.sec-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 21px; font-weight: 700; color: var(--pink-700); }   /* หัวข้อสีชมพูเข้มตามธีม */
.sec-title::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: var(--pink-500); flex: 0 0 auto; }
.sec-edit {   /* ปุ่มดินสอเล็ก ๆ ในกรอบสี่เหลี่ยมมนพื้นชมพูอ่อน */
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px;
    background: #fde9f0; color: var(--pink-600); transition: background .15s, color .15s, transform .15s;
}
.sec-edit svg { fill: currentColor; width: 15px; height: 15px; }
.sec-edit:hover { background: var(--pink-500); color: #fff; transform: translateY(-1px); }
.me-info { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin: 0; }
.me-item dt { font-size: 15px; color: var(--ink-soft); margin-bottom: 3px; }
.me-item dd { margin: 0; font-size: 17.5px; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 960px) {
    .me-page-title { font-size: 24px; }
    .me-page-icon { width: 38px; height: 38px; }
    .me-head > .btn { width: 100%; justify-content: center; }
    .me-grid { grid-template-columns: 1fr; }
    .me-side { padding: 28px 20px 24px; }
    .me-photo { width: 160px; height: 160px; }
    .me-main { padding: 22px 20px 24px; }
    .me-sec + .me-sec { margin-top: 28px; }
}
@media (max-width: 600px) {
    .me-info { grid-template-columns: 1fr; gap: 16px; }
    .me-name { font-size: 22px; }
}

/* ---------- หน้าหลักบุคลากร: การ์ดโปรแกรม 4 ใบต่อแถว ---------- */
.dash-section { background: #f4f5f9; padding-top: 24px; }
.prog-heading { text-align: center; font-size: 20px; font-weight: 500; color: var(--ink-soft); margin: 4px 0 22px; }
.prog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.prog-card {
    display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden;
    border: 1px solid #e9e6ec; box-shadow: 0 2px 10px rgba(120, 20, 60, .05); color: var(--ink);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.prog-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(239, 90, 136, .18); border-color: var(--pink-300); color: var(--ink); }
.prog-title {
    padding: 15px 16px; text-align: center; font-family: var(--font-head); font-weight: 600; font-size: 17px;
    background: #f5f4f7; border-bottom: 1px solid #ebe8ee; transition: background .18s, color .18s;
}
a.prog-card:hover .prog-title { background: var(--pink-50); color: var(--pink-700); }
.prog-body { position: relative; display: grid; place-items: center; padding: 26px 16px 28px; }
.prog-icon {
    width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
    box-shadow: inset 0 -8px 18px rgba(0,0,0,.12), 0 10px 22px rgba(0,0,0,.10);
    transition: transform .18s ease;
}
.prog-icon svg { width: 76px; height: 76px; fill: #fff; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.prog-img { width: 172px; height: 172px; display: block; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.14)); transition: transform .18s ease; }
a.prog-card:hover .prog-img { transform: scale(1.05); }
.prog-card.is-soon .prog-img { filter: grayscale(1); opacity: .6; }
a.prog-card:hover .prog-icon { transform: scale(1.05); }
/* ยังไม่เปิดใช้งาน → สีเทา */
.prog-card.is-soon { cursor: default; }
.prog-card.is-soon .prog-icon { filter: grayscale(1); opacity: .55; }
.prog-card.is-soon .prog-title { color: #8a8a90; }
.prog-soon {
    position: absolute; right: 14px; top: 12px; padding: 3px 10px; border-radius: 999px;
    background: #ececef; color: #7a7a82; font-family: var(--font-head); font-size: 12.5px; font-weight: 500;
}
@media (max-width: 1024px) { .prog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 720px)  { .prog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .prog-icon { width: 110px; height: 110px; } .prog-icon svg { width: 56px; height: 56px; } .prog-img { width: 136px; height: 136px; } .prog-title { font-size: 15px; padding: 12px 10px; } .prog-body { padding: 20px 12px 22px; } .prog-heading { font-size: 18px; } }
@media (max-width: 380px)  { .prog-grid { grid-template-columns: 1fr; } }

/* ----- หน้าแก้ไขข้อมูลส่วนตัว: ลิงก์กลับแดชบอร์ด + เรียงคอลัมน์เดียว ----- */
.edit-section { padding-top: 24px; background: #f6f6fb; }   /* พื้นหลังขาวนวลแบบตัวอย่าง */
.edit-section .card { border-color: #ececf3; padding: 44px 48px 48px; }   /* padding ด้านในกรอบขาว 4 ด้าน แบบตัวอย่าง fse */
@media (max-width: 720px) { .edit-section .card { padding: 28px 22px 30px; } }
/* หัวข้อใหญ่หนาพิเศษ + เว้นซ้าย-ขวาระหว่างช่องกรอกให้โปร่งขึ้น + หัวข้อการ์ดไม่มีขีดชมพู */
.edit-section .dash-head h1 { font-weight: 800; }
.edit-section .card-title::after { display: none; }
.pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; align-items: start; }
@media (max-width: 720px) { .pw-grid { grid-template-columns: 1fr; } }
.edit-back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 500; font-size: 15px; color: var(--pink-700); margin-bottom: 14px; }
.edit-back:hover { color: var(--pink-600); text-decoration: underline; }

/* ----- หน้าระบบสารสนเทศ: แบนเนอร์ต้อนรับ ----- */
.dash-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    background: linear-gradient(100deg, #ff7fa8 0%, #ff9ebe 100%);   /* เข้มซ้าย → อ่อนขวา */
    color: #fff; border-radius: 18px; padding: 26px 30px; margin-bottom: 22px; box-shadow: 0 12px 30px rgba(255, 127, 168, .28); }
.dash-hero-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dash-hero-deco circle { fill: #fff; }
.dash-hero > *:not(.dash-hero-deco) { position: relative; z-index: 1; }
.dh-photo { width: 104px; height: 104px; border-radius: 50%; flex: none; background: center/cover no-repeat, linear-gradient(135deg, #ffd0dd, #f7739a); background-size: cover; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; }
.dh-photo svg { width: 50px; height: 50px; fill: #fff; }
.dh-hello { font-size: 16px; opacity: .85; }
.dh-name { font-family: var(--font-head); font-weight: 700; font-size: 32px; color: #fff; margin: 2px 0 10px; line-height: 1.25; }
.dh-role { display: inline-block; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 5px 17px; font-family: var(--font-head); font-weight: 500; font-size: 14.5px; }
.dh-logout { margin-left: auto; background: #fff; color: var(--pink-700); border-radius: 999px; padding: 12px 24px; font-family: var(--font-head); font-weight: 600; font-size: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); transition: transform .13s, background .13s; }
.dh-logout:hover { background: var(--pink-50); color: var(--pink-700); transform: translateY(-1px); }
@media (max-width: 640px) { .dash-hero { padding: 22px 20px; } .dh-name { font-size: 22px; } .dh-logout { margin-left: 0; } }

/* ----- หน้าระบบสารสนเทศ: ข้อมูลส่วนตัวซ้าย + ระบบสารสนเทศขวา (กรอบขาว 2 กรอบสูงเท่ากัน) ----- */
.dash-layout { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.dash-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 2px 12px rgba(120, 20, 60, .05); }
.panel-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 21px; color: var(--pink-500); margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-title::before { content: ''; width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--pink-300), var(--pink-500)); flex: none; }
.dash-profile { display: flex; flex-direction: column; }
.panel-edit { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--pink-50); color: var(--pink-600); margin-left: 4px; transition: background .13s, transform .12s; flex: none; }
.panel-edit svg { fill: currentColor; }
.panel-edit:hover { background: var(--pink-100); color: var(--pink-700); }
.panel-edit:active { transform: scale(.93); }
.dp-photo { width: 138px; height: 138px; border-radius: 50%; margin: 4px auto 14px; background: center/cover no-repeat, linear-gradient(135deg, #f7a9c3, #d9406f); background-size: cover; border: 5px solid var(--pink-100); display: flex; align-items: center; justify-content: center; flex: none; }
.dp-photo svg { width: 60px; height: 60px; fill: #fff; }
.dp-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--ink); line-height: 1.3; }
.dp-role { display: inline-block; margin: 9px auto 0; font-family: var(--font-head); font-weight: 500; font-size: 14px; background: var(--pink-50); color: var(--pink-700); padding: 5px 15px; border-radius: 999px; }
.dpi-rows { margin: 0; text-align: left; }   /* ให้เนื้อหาเริ่มระดับเดียวกับแผงขวา */
.dpi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 2px; border-bottom: 1px solid #f7eef2; font-size: 15.5px; }
.dpi-row:last-child { border-bottom: 0; }
.dpi-row span { color: var(--ink-soft); flex: none; }
.dpi-row b { font-weight: 600; color: var(--ink); text-align: right; word-break: break-word; min-width: 0; }
.dp-btn { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; width: 100%; justify-content: center; }
.dp-btn svg { fill: currentColor; }
.dash-cats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-cat { display: inline-flex; align-items: center; gap: 8px; padding: 11px 21px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: var(--font-head); font-weight: 500; font-size: 16.5px; color: var(--ink-soft); transition: background .13s, color .13s, border-color .13s; }
.dash-cat:hover { border-color: var(--pink-300); color: var(--pink-700); }
.dash-cat.is-on { background: linear-gradient(120deg, #ff7fa8 0%, #ff9ebe 100%) center / 110% 110% no-repeat #ff7fa8; border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(255, 127, 168, .32); }   /* ไล่สีใหญ่กว่าปุ่ม 10% กันสีปลายลอดขอบตอนซูม */
.dash-cat-n { font-size: 13px; background: rgba(0, 0, 0, .06); color: inherit; padding: 1px 8px; border-radius: 999px; }
.dash-cat.is-on .dash-cat-n { background: rgba(255, 255, 255, .25); }
.dash-prog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prog-card.cat-hide { display: none; }
.dash-layout .dash-cats { gap: 8px; }
.dash-layout .dash-cat { padding: 8px 14px; font-size: 14.5px; gap: 6px; }   /* หน้าระบบสารสนเทศ: แผงขวาแคบลง → แท็บกะทัดรัดขึ้น ให้อยู่แถวเดียว */
.dash-cat-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 44px 16px; background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
@media (max-width: 1024px) { .dash-prog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .dash-layout { grid-template-columns: 360px minmax(0, 1fr); } }   /* จอเล็กลง: แผงซ้ายแคบลงหน่อย ให้การ์ดขวามีที่ */
@media (max-width: 900px)  { .dash-layout { grid-template-columns: 1fr; } .dash-profile { max-width: none; margin: 0; width: 100%; } }   /* แท็บเล็ต/มือถือ: แผงข้อมูลส่วนตัวเต็มความกว้าง */
@media (max-width: 380px)  { .dash-prog-grid { grid-template-columns: 1fr; } }

/* =====================================================
   หน้าข้อมูลส่วนตัว (profile.php)
   ===================================================== */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 30px 30px; box-shadow: var(--shadow-sm);
}
.card-title {
    font-size: 21px; margin-bottom: 20px; padding-bottom: 12px; position: relative;
    border-bottom: 1px solid var(--line);
}
.card-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 48px; height: 3px; background: var(--pink-400); border-radius: 3px; }

.profile-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }   /* เรียงลงมาคอลัมน์เดียว: ข้อมูลส่วนตัว → บัญชีผู้ใช้ + รหัสผ่าน */
.profile-card { display: flex; flex-direction: column; }
.profile-card > .form-actions { margin-top: auto; padding-top: 22px; }
.profile-card > .form-grid { margin-bottom: 10px; }   /* เว้นระยะก่อนเส้นคั่นปุ่ม */
.pf-sec { margin: 28px 0 18px; }   /* หัวข้อย่อยในหน้าแก้ไขโปรไฟล์ (ข้อมูลส่วนตัว / ข้อมูลติดต่อ) — แบบเดียวกับหน้าสมัคร */
.pf-sec-first { margin-top: 6px; }
.account-card { justify-content: flex-start; }
.account-card > form:first-child .form-actions { margin-top: 24px; }
.pw-form { display: flex; flex-direction: column; flex: 1; }   /* การ์ดเปลี่ยนรหัสผ่าน */
.pw-title { font-size: 17px; font-weight: 700; color: var(--pink-700); margin: 0 0 14px; }
.pw-form .form-group { margin-bottom: 14px; }
.pw-form .form-label { font-size: 15px; margin-bottom: 6px; }
.pw-form .form-control { height: 48px; font-size: 16px; }   /* ช่องกรอกกะทัดรัด */
.pw-form .form-hint { margin-top: 4px; font-size: 13px; }
.pw-form .form-actions { margin-top: auto; padding-top: 18px; }
.card-subtitle { font-size: 15px; font-weight: 600; color: var(--ink-soft); margin: 22px 0 12px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-hint-inline { font-family: var(--font-body); font-size: 12.5px; font-weight: 400; color: var(--muted); }   /* ฟอร์มข้อมูลกว้าง กล่องเปลี่ยนรหัสผ่านแคบ 360px */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px 18px; }   /* ตาราง 12 ช่อง แบ่งความกว้างได้ละเอียด */
.form-grid .form-group { margin-bottom: 0; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-10 { grid-column: span 10; } .span-12 { grid-column: span 12; }
.name-row { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 16px 18px; }   /* คำนำหน้า 180px ชื่อ-นามสกุล กว้างเท่ากัน — แถวงาน (ตำแหน่ง/กลุ่มสาระ/ระดับชั้น) ใช้สัดส่วนเดียวกัน */
.name-row .form-group { margin-bottom: 0; }
.form-select {
    appearance: none; -webkit-appearance: none; padding-left: 16px; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235e5566'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
/* ตอนคลิกเปิดรายการ (focus) → ลูกศรหันขึ้น */
.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef5a88'%3E%3Cpath d='M7 14l5-5 5 5z'/%3E%3C/svg%3E");
}
.mt-8 { margin-top: 8px; }
.form-hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.req { color: var(--pink-600); }
.form-actions {   /* แถบปุ่มท้ายฟอร์มมาตรฐานทั้งเว็บ: เส้นคั่นด้านบน ปุ่มชิดขวา (ยกเลิก | บันทึก) */
    margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
    display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap;
}
.form-file { display: block; font-size: 15px; color: var(--ink-soft); }
.form-file::file-selector-button {
    font-family: var(--font-head); font-size: 14px; padding: 8px 16px; margin-right: 12px;
    border: 1px solid var(--pink-300); border-radius: 8px; background: var(--pink-50); color: var(--pink-600); cursor: pointer;
}
.form-file::file-selector-button:hover { background: var(--pink-100); }

.photo-row { display: flex; gap: 22px; align-items: center; margin-bottom: 24px; }
.photo-preview {
    position: relative; flex: 0 0 120px; width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
    background: var(--pink-100); color: var(--pink-400); display: grid; place-items: center;
    border: 4px solid #fff; box-shadow: 0 4px 16px rgba(120,20,60,.15);
}
/* รูปตัวอย่าง: ยึดเต็มวงกลมเสมอ (iOS Safari คำนวณ height:100% ในกริดผิด → ใช้ absolute แทน) ครอปจากกึ่งกลางรูปจริง */
.photo-preview img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }
.photo-preview svg { fill: currentColor; }
.photo-actions { flex: 1; }

@media (max-width: 1024px) { .profile-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .card { padding: 22px 18px 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid > * { grid-column: span 1 !important; }
    .name-row { grid-template-columns: 1fr; }
    /* หัวหน้า: ชื่อหน้า + ปุ่มกลับ เต็มความกว้าง */
    .dash-head { margin-bottom: 20px; }
    .dash-head h1 { font-size: 26px; }
    .dash-head > .btn { width: 100%; justify-content: center; }
    /* รูปถ่าย: รูปอยู่กึ่งกลาง ปุ่มเลือกไฟล์เต็มแถว */
    .photo-row { flex-direction: column; align-items: center; gap: 16px; margin-bottom: 22px; }
    .photo-preview { flex-basis: auto; width: 140px; height: 140px; }
    .photo-actions { width: 100%; text-align: center; }
    .photo-actions .form-label { display: block; text-align: center; }
    .form-file { width: 100%; text-align: center; }
    .form-file::file-selector-button { display: block; width: 100%; margin: 0 0 8px; padding: 11px 16px; font-size: 15px; }
    .photo-actions .form-hint { text-align: left; }
    .photo-remove { justify-content: center; }
    /* แถบปุ่มท้ายฟอร์ม: ยกเลิก | บันทึก (บันทึกยืดเต็มที่เหลือ) */
    .form-actions { margin-top: 24px; padding-top: 18px; }
    .form-actions .btn-primary { flex: 1 1 auto; justify-content: center; }
    .form-actions .btn-cancel { flex: 0 0 auto; }
    .form-control { height: 50px; font-size: 16px; }   /* 16px กัน iOS ซูมอัตโนมัติ */
    textarea.form-control { height: auto; }
}


/* ----- ระบบสารสนเทศ: เปลี่ยนรหัสผ่าน ใต้ข้อมูลส่วนตัว (กดเพื่อเปิดฟอร์ม) ----- */
.dpi-pw { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fffafc; overflow: hidden; }
.dpi-pw summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 15.5px; color: var(--pink-700); user-select: none; }
.dpi-pw summary::-webkit-details-marker { display: none; }
.dpi-pw summary svg { fill: currentColor; flex: none; }
.dpi-pw summary span { flex: 1; }
.dpi-pw summary:hover { background: var(--pink-50); }
.dpi-pw-caret { transition: transform .2s; }
.dpi-pw[open] .dpi-pw-caret { transform: rotate(180deg); }
.dpi-pw[open] summary { border-bottom: 1px solid var(--line); }
.dpi-pw .alert { margin: 14px 16px 0; }
.dpi-pw-form { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; background: #fff; }
.dpi-pw-form .form-label { margin: 6px 0 0; font-size: 14.5px; }
.dpi-pw-form .form-label small { font-weight: 400; }
.dpi-pw-btn { align-self: flex-start; margin-top: 12px; width: auto; height: 42px; padding: 0 22px; border-radius: 9px; font-size: 15px; box-shadow: none; }   /* ปุ่มเล็ก ชิดซ้าย */

/* แท็บฝ่ายงาน (หน้าระบบสารสนเทศ) บนมือถือ: ตาราง 2 คอลัมน์ กว้างเท่ากัน · ชื่อชิดซ้าย ตัวเลขชิดขวา */
@media (max-width: 640px) {
    .dash-cats, .dash-layout .dash-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .dash-cat, .dash-layout .dash-cat { justify-content: space-between; min-width: 0; height: auto; min-height: 48px; padding: 6px 8px 6px 14px; border-radius: 12px; font-size: 14.5px; gap: 6px; text-align: left; }
    .dash-cat-l { min-width: 0; line-height: 1.3; word-break: break-word; }   /* ชื่อยาวขึ้นบรรทัดใหม่ แทนการตัด … */
    .dash-cat-n { flex: none; min-width: 26px; text-align: center; }
    .dash-cat:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* จำนวนแท็บเป็นเลขคี่ → แท็บสุดท้ายเต็มแถว */
}
@media (max-width: 400px) {
    .dash-cat, .dash-layout .dash-cat { font-size: 13.5px; padding: 6px 6px 6px 11px; }
    .dash-cat-n { min-width: 22px; padding: 1px 6px; font-size: 12px; }
}

.dash-cat { -webkit-tap-highlight-color: transparent; }

/* ===== ตารางสอน (หน้า timetable.php — หน้าตาแบบแบบฟอร์มตารางสอนของโรงเรียน) ===== */
.tt-section { padding-top: 24px; background: #f6f6fb; }   /* ขยับเนื้อหาขึ้นด้านบน + พื้นหลังขาวนวลแบบหน้าแก้ไขข้อมูลส่วนตัว */
.dash-tt { margin-top: 10px; background: #fff; border-radius: 22px; padding: 26px 28px 26px; box-shadow: 0 4px 14px rgba(70, 40, 60, .06); }
.tt-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tt-head .panel-title { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.tt-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.tt-pick { margin: 0; }
.tt-pick .form-select { min-width: 230px; }
.tt-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 16px; text-align: center; color: var(--muted); font-size: 14.5px; }
.tt-empty svg { fill: #e8dfe9; }
.tt-empty b { font-family: var(--font-head); font-size: 17px; color: var(--ink-soft); }

/* หัวกระดาษแบบแบบฟอร์ม */
.tt-doc-title { margin: 22px 0 12px; text-align: center; font-family: var(--font-head); font-weight: 600; font-size: 16.5px; color: #2d2a35; }

/* ตารางแบบเอกสาร: เส้นบางสีเข้ม พื้นขาว — table-layout fixed + ตัดคำ = กว้างพอดีหน้าจอ ไม่เลื่อนซ้าย-ขวา */
.tt-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; background: #fff; }
.tt-grid th, .tt-grid td { border: 1px solid #8b8595; padding: 8px 5px; text-align: center; vertical-align: middle; overflow-wrap: break-word; }
.tt-grid thead th { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: #2d2a35; background: #fff; }
.tt-grid thead .tt-time th { font-family: var(--font-body, inherit); font-weight: 400; font-size: 11px; color: #4d4858; padding: 5px 2px; }
.tt-grid .tt-day { font-family: var(--font-head); font-weight: 600; color: #2d2a35; width: 8%; background: #fff; }
.tt-grid td { color: #35313f; line-height: 1.45; height: 62px; }
.tt-grid td.tt-meet, .tt-grid td.tt-lunch { background: #fafafa; }
.tt-grid col, .tt-grid th:nth-child(2) { width: 7%; }
.tt-grid th:nth-child(6) { width: 8%; }
.tt-grid td.tt-hm { font-size: 11.5px; color: #6c6678; }
.tt-days { display: none; }

/* จอแคบ: สลับเป็นการ์ดรายวัน อ่านบนมือถือได้พอดีจอ */
@media (max-width: 820px) {
    .dash-tt { padding: 20px 16px 16px; border-radius: 18px; }
    .tt-grid { display: none; }
    .tt-doc-title { font-size: 14.5px; margin: 16px 0 4px; }
    .tt-days { display: grid; gap: 12px; margin-top: 14px; }
    .tt-daycard { border: 1px solid #e9e2ea; border-radius: 14px; overflow: hidden; }
    .tt-daycard-h { background: #fdf1f5; color: var(--pink-700); font-family: var(--font-head); font-weight: 600; font-size: 14.5px; padding: 9px 14px; }
    .tt-slot { display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; border-top: 1px solid #f7f0f5; font-size: 14px; color: var(--ink-soft); }
    .tt-slot:first-of-type { border-top: 0; }
    .tt-slot-n { flex: none; width: 48px; font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: var(--pink-600); }
    .tt-slot-t { flex: none; width: 82px; font-size: 11.5px; color: var(--muted); }
    .tt-slot-v { min-width: 0; overflow-wrap: anywhere; }
    .tt-slot-free { color: var(--muted); justify-content: center; }
    .tt-pick .form-select { min-width: 0; width: 100%; }
    .tt-tools { width: 100%; }
    .tt-pick { flex: 1 1 auto; }
}

/* ===== ตารางสอน: ชั่วโมงที่ได้รับมอบหมายให้สอนแทน (จากระบบลา) ===== */
.tt-sub { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #f0c6cc; color: #c62838; font-weight: 600; font-size: 12px; line-height: 1.4; }   /* สอนแทน = สีแดง */
.tt-sub small { display: block; font-weight: 400; font-size: 11px; color: #d4586a; }
.tt-sub.is-wait { opacity: .72; }
.tt-grid td .tt-sub:first-child, .tt-slot-v .tt-sub:first-child { border-top: 0; padding-top: 0; }
.tt-slot-v .tt-sub { font-size: 12.5px; }
.tt-sub-note { display: block; margin: 10px 2px 0; font-size: 13px; line-height: 1.65; color: #8a6a70; }   /* block (ไม่ใช่ flex) → ข้อความไหลต่อกันเป็นย่อหน้าเดียว ไม่แตกเป็นคอลัมน์บนมือถือ */
.tt-sub-note b { color: #c62838; }
.tt-sub-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: #c62838; vertical-align: -1px; }

/* reCAPTCHA ในฟอร์มติดต่อเรา */
.form-captcha { margin: 2px 0 16px; }
.form-captcha .g-recaptcha { transform-origin: 0 0; }
@media (max-width: 360px) { .form-captcha .g-recaptcha { transform: scale(.88); } }   /* จอแคบมาก: ย่อกล่องให้พอดี */

/* ===== ตารางสอน: คาบที่ตรงกับวันลาของเจ้าของตาราง (สีส้ม) + ชื่อครูผู้สอนแทน ===== */
.tt-grid td.is-away { background: #fff6e6; }
.tt-away { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #f1cf96; color: #c46a00; font-weight: 600; font-size: 12px; line-height: 1.4; }
.tt-away small { display: block; font-weight: 500; font-size: 11px; color: #b5651d; }
.tt-away.is-none small { color: #c99a55; font-weight: 400; }
.tt-slot-v .tt-away { font-size: 12.5px; }
.tt-away-note .tt-sub-dot { background: #e08a1e; }
.tt-away-note b { color: #c46a00; }
.tt-away-note a { color: #0b7d70; font-weight: 600; }
/* ชื่อครูในข้อความสอนแทน/มอบหมาย: บรรทัดของตัวเอง ไม่ตัดกลางชื่อ */
.tt-nm { display: block; font-weight: 700; overflow-wrap: normal; word-break: keep-all; }
.tt-nm .nw { white-space: nowrap; }
/* หัวข้อหน้าตารางสอน: ไอคอนตารางสีเขียว + "ตารางสอนของฉัน" (แบบเดียวกับหน้ามอบหมายสอนแทน) */
.tt-title { gap: 9px; color: #2f2a4a; font-weight: 600; font-size: 20px; }
.tt-title::before { display: none; }
.tt-title svg { flex: none; fill: #12a594; }

/* ===== ตารางสอน: มือถือ (≤820px) ===== */
@media (max-width: 820px) {
    .tt-title { font-size: 17px; line-height: 1.4; align-items: flex-start; }
    .tt-title svg { width: 19px; height: 19px; margin-top: 3px; }
    .tt-sub-note { font-size: 12.5px; }
    /* การ์ดรายวัน: ข้อความลา/สอนแทนเรียงต่อกันในบรรทัดเดียว (จอแคบแต่กว้างพอ) ชื่อครูยังไม่ถูกตัดกลางคำ */
    .tt-slot-v .tt-away, .tt-slot-v .tt-sub { font-size: 13px; }
    .tt-slot-v .tt-away small, .tt-slot-v .tt-sub small { font-size: 12px; }
    .tt-slot-v .tt-nm { display: inline; margin: 0 .22em; }
    .tt-slot { align-items: flex-start; }
    .tt-slot-v { flex: 1; }
}
.tt-title .nw { white-space: nowrap; }
@media (max-width: 820px) {
    /* แถวคาบ: ชื่อคาบ + เวลาซ้อนกันทางซ้าย → ช่องวิชา/ข้อความกว้างขึ้น */
    .tt-slot { display: grid; grid-template-columns: 62px minmax(0, 1fr); grid-template-areas: "n v" "t v"; column-gap: 10px; row-gap: 1px; }
    .tt-slot-n { grid-area: n; width: auto; }
    .tt-slot-t { grid-area: t; width: auto; font-size: 10.5px; }
    .tt-slot-v { grid-area: v; }
    .tt-slot-free { display: flex; }
    /* การ์ดวันที่ลา = สีส้ม */
    .tt-daycard.is-away { border-color: #f2c77e; }
    .tt-daycard.is-away .tt-daycard-h { background: #fff3dc; color: #a35f00; }
    .tt-away-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 600; vertical-align: 1px; }
}
.tt-away .nw2 { display: inline-block; white-space: nowrap; }

/* ตารางสอน: สถานะการยืนยันสอนแทน (รอยืนยัน / ไม่สะดวก) */
.tt-st { display: inline-block; max-width: 100%; margin-top: 2px; padding: 1px 7px; border-radius: 10px; font-family: var(--font-body); font-size: 11.5px; font-weight: 600; line-height: 1.45; white-space: normal; }
.tt-st.is-wait { background: #fff1d6; color: #b86e00; }
.tt-st.is-bad { background: #fde7ea; color: #c62838; }
a.tt-st-go { text-decoration: none; border: 1px solid #f2c779; }
a.tt-st-go:hover { background: #ffe4ad; }

/* ===== หน้าที่พิเศษ (แก้ไขข้อมูลส่วนตัว + การ์ดข้อมูลส่วนตัวในแดชบอร์ด) ===== */
.duty-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 2px; }
.duty-chk { display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; border: 1.5px solid #eadfe4; border-radius: 10px; background: #fff; font-size: 14px; line-height: 1.5; cursor: pointer; transition: border-color .15s, background .15s; }
.duty-chk:hover { border-color: var(--pink-300); background: var(--pink-50); }
.duty-chk input { margin: 3px 0 0; accent-color: var(--pink-600); flex: none; width: 16px; height: 16px; cursor: pointer; }
.duty-chk input:checked + span { color: var(--pink-700); font-weight: 600; }
.dpi-row-duties { align-items: flex-start; }
.dpi-row-duties b { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.dpi-duty { font-style: normal; font-weight: 700; font-size: 12.5px; line-height: 1.6; padding: 2px 11px; border-radius: 999px; background: #fff5f9; border: 1px solid var(--pink-200); color: var(--pink-600); }
@media (max-width: 640px) {
    .duty-grid { grid-template-columns: 1fr; }
}

/* ---------- ข้อมูลส่วนตัว (แบบรายการมีไอคอน) ---------- */
.dpi-head { display: flex; align-items: center; gap: 14px; padding: 2px 0 14px; margin-bottom: 6px; border-bottom: 1px solid #f7eef2; }
.dpi-ava { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 24px;
    background: linear-gradient(145deg, #fb95b8, #ef5a88) center / cover no-repeat; box-shadow: 0 8px 18px -8px rgba(239, 90, 136, .6); }
.dpi-head-tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dpi-head-tx b { font-family: var(--font-head); font-weight: 600; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.dpi-head-tx small { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.dpi-list { display: flex; flex-direction: column; text-align: left; padding-top: 2px; }
.dpi-it { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.dpi-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.dpi-ic svg { fill: currentColor; }
.dpi-ic.c-blue   { background: #eef3ff; color: #3b63c7; }
.dpi-ic.c-green  { background: #eaf7e6; color: #3a8a2f; }
.dpi-ic.c-orange { background: #fff2e2; color: #d2782a; }
.dpi-ic.c-purple { background: #f1ebff; color: #6f4ad1; }
.dpi-ic.c-pink   { background: #fde8f0; color: #d9306b; }
.dpi-ic.c-teal   { background: #e3f7f5; color: #15807a; }
.dpi-it-tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dpi-it-tx small { font-size: 12px; color: #9a8fa6; }
.dpi-it-tx b { font-weight: 500; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.dpi-duties { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }

/* ข้อมูลส่วนตัว: แบบไม่มีไอคอน (เส้นคั่นบาง ๆ ระหว่างแถว) */
.dpi-plain .dpi-it { padding: 9px 2px; border-bottom: 1px dashed #f1dde5; }
.dpi-plain .dpi-it:last-child { border-bottom: 0; }
.dpi-plain .dpi-it-tx small { font-size: 12px; }

/* หัวการ์ดหน้าระบบสารสนเทศ: Prompt */
.panel-title { font-family: 'Prompt', var(--font-head), sans-serif; font-weight: 700; letter-spacing: -0.2px; }

/* ข้อมูลส่วนตัว: ไอคอนชมพูสีเดียว กรอบมน (แบบ B) */
.dpi-soft .dpi-it { padding: 8px 2px; border-bottom: 1px dashed #f1dde5; gap: 12px; align-items: center; }
.dpi-soft .dpi-it:last-child { border-bottom: 0; }
.dpi-soft .dpi-it-tx { line-height: 1.35; gap: 1px; }
.dpi-soft .dpi-it-tx small { font-size: 13px; line-height: 1.35; }
.dpi-soft .dpi-it-tx b { font-size: 15px; line-height: 1.35; }
.dpi-soft .dpi-duties { margin-top: 2px; }
.dpi-soft .dpi-duty { font-size: 12.5px; line-height: 1.5; padding: 1px 10px; }
.dpi-soft .dpi-ic,
.dpi-soft .dpi-ic.c-blue, .dpi-soft .dpi-ic.c-green, .dpi-soft .dpi-ic.c-orange,
.dpi-soft .dpi-ic.c-purple, .dpi-soft .dpi-ic.c-pink, .dpi-soft .dpi-ic.c-teal {
  width: 32px; height: 32px; border-radius: 9px; background: #fdeef3; color: var(--pink-500, #e7467a); margin: 0; align-self: center;
}
.dpi-soft .dpi-ic svg { width: 16px; height: 16px; }

/* ไอคอนโทนเทา-ม่วงอ่อน (แบบ D) */
.dpi-soft .dpi-ic,
.dpi-soft .dpi-ic.c-blue, .dpi-soft .dpi-ic.c-green, .dpi-soft .dpi-ic.c-orange,
.dpi-soft .dpi-ic.c-purple, .dpi-soft .dpi-ic.c-pink, .dpi-soft .dpi-ic.c-teal { color: #6f6478; background: #f3f0f6; }
/* ลดช่องว่างระหว่างเส้นใต้หัวการ์ดกับแถวแรก */
.dpi-list.dpi-soft { padding-top: 0; margin-top: -6px; }
.dpi-soft .dpi-it:first-child { padding-top: 2px; }

/* ไอคอนไล่สีทีละแถว ชมพู → ม่วง → ฟ้าคราม (โทนอ่อน ไม่ฉูดฉาด) */
.dpi-soft .dpi-it { --h: 340; }
.dpi-soft .dpi-it:nth-child(1) { --h: 340; }
.dpi-soft .dpi-it:nth-child(2) { --h: 328; }
.dpi-soft .dpi-it:nth-child(3) { --h: 316; }
.dpi-soft .dpi-it:nth-child(4) { --h: 304; }
.dpi-soft .dpi-it:nth-child(5) { --h: 292; }
.dpi-soft .dpi-it:nth-child(6) { --h: 280; }
.dpi-soft .dpi-it:nth-child(7) { --h: 268; }
.dpi-soft .dpi-it:nth-child(8) { --h: 256; }
.dpi-soft .dpi-it:nth-child(9) { --h: 244; }
.dpi-soft .dpi-it:nth-child(10) { --h: 232; }
.dpi-soft .dpi-it .dpi-ic,
.dpi-soft .dpi-it .dpi-ic.c-blue, .dpi-soft .dpi-it .dpi-ic.c-green, .dpi-soft .dpi-it .dpi-ic.c-orange,
.dpi-soft .dpi-it .dpi-ic.c-purple, .dpi-soft .dpi-it .dpi-ic.c-pink, .dpi-soft .dpi-it .dpi-ic.c-teal {
  background: hsl(var(--h) 100% 95%); color: hsl(var(--h) 78% 58%);
}
/* หัวข้อกับค่าขนาดเท่ากัน แยกกันด้วยสีและน้ำหนัก */
.dpi-soft .dpi-it-tx small, .dpi-soft .dpi-it-tx b { font-size: 14px; line-height: 1.4; }
.dpi-soft .dpi-duty { font-size: 13px; }

/* ไม่มีเส้นคั่นระหว่างแถว */
.dpi-soft .dpi-it { border-bottom: 0; }

/* กรอบไอคอนสูงเท่ากับข้อความ 2 บรรทัด */
.dpi-soft .dpi-it .dpi-ic { width: 40px; height: 40px; border-radius: 12px; }
.dpi-soft .dpi-ic svg { width: 19px; height: 19px; }
.dpi-soft .dpi-it { gap: 13px; }

/* ===== นามบัตรของฉัน (หน้าระบบสารสนเทศ) — ขนาดอ้างอิง 340×208 ปรับตามความกว้างด้วย --u ===== */
.bc-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line, #f1dde5); }
.bc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bc-head b { font-family: 'Prompt', var(--font-head), sans-serif; font-weight: 600; font-size: 15px; color: var(--pink-500, #e7467a); }
.bc-wrap { container-type: inline-size; max-width: 380px; margin: 0 auto; perspective: 1200px; }
.bc { --u: calc(100cqw / 340); --navy: #1b3a8f; position: relative; display: block; width: 100%; aspect-ratio: 340 / 208; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,.7,.2,1); font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; }
.bc.is-back { transform: rotateY(180deg); }
.bc:focus-visible { outline: 3px solid var(--pink-300, #f7a1bf); outline-offset: 4px; border-radius: calc(8 * var(--u)); }
.bc-face { position: absolute; inset: 0; overflow: hidden; border-radius: calc(8 * var(--u)); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 6px 18px rgba(23, 33, 61, .14), 0 1px 3px rgba(23, 33, 61, .08); }
.bc-front { background: #fff; color: #17213d; font-family: 'Sarabun', sans-serif; }
.bc-back { background: var(--navy); color: #fff; transform: rotateY(180deg); font-family: 'Sarabun', sans-serif; }
.bc-wm { position: absolute; width: calc(250 * var(--u)); height: calc(250 * var(--u)); right: calc(-78 * var(--u)); top: calc(-22 * var(--u)); opacity: .08; pointer-events: none; }
.bc-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: calc(6 * var(--u)); display: flex; }
.bc-stripe i { flex: 1; } .bc-stripe i:nth-child(1) { flex: 3; background: var(--navy); } .bc-stripe i:nth-child(2) { background: #f2b705; } .bc-stripe i:nth-child(3) { background: #e8731a; }
.bc-stripe-b i:nth-child(1) { background: #f2b705; } .bc-stripe-b i:nth-child(2) { background: #e8731a; }
.bc-in { position: relative; height: 100%; box-sizing: border-box; padding: calc(18 * var(--u)) calc(20 * var(--u)) calc(20 * var(--u)); display: flex; flex-direction: column; }
.bc-school { display: flex; align-items: center; gap: calc(8 * var(--u)); }
.bc-school img { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.bc-school > span { display: flex; flex-direction: column; line-height: 1.15; }
.bc-school b { font-family: 'Prompt', sans-serif; font-weight: 600; font-size: calc(12.5 * var(--u)); color: var(--navy); }
.bc-school small { font-size: calc(9.5 * var(--u)); letter-spacing: calc(.4 * var(--u)); color: #5a6380; }
.bc-who { margin-top: calc(14 * var(--u)); display: flex; flex-direction: column; gap: calc(1 * var(--u)); min-width: 0; }
.bc-who b { font-family: 'Prompt', sans-serif; font-weight: 600; font-size: calc(17 * var(--u)); line-height: 1.25; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-who em { font-style: normal; font-size: calc(10.5 * var(--u)); font-weight: 500; color: #e8731a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-who small { font-size: calc(9.5 * var(--u)); color: #5a6380; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-contact { margin-top: auto; display: flex; flex-direction: column; gap: calc(3 * var(--u)); font-size: calc(9.5 * var(--u)); line-height: 1.3; color: #2c3554; }
.bc-contact > span { display: flex; align-items: center; gap: calc(6 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-contact svg { flex: none; width: calc(11 * var(--u)); height: calc(11 * var(--u)); fill: none; stroke: var(--navy); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bc-wm1, .bc-wm2 { position: absolute; opacity: .1; filter: grayscale(1) brightness(2.2); pointer-events: none; }
.bc-wm1 { width: calc(330 * var(--u)); height: calc(330 * var(--u)); left: calc(-120 * var(--u)); top: calc(-60 * var(--u)); }
.bc-wm2 { width: calc(220 * var(--u)); height: calc(220 * var(--u)); right: calc(-90 * var(--u)); bottom: calc(-100 * var(--u)); }
.bc-bin { position: relative; height: 100%; box-sizing: border-box; padding: calc(18 * var(--u)) calc(20 * var(--u)) calc(22 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.bc-disc { width: calc(84 * var(--u)); height: calc(84 * var(--u)); border-radius: 50%; background: #fff; display: grid; place-items: center; margin-bottom: calc(8 * var(--u)); }
.bc-disc img { width: calc(78 * var(--u)); height: calc(78 * var(--u)); }
.bc-bin b { font-family: 'Prompt', sans-serif; font-weight: 600; font-size: calc(16 * var(--u)); }
.bc-bin small { font-size: calc(9.5 * var(--u)); letter-spacing: calc(1.2 * var(--u)); color: #f6d77a; margin-top: calc(1 * var(--u)); }
.bc-web { font-size: calc(9.5 * var(--u)); color: #d7def2; margin-top: calc(8 * var(--u)); }
@media (prefers-reduced-motion: reduce) { .bc { transition: none; } }

.bc-hint { margin: 8px 0 0; font-size: 12px; color: #9a8fa6; text-align: center; }

/* ===== หน้าระบบสารสนเทศ: แท็บฝ่ายงานแบบปุ่มสลับ (segmented) + จำนวนโปรแกรม ===== */
.dash-cats.dash-seg { display: flex; flex-wrap: nowrap; gap: 8px; padding: 0; container-type: inline-size; margin-bottom: 32px; background: none; border-radius: 0; }
.dash-seg .dash-cat, .dash-layout .dash-seg .dash-cat { flex: 1 1 auto; min-width: 0; justify-content: center; gap: 8px; padding: 10px 12px; min-height: 0; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: none; font-size: 15px; white-space: nowrap; font-weight: 400; color: var(--ink-soft); }
.dash-seg .dash-cat:not(.is-on):hover { color: var(--pink-700); border-color: var(--pink-300); }
.dash-seg .dash-cat.is-on { background: linear-gradient(120deg, #ff7fa8 0%, #ff9ebe 100%) center / 110% 110% no-repeat #ff7fa8; border-color: transparent; color: #fff; font-weight: 500; box-shadow: 0 6px 16px rgba(255, 127, 168, .32); }
.dash-seg .dash-cat-n { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .06); color: var(--ink-soft); font-size: 13px; font-weight: 500; text-align: center; }
.dash-seg .dash-cat.is-on .dash-cat-n { background: rgba(255, 255, 255, .28); color: #fff; }
.dash-prog-grid .prog-card.pc6.cat-hide { display: none; }
.dash-seg .dash-cat-l small { font-size: inherit; }   /* คอม: "ฝ่ายบริหาร" อยู่บรรทัดเดียวกับชื่อ */
@container (max-width: 820px) {   /* แผงแคบ: "ฝ่ายบริหาร" ตัวเล็กบรรทัดบน ชื่อฝ่ายบรรทัดล่าง — ยังอยู่แถวเดียว */
    .dash-seg .dash-cat, .dash-layout .dash-seg .dash-cat { justify-content: space-between; padding: 6px 10px 6px 16px; border-radius: 16px; line-height: 1.25; text-align: left; }
    .dash-seg .dash-cat-l small { display: block; font-size: 12px; opacity: .75; }
}   /* ซ่อนการ์ดที่ไม่อยู่ในฝ่ายงานที่เลือก (ต้องชนะ display:flex ของ .pc6) */

/* ===== การ์ดโปรแกรม: แถบสีด้านบน + ไอคอนลอยคร่อมแถบ ===== */
.dash-prog-grid { gap: 30px 16px; }
.dash-prog-grid .prog-card.pc6 { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; overflow: visible; padding: 0 12px 16px; border-radius: 18px; border: 1px solid #ece6ec; box-shadow: 0 2px 10px rgba(120, 20, 60, .04); }
.pc6-band { align-self: stretch; height: 74px; margin: 0 -12px; border-radius: 17px 17px 0 0; background: #f4f1f5; background: color-mix(in srgb, var(--c1) 17%, #fff); transition: background .18s; }
.pc6-ic { width: 110px; height: 110px; margin: -56px auto 10px; display: grid; place-items: center; background: #fff; border-radius: 28px; box-shadow: 0 6px 16px rgba(30, 20, 60, .11); transition: transform .18s ease; }
.dash-prog-grid .pc6 .prog-img { width: 96px; height: 96px; filter: none; transform: none; }
.dash-prog-grid .pc6 .prog-icon { width: 86px; height: 86px; border-radius: 22px; box-shadow: none; }
.dash-prog-grid .pc6 .prog-icon svg { width: 44px; height: 44px; }
.dash-prog-grid .pc6 .prog-title { padding: 0; background: none; border: 0; font-size: 16px; font-weight: 500; line-height: 1.35; }
.pc6-desc { margin-top: 2px; font-family: 'Sarabun', sans-serif; font-size: 13px; line-height: 1.4; color: var(--muted); }
.dash-prog-grid a.pc6:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c1) 45%, #fff); box-shadow: 0 12px 26px rgba(120, 20, 60, .10); }
.dash-prog-grid a.pc6:hover .prog-title { background: none; color: var(--ink); }
.dash-prog-grid a.pc6:hover .pc6-band { background: color-mix(in srgb, var(--c1) 26%, #fff); }
.dash-prog-grid a.pc6:hover .pc6-ic { transform: translateY(-2px); }
.dash-prog-grid a.pc6:hover .prog-img, .dash-prog-grid a.pc6:hover .prog-icon { transform: none; }
.dash-prog-grid .pc6.is-soon .pc6-band { background: #f1f1f3; }
.dash-prog-grid .pc6.is-soon .prog-img, .dash-prog-grid .pc6.is-soon .prog-icon { filter: grayscale(1); opacity: .55; }
.dash-prog-grid .pc6 .prog-soon { right: 10px; top: 10px; padding: 1px 9px; font-size: 11.5px; background: rgba(255, 255, 255, .85); }

@media (max-width: 640px) {
    .dash-cats.dash-seg, .dash-layout .dash-cats.dash-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 26px; }
    .dash-seg .dash-cat, .dash-layout .dash-seg .dash-cat { justify-content: space-between; min-height: 54px; padding: 7px 10px 7px 14px; border-radius: 14px; font-size: 15px; line-height: 1.25; text-align: left; white-space: nowrap; }
    .dash-seg .dash-cat-l small { display: block; font-size: 12px; opacity: .75; }   /* มือถือ: "ฝ่ายบริหาร" ตัวเล็กบรรทัดบน ชื่อฝ่ายบรรทัดล่าง */
    .dash-seg .dash-cat-l { word-break: normal; }
    .dash-prog-grid .pc6 .prog-soon { position: static; order: 9; margin-top: 8px; background: #f1f1f3; }
    .dash-seg .dash-cat:last-child:nth-child(odd) { grid-column: auto; }
    .dash-prog-grid { gap: 26px 12px; }
    .pc6-band { height: 62px; }
    .pc6-ic { width: 90px; height: 90px; margin-top: -46px; border-radius: 24px; }
    .dash-prog-grid .pc6 .prog-img { width: 78px; height: 78px; }
    .dash-prog-grid .pc6 .prog-icon { width: 70px; height: 70px; border-radius: 18px; }
    .dash-prog-grid .pc6 .prog-icon svg { width: 36px; height: 36px; }
    .dash-prog-grid .pc6 .prog-title { font-size: 15px; }
    .pc6-desc { font-size: 12.5px; }
}

/* ===== แท็บเล็ต (760–900px): แผงข้อมูลส่วนตัวเต็มความกว้าง → ข้อมูลซ้าย · นามบัตรขวา ไม่ให้บัตรลอยกลางพื้นที่ว่าง ===== */
@media (min-width: 760px) and (max-width: 900px) {
    .dash-profile:has(> .bc-box) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-content: start; }
    .dash-profile:has(> .bc-box) > * { grid-column: 1; }
    .dash-profile:has(> .bc-box) > .panel-title { grid-column: 1 / -1; }
    .dash-profile > .bc-box { grid-column: 2; grid-row: 2 / span 2; align-self: start; margin-top: 0; padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--line, #f1dde5); }
    .dash-profile > .bc-box .bc-wrap { max-width: none; }
}



/* แท็บฝ่ายงาน จอแคบมาก (หรือซูมมาก): ชื่อหดได้/ขึ้นบรรทัดใหม่ ตัวเลขไม่ถูกทับ */
.dash-seg .dash-cat-l { min-width: 0; }
.dash-seg .dash-cat-n { flex: none; }
@media (max-width: 420px) {
    .dash-seg .dash-cat, .dash-layout .dash-seg .dash-cat { gap: 6px; padding: 7px 8px 7px 12px; font-size: 14px; white-space: normal; }
    .dash-seg .dash-cat-l { flex: 1 1 auto; overflow-wrap: anywhere; }
    .dash-seg .dash-cat-n { min-width: 22px; padding: 1px 6px; font-size: 12px; }
}
@media (max-width: 350px) {
    .dash-cats.dash-seg, .dash-layout .dash-cats.dash-seg { grid-template-columns: 1fr; }
}

/* ข้อมูลส่วนตัว: ค่าที่ยาวจนขึ้นบรรทัดใหม่ (จอแคบ) → ไอคอนชิดบนตรงกับหัวข้อ ไม่ลอยกลางแถว (แถวบรรทัดเดียวสูงเท่าไอคอนพอดี หน้าตาเหมือนเดิม) */
.dpi-soft .dpi-it { align-items: flex-start; }
.dpi-soft .dpi-it .dpi-ic { flex: none; }
