/* manage.css — สไตล์ส่วน "ระบบสมาชิก/จัดการระบบ" (โหลดต่อจาก styles.css)
 * ใช้ selector ที่เจาะจงกว่าเพื่อแก้ทับจุดที่ชนกับ styles.css (เช่น .modal-card.modal-sm) */

/* เติม var ที่ admin.css เคยนิยาม (ตอนรวมไฟล์ตกหล่นไป → ทำให้ขอบ/เส้นแบ่งหายทั้งส่วนจัดการ) */
:root { --primary: #3b82f6; --line: #e2e8f0; }

/* ---------------- ปุ่มเพิ่มเติม (variants) ---------------- */
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px var(--primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-soft { background: #eef2ff; color: #4338ca; }
.btn-soft:hover { background: #e0e7ff; }
.btn-ghost { background: #f1f5f9; color: #475569; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-block { width: 100%; padding: 13px; font-size: 1rem; }
.btn-sm { padding: 7px 11px; font-size: 0.82rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------------- ฟิลด์ฟอร์ม ---------------- */
.field { display: block; margin-bottom: 16px; text-align: left; }
.field > span { display: block; font-size: 0.86rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.field > span em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.field input, .field select, .field textarea, .row-form input, .search-row input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 0.96rem; color: var(--ink); background: #fff; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.row-form input:focus, .search-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.field textarea { resize: vertical; }
.field input[type="color"] { padding: 6px; height: 46px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-error { background: #fef2f2; color: #b91c1c; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; margin: 0 0 14px; }

/* ---------------- modal เล็ก (override ของ styles.css ที่เป็น modal ใหญ่สำหรับ PDF) ---------------- */
.modal-card.modal-sm { width: min(480px, 96vw); height: auto; max-height: 92vh; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-sm .modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 6px 0 0; border-top: none; }
.modal-sm .modal-foot .btn { flex: 0 0 auto; min-width: 110px; }

/* ---------------- หน้าต่างเข้าสู่ระบบ ---------------- */
.login-body { text-align: center; }
.login-logo { border-radius: 50%; margin: 4px auto 10px; display: block; }
.login-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 20px; }
.google-btn-wrap { display: flex; justify-content: center; min-height: 44px; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; margin: 18px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-switch {
  background: none; border: none; color: #4338ca; font-family: "Prompt", sans-serif;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; padding: 6px; border-radius: 8px; width: 100%;
}
.login-switch:hover { background: rgba(99, 102, 241, 0.08); }
.login-form { text-align: left; margin-top: 4px; }
.login-form .btn-block { margin-top: 4px; }
.login-form .login-switch { margin-top: 10px; }
.login-hint { color: var(--muted); font-size: 0.82rem; margin: 14px 0 0; }

/* ---------------- เมนูผู้ใช้บน topbar ---------------- */
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; line-height: 0; }
.user-chip:hover .user-avatar { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.user-chip[aria-expanded="true"] .user-avatar { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.42); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  font-family: "Prompt", sans-serif; font-size: 0.82rem; font-weight: 700;
  line-height: 1; color: #fff; background: #6366f1; text-transform: uppercase;
  user-select: none; transition: box-shadow 0.15s ease;
}
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 248px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.4); padding: 8px; z-index: 60;
  animation: pop 0.18s ease;
}
.ud-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ud-head strong { display: block; font-family: "Prompt", sans-serif; font-size: 0.96rem; }
.ud-head span { display: block; color: var(--muted); font-size: 0.82rem; word-break: break-all; }
.ud-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: "Prompt", sans-serif; font-size: 0.92rem; color: var(--ink);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.ud-item:hover { background: #f1f5f9; }

/* ป้าย role */
.role-badge {
  display: inline-block; margin-top: 8px; font-family: "Prompt", sans-serif;
  font-size: 0.74rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
}
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-member { background: #dcfce7; color: #15803d; }

/* ---------------- โซนสมาชิก (mobile-first: base = ซ้อนแนวตั้ง, sidebar เป็น drawer) ---------------- */
.container.member-zone { padding: 24px 0 80px; }
/* ในโซนสมาชิก: ซ่อนเมนูสาธารณะบน topbar (เมนูหลักอยู่ sidebar) */
body.is-member .nav-menu { display: none; }

.m-sidebar {
  display: none; flex-direction: column; margin-bottom: 18px;
  background: var(--card); border: 1px solid #eef2ff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}
.m-sidebar.open { display: flex; } /* มือถือ: เปิด drawer ด้วย hamburger */
.m-nav { display: flex; flex-direction: column; gap: 3px; }
.m-side-foot { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.m-nav-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: "Prompt", sans-serif; font-size: 0.92rem; color: var(--ink);
  padding: 10px 12px; border-radius: 10px; cursor: pointer; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-nav-item:hover { background: #f1f5f9; }
.m-nav-item.active { background: rgba(99, 102, 241, 0.12); color: #4338ca; font-weight: 600; }
.m-nav-item.is-danger { color: #b91c1c; }
.m-nav-item.is-danger:hover { background: #fee2e2; }

/* กลุ่มเมนู sidebar (collapse/expand) */
.m-group + .m-group { margin-top: 6px; }
.m-group-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; cursor: pointer;
  font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.74rem;
  letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted);
  padding: 8px 12px 6px; border-radius: 8px;
}
.m-group-head:hover { background: #f8fafc; }
.m-caret { flex-shrink: 0; transition: transform 0.18s ease; }
.m-group.collapsed .m-caret { transform: rotate(-90deg); }
.m-group.collapsed .m-group-body { display: none; }
.m-group-body { display: flex; flex-direction: column; gap: 3px; }

.m-content { flex: 1; min-width: 0; }
.panel-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#manage-panels { display: flex; flex-direction: column; gap: 22px; }
.manage-denied { text-align: center; }
.manage-denied h2 { margin: 6px 0; font-size: 1.2rem; }

.panel {
  background: var(--card); border-radius: var(--radius); padding: 22px 22px 24px;
  box-shadow: var(--shadow); border: 1px solid #eef2ff;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.12rem; margin: 0; }
.count { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.83rem; margin: 10px 0 0; }
.row-form { display: flex; flex-direction: column; gap: 10px; }
.search-row { margin-bottom: 14px; }

/* หมวดหมู่ */
.cat-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 8px 7px 14px; background: #fff;
}
.cat-pill .dot { width: 12px; height: 12px; border-radius: 50%; }
.cat-pill .nm { font-family: "Prompt", sans-serif; font-size: 0.9rem; }
.cat-pill .mini { background: #f1f5f9; border: none; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 0.85rem; color: var(--muted); }
.cat-pill .mini:hover { background: #e2e8f0; }

/* รายการแบบฟอร์ม */
.forms-list { display: flex; flex-direction: column; gap: 12px; }
.form-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  border: 1px solid #eef2ff; border-radius: 14px; padding: 14px 16px; background: #fff;
  border-left: 5px solid var(--accent, #3b82f6);
}
.form-row .ficon { font-size: 1.4rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft, #eff6ff); flex-shrink: 0; }
.form-row .finfo { flex: 1; min-width: 0; }
.form-row .fcode { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.74rem; color: var(--accent, #3b82f6); }
.form-row .ftitle { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 1rem; margin: 1px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-row .fdesc { font-size: 0.84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-row .ffiles { display: flex; gap: 7px; width: 100%; }
.form-row .factions { display: flex; gap: 7px; width: 100%; }

.fbadge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Prompt", sans-serif; font-size: 0.78rem; font-weight: 500;
  border-radius: 10px; padding: 7px 10px; cursor: pointer; border: 1.5px solid transparent;
}
.fbadge.pdf.on { background: #fee2e2; color: #b91c1c; }
.fbadge.docx.on { background: #dbeafe; color: #1d4ed8; }
.fbadge.off { background: #f8fafc; color: #94a3b8; border-color: var(--line); border-style: dashed; }
.fbadge:hover { filter: brightness(0.98); }
.fbadge .x { font-size: 0.7rem; opacity: 0.7; }

.empty-msg { text-align: center; color: var(--muted); padding: 28px 0; }

/* ตารางผู้ใช้/สมาชิก */
.users-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.users-toolbar #user-search,
.users-toolbar #user-group-filter,
.users-toolbar #user-role-filter {
  flex: 1 1 100%; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: 0.9rem; background: #fff;
}
.users-toolbar #user-search:focus,
.users-toolbar #user-group-filter:focus,
.users-toolbar #user-role-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); outline: none; }
@media (min-width: 561px) {
  .users-toolbar #user-search { flex: 2 1 220px; }
  .users-toolbar #user-group-filter { flex: 1 1 170px; }
  .users-toolbar #user-role-filter { flex: 1 1 170px; }
}
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border: 1px solid #eef2ff; border-radius: 12px; padding: 12px 14px; background: #fff;
}
.user-row .u-main { flex: 1; min-width: 0; }
.user-row .u-name { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.96rem; display: flex; align-items: center; gap: 7px; }
.user-row .u-email { font-size: 0.84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.user-row .u-self { color: #4338ca; }
.u-google { font-size: 0.66rem; font-weight: 700; background: #e0e7ff; color: #4338ca; width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; }
.user-row .u-code { font-size: 0.72rem; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef2ff; color: #4338ca; padding: 1px 7px; border-radius: 6px; letter-spacing: 0.3px; }
.user-row .u-group { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.user-row .role-badge { white-space: nowrap; margin-left: auto; }

/* สวิตช์เลือกรูปแบบบัญชี (กล่องเพิ่มสมาชิก) */
.seg { display: flex; gap: 6px; margin-bottom: 16px; }
.seg-btn { flex: 1; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font: inherit; cursor: pointer; }
.seg-btn.is-on { background: #eff6ff; border-color: var(--primary); color: #1d4ed8; font-weight: 600; }

/* ป้าย role เสริมบนแถวสมาชิก — บอกชัดว่าใครถือสิทธิ์อะไร */
.user-row .u-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.u-role-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600;
  background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; padding: 2px 9px; border-radius: 999px; }
.user-row .u-roles-btn.is-on { border-color: #86efac; background: #f0fdf4; }

/* หน้า "สิทธิ์ (Role)" — การ์ดต่อ role: สิทธิ์รายหน้า + ผู้ถือ */
.roles-list { display: flex; flex-direction: column; gap: 12px; }
.role-card { border: 1px solid #eef2ff; border-radius: 14px; padding: 14px 16px; background: #fff; display: grid; gap: 9px; }
.role-card.is-base { background: #f8fafc; border-style: dashed; }
.role-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-name { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.role-lock { font-size: 0.85rem; }
.role-count { font-size: 0.78rem; color: var(--muted); background: #f1f5f9; padding: 2px 9px; border-radius: 999px; }
.role-card-actions { margin-left: auto; display: flex; gap: 6px; }
.role-descr { font-size: 0.85rem; color: var(--muted); margin: 0; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.perm-chip.view { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.perm-chip.edit { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.perm-chip.none { background: #f8fafc; color: #94a3b8; border-color: var(--line); border-style: dashed; }
.role-holders { display: flex; flex-wrap: wrap; gap: 6px; }
.role-holder { font-size: 0.78rem; color: var(--ink); background: #f8fafc; border: 1px solid var(--line); padding: 3px 9px; border-radius: 8px; }
.role-holder .u-code { font-size: 0.68rem; }
.role-holders-empty { font-size: 0.8rem; color: var(--muted); }

/* ตารางสิทธิ์รายหน้าในกล่องเพิ่ม/แก้ไข role (แถวละหน้า × ไม่มีสิทธิ์/ดู/แก้ไข) */
.perm-matrix { display: grid; gap: 8px; }
.perm-row { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: grid; gap: 6px; }
.perm-page b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.perm-page small { display: block; color: var(--muted); font-size: 0.76rem; }
.perm-opts { display: flex; gap: 4px; flex-wrap: wrap; }
.perm-opt { display: inline-flex; align-items: center; cursor: pointer; }
.perm-opt input { position: absolute; opacity: 0; pointer-events: none; }
.perm-opt span { font-size: 0.78rem; font-weight: 600; color: var(--muted); border: 1.5px solid var(--line);
  padding: 4px 11px; border-radius: 999px; background: #fff; transition: background .12s, color .12s, border-color .12s; }
.perm-opt input:checked + span { background: #eef2ff; color: #4338ca; border-color: #a5b4fc; }
.perm-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

/* รายการ role ใน dialog จัดการ role ของสมาชิก */
.ur-list { display: grid; gap: 8px; margin-bottom: 12px; }
.ur-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.ur-item:hover { background: #f8fafc; }
.ur-item input { margin-top: 3px; flex: none; }
.ur-item-main { display: grid; gap: 3px; min-width: 0; }
.ur-item-main b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.ur-item-main small { color: var(--muted); font-size: 0.78rem; }
.ur-item-perms { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------- ภาพรวมเกม/รางวัล (admin) ---------------- */
.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border: 1px solid #eef2ff; border-left: 5px solid #8b5cf6;
  border-radius: 12px; padding: 12px 14px; background: #fff;
}
.game-row .g-main { flex: 1; min-width: 0; }
.game-row .g-name { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.96rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.game-row .g-handle { font-size: 0.76rem; font-weight: 500; color: #7c3aed; background: #f3e8ff; padding: 1px 9px; border-radius: 999px; }
.game-row .g-stats { font-size: 0.85rem; color: var(--ink); margin-top: 3px; }
.game-row .g-tree { font-size: 0.83rem; color: var(--muted); margin-top: 2px; }
.game-row .g-reset { flex-shrink: 0; }
@media (min-width: 721px) { .game-row { flex-wrap: nowrap; } }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 12px 22px; border-radius: 14px;
  font-family: "Prompt", sans-serif; font-size: 0.92rem; z-index: 80;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5); animation: toastIn 0.25s ease;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ===== mobile-first: เพิ่ม layout ตามความกว้างจอ ===== */
@media (min-width: 481px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .row-form { flex-direction: row; }
  .row-form input { flex: 1; }
}
@media (min-width: 721px) {
  .form-row { flex-wrap: nowrap; }
  .form-row .ffiles, .form-row .factions { width: auto; flex-shrink: 0; }
  .user-row { flex-wrap: nowrap; }
}
@media (min-width: 1025px) {
  /* เดสก์ท็อป: app-shell — sidebar ค้างซ้าย, หัว(ตัวตน)+ท้าย(ออกจากระบบ) ปักไว้เสมอ,
     เฉพาะ "รายการเมนู" ตรงกลางเลื่อนในตัวเองเมื่อยาวเกินจอ
     (เลิกใช้ margin-top:auto ในกล่อง overflow ที่ทำให้เมนูล่างหลุด/โดนตัดของเดิม) */
  .container.member-zone { display: flex; align-items: flex-start; gap: 26px; }
  .m-sidebar {
    display: flex; flex-direction: column; width: 258px; flex-shrink: 0;
    position: sticky; top: 84px; margin-bottom: 0;
    max-height: calc(100dvh - 104px); overflow: hidden;
  }
  .m-sidebar .mz-id { flex-shrink: 0; }
  .m-nav-scroll {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -6px; padding: 2px 6px;
    scrollbar-width: thin; scrollbar-color: rgba(99, 102, 241, 0.32) transparent;
  }
  .m-nav-scroll::-webkit-scrollbar { width: 8px; }
  .m-nav-scroll::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.22); border-radius: 8px; }
  .m-nav-scroll::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.4); }
  .m-side-foot { flex-shrink: 0; }
}

/* ---- แผงค่าตั้ง + ตารางรายวัน "ขอออกนอกบริเวณ" (admin) — คลาส ck-* ใช้ร่วม (เดิมเป็นของเช็คอินที่ถอดออกแล้ว) ---- */
.ck-config { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.ck-config label { display: grid; gap: 4px; font-size: .85rem; color: #475569; }
/* อินพุตในแผงค่าตั้ง "ขอออกนอกบริเวณ": เดิมหลุดเป็น native (ขอบ inset เทา มุมเหลี่ยม)
   — ให้ธีมเดียวกับช่องค้นหา/ตัวกรอง/ฟอร์มทั้งแอป (ขอบ 1.5px var(--line) มุมมน + โฟกัสวงสีหลัก) */
.ck-config input:not([type="checkbox"]),
.ck-list-head input[type="date"] {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 0.9rem; color: var(--ink); background: #fff; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ck-config input:not([type="checkbox"]):focus,
.ck-list-head input[type="date"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring);
}
.ck-config input[type="number"] { width: 140px; }
.ck-enabled-label { flex-direction: row; align-items: center; display: flex; gap: 6px; }
.ck-config-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ck-list-head { margin-top: 20px; }
.ck-table { width: 100%; border-collapse: collapse; }
.ck-table th, .ck-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
.ck-table th { font-size: .8rem; color: #64748b; font-weight: 600; }

/* ---- เลขที่หนังสือ records (แอดมิน: badge + กล่องกรอกในแถว) ---- */
.rec-docno { display: inline-flex; align-items: center; font-size: 0.8rem; font-weight: 600; color: #4338ca; background: #eef2ff; border-radius: 999px; padding: 3px 10px; }
.rec-docno-input { font-family: inherit; font-size: 0.85rem; padding: 5px 9px; border: 1px solid #c7d2fe; border-radius: 8px; width: 200px; max-width: 60%; }
.rec-docno-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

/* ---- ปุ่มให้สิทธิ์ leave_admin + แผงออกนอกบริเวณ ---- */
.u-leave.is-on { background: #ede9fe; border-color: #c4b5fd; }
.lvc-cidr-label { flex: 1 1 100%; }
.lvc-cidr-label input { width: 100%; }
.lv-ev a { margin-right: 6px; text-decoration: none; white-space: nowrap; }
.lv-cancelled { opacity: 0.5; }
.ck-table td { vertical-align: top; }

/* แถบกรองรายงานออกนอกบริเวณ — ช่วงวันที่ (จาก/ถึง) วางในแถวเดียวกับค้นหา/สถานะ */
.lv-toolbar { align-items: center; }
.lv-toolbar .lv-range { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #475569; }
.lv-toolbar .lv-range input[type="date"] {
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 0.88rem; background: #fff;
}
.lv-toolbar .lv-range input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); outline: none; }

/* แผนที่พิกัดที่ตั้งไว้ (หน้าตั้งค่า) */
.lvc-map-wrap { margin-top: 18px; display: grid; gap: 8px; }
.lvc-map-head { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 0.95rem; color: var(--ink); margin: 0; }
.gmap-embed { width: 100%; height: 300px; border: 0; border-radius: 14px; display: block; border: 1px solid var(--line); }
