@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600;700&display=swap');

:root {
  /* macOS-inspired light design system */
  --color-forest-900: #183153;
  --color-forest-700: #315C86;
  --color-forest-500: #2D7FD3;
  --color-ocean-700: #1669C9;
  --color-ocean-500: #2B86E5;
  --color-teal-500: #19A9A6;
  --color-teal-100: #E4F7F5;
  --color-ochre-500: #C58C3A;
  --color-ochre-600: #996821;
  --color-bg: #F2F5F8;
  --color-surface: rgba(255, 255, 255, 0.86);
  --color-border: rgba(72, 91, 112, 0.16);
  --color-text: #1C2A39;
  --color-text-muted: #6B7C8E;
  --color-danger: #B84D55;
  --color-danger-bg: #FDEDEF;
  --color-success: #187E6B;

  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-card: 0 1px 2px rgba(28, 44, 61, 0.04), 0 16px 42px rgba(48, 73, 101, 0.10);
  --shadow-float: 0 24px 70px rgba(27, 44, 64, 0.22);
  --control-height: 40px;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Thonburi", "Noto Sans Thai", "Sarabun", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(116, 192, 255, 0.20), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(167, 218, 235, 0.18), transparent 24%),
    linear-gradient(145deg, #EAF2FA 0%, #F5F8FC 50%, #EAF1F8 100%);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3 { font-weight: 600; margin: 0 0 8px; color: var(--color-forest-900); }

a { color: var(--color-forest-500); }

/* ---------- หน้าจอศูนย์กลาง (login/register/pending) ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px) saturate(145%);
  padding: 36px 32px;
}

.auth-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 16, 68, 0.15);
}

.auth-mark img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.auth-mark svg { width: 24px; height: 24px; }

.auth-card h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-forest-900);
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  background: #FAFCFE;
  color: var(--color-text);
}

.field input:focus {
  outline: none;
  border-color: var(--color-forest-500);
  box-shadow: 0 0 0 3px rgba(35, 134, 182, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary { background:linear-gradient(180deg,#3695ED,#1671D7); color:#fff; border:1px solid rgba(13,91,170,.32); box-shadow:0 5px 14px rgba(22,105,201,.18), inset 0 1px rgba(255,255,255,.22); }
.btn-primary:hover { background:linear-gradient(180deg,#2C8BE4,#1065C4); transform:translateY(-1px); box-shadow:0 7px 18px rgba(22,105,201,.24); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,.72);
  color: var(--color-forest-700);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background:#fff; border-color:rgba(69,126,181,.35); box-shadow:0 5px 14px rgba(44,84,126,.08); }

.auth-footer {
  margin-top: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--color-text-muted);
}

.error-box {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: none;
}

.error-box.visible { display: block; }

/* ---------- แอปหลัก (dashboard) ---------- */
.app-shell { min-height: 100vh; }

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(22px) saturate(150%);
}

.app-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--color-forest-900);
}

.app-topbar .brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-topbar .brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.role-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(22, 166, 178, 0.12);
  color: var(--color-forest-700);
}

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.module-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(62, 97, 134, .05);
  backdrop-filter: blur(16px);
}

.module-card h3 { font-size: 16px; margin-bottom: 6px; }
.module-card p { font-size: 14px; color: var(--color-text-muted); margin: 0; }
.module-card .soon {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-ochre-600);
  font-weight: 600;
}

/* ---------- ตารางแอดมิน ---------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:0 12px 34px rgba(57,91,128,.07);
  backdrop-filter:blur(18px) saturate(135%);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
th { color:var(--color-forest-900); background:rgba(237,243,249,.82); font-weight:600; font-size:13px; letter-spacing:.01em; }
tbody tr { transition:background .15s ease; }
tbody tr:hover { background:rgba(227,241,252,.58); }
tr:last-child td { border-bottom: none; }

select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  background: rgba(255,255,255,.68);
  color:var(--color-text);
}

input, textarea {
  border:1px solid var(--color-border);
  border-radius:10px;
  background:rgba(255,255,255,.68);
  color:var(--color-text);
  font:inherit;
  padding:9px 11px;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:focus, textarea:focus, select:focus {
  outline:none;
  border-color:#7EB6D3;
  background:#fff;
  box-shadow:0 0 0 3px rgba(35,134,182,.12);
}

/* ---------- ปุ่มเลือกไฟล์กลางของระบบ ---------- */
input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 5px;
  border: 1px solid rgba(112, 150, 184, .30);
  border-radius: 12px;
  background: rgba(248, 252, 255, .90);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 14px rgba(56, 96, 136, .05);
}

input[type="file"][hidden] { display: none; }

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  min-height: 36px;
  margin: 0 11px 0 0;
  padding: 7px 14px;
  border: 1px solid rgba(69, 132, 184, .24);
  border-radius: 9px;
  background: linear-gradient(180deg, #f8fcff 0%, #e6f2fb 100%);
  color: #1d5d8b;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(41, 104, 153, .10), inset 0 1px 0 #fff;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

input[type="file"]:hover::file-selector-button,
input[type="file"]:hover::-webkit-file-upload-button {
  border-color: rgba(43, 134, 229, .44);
  background: linear-gradient(180deg, #edf8ff 0%, #d7ecfa 100%);
  color: #15527f;
  box-shadow: 0 4px 12px rgba(41, 104, 153, .15), inset 0 1px 0 #fff;
}

input[type="file"]:active::file-selector-button,
input[type="file"]:active::-webkit-file-upload-button {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(41, 104, 153, .12), inset 0 1px 0 #fff;
}

input[type="file"]:focus-visible {
  outline: none;
  border-color: #68a9d3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35,134,182,.13), 0 4px 14px rgba(56,96,136,.06);
}

button, a { -webkit-tap-highlight-color:transparent; }
.btn { transition:background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }

html.embedded, html.embedded body { background:transparent; }
html.embedded .app-topbar { display:none; }
html.embedded .app-main { max-width:none; padding:20px; }

.status-active { color: var(--color-success); font-weight: 600; }
.status-disabled { color: var(--color-danger); font-weight: 600; }
.status-pending { color: var(--color-ochre-600); font-weight: 600; }

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 60px 24px;
}

/* =========================================================
   macOS-inspired unified interface — shared by every module
   ========================================================= */

::selection { color:#fff; background:rgba(0,122,255,.78); }

* {
  scrollbar-width:thin;
  scrollbar-color:rgba(91,111,132,.34) transparent;
}
*::-webkit-scrollbar { width:10px; height:10px; }
*::-webkit-scrollbar-track { background:transparent; }
*::-webkit-scrollbar-thumb {
  min-height:34px;
  border:3px solid transparent;
  border-radius:999px;
  background:rgba(91,111,132,.34);
  background-clip:padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color:rgba(68,90,113,.52); }

h1,h2,h3,h4,h5,h6 {
  letter-spacing:-.018em;
  line-height:1.28;
}
h1 { font-size:clamp(24px,3vw,32px); }
h2 { font-size:clamp(20px,2.3vw,25px); }
h3 { font-size:17px; }
p { text-wrap:pretty; }
a { text-underline-offset:3px; }

button,input,textarea,select { font-family:var(--font-body); }
button { user-select:none; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
  min-height:var(--control-height);
  border:1px solid rgba(71,94,118,.18);
  border-radius:10px;
  background:rgba(255,255,255,.78);
  box-shadow:inset 0 1px 1px rgba(22,43,64,.035),0 1px 0 rgba(255,255,255,.74);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
textarea { min-height:88px; resize:vertical; }
input::placeholder,textarea::placeholder { color:#94A2B0; opacity:1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
textarea:hover,
select:hover { border-color:rgba(63,103,142,.30); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus,
select:focus {
  border-color:#67ADEC;
  background:#fff;
  box-shadow:0 0 0 3px rgba(0,122,255,.13),inset 0 1px 1px rgba(22,43,64,.025);
}
input[type="checkbox"],input[type="radio"] {
  accent-color:#0A84FF;
  width:16px;
  height:16px;
}
input[type="search"]::-webkit-search-cancel-button { cursor:pointer; }

.btn {
  min-height:38px;
  padding:8px 15px;
  border-radius:10px;
  letter-spacing:-.006em;
  box-shadow:0 1px 1px rgba(25,46,68,.04);
}
.btn:active:not(:disabled) { transform:translateY(1px) scale(.995); }
.btn:disabled { filter:saturate(.55); }
.btn-primary {
  background:linear-gradient(180deg,#3195F4 0%,#0879E5 100%);
  border-color:rgba(0,94,191,.42);
  box-shadow:0 5px 14px rgba(0,105,217,.20),inset 0 1px rgba(255,255,255,.30);
}
.btn-primary:hover {
  background:linear-gradient(180deg,#268BE9 0%,#006ED5 100%);
  box-shadow:0 7px 18px rgba(0,105,217,.26),inset 0 1px rgba(255,255,255,.28);
}
.btn-ghost {
  color:#34526F;
  background:linear-gradient(180deg,rgba(255,255,255,.90),rgba(242,247,251,.84));
  border-color:rgba(78,102,127,.18);
  box-shadow:0 1px 2px rgba(32,56,79,.05),inset 0 1px rgba(255,255,255,.78);
}
.btn-ghost:hover {
  color:#165F9F;
  background:#fff;
  border-color:rgba(0,122,255,.28);
}
button:focus-visible,a:focus-visible,.btn:focus-visible {
  outline:3px solid rgba(0,122,255,.22);
  outline-offset:2px;
}

.panel,.module-card,.auth-card {
  border-color:rgba(73,94,117,.14);
  background:rgba(255,255,255,.84);
  box-shadow:var(--shadow-card);
  backdrop-filter:blur(22px) saturate(135%);
}
.panel { border-radius:var(--radius-lg); }
.module-card {
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.module-card:hover {
  transform:translateY(-2px);
  border-color:rgba(0,122,255,.20);
  box-shadow:0 18px 42px rgba(42,70,99,.13);
}

.app-topbar {
  min-height:58px;
  position:sticky;
  top:0;
  z-index:40;
  padding:11px 22px;
  background:rgba(247,250,253,.78);
  border-bottom-color:rgba(72,91,112,.13);
  box-shadow:0 1px 0 rgba(255,255,255,.70);
  backdrop-filter:blur(28px) saturate(155%);
}
.app-topbar .brand { letter-spacing:-.01em; }
.app-topbar .brand-mark {
  width:34px;
  height:34px;
  border-radius:10px;
  box-shadow:0 3px 10px rgba(38,63,88,.10);
}
.app-user a,.page-back {
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:#3E668D;
  text-decoration:none;
  font-weight:600;
}
.app-user a:hover,.page-back:hover { color:#0878DA; }
.app-main { max-width:1240px; padding:28px 26px 48px; }

table {
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
th,td { padding:11px 14px; }
th {
  color:#415A72;
  background:rgba(239,244,249,.92);
  border-bottom-color:rgba(75,95,115,.13);
  font-size:11px;
  font-weight:700;
  letter-spacing:.025em;
  text-transform:none;
}
td { border-bottom-color:rgba(75,95,115,.11); }
tbody tr { transition:background-color .14s ease; }
tbody tr:hover { background:rgba(226,240,252,.52); }

.role-chip,.badge,.status,.status-pill,.pill {
  letter-spacing:.005em;
  box-shadow:inset 0 0 0 1px rgba(45,75,102,.04);
}
.error-box {
  border:1px solid rgba(184,77,85,.16);
  box-shadow:0 6px 18px rgba(151,55,64,.06);
}
.empty-state,.empty {
  color:#7A8998;
}

.modal-backdrop {
  background:rgba(21,35,50,.28) !important;
  backdrop-filter:blur(10px) saturate(115%);
}
.modal,.modal-panel {
  border:1px solid rgba(255,255,255,.78);
  background:rgba(250,252,254,.96) !important;
  border-radius:20px !important;
  box-shadow:var(--shadow-float) !important;
  animation:mac-modal-in .18s cubic-bezier(.2,.75,.25,1);
}
dialog {
  border:1px solid rgba(255,255,255,.78);
  background:rgba(250,252,254,.97);
  box-shadow:var(--shadow-float);
}
dialog::backdrop {
  background:rgba(21,35,50,.28);
  backdrop-filter:blur(10px);
}
@keyframes mac-modal-in {
  from { opacity:0; transform:translateY(8px) scale(.985); }
  to { opacity:1; transform:translateY(0) scale(1); }
}

input[type="file"] {
  min-height:46px;
  border-style:dashed;
  border-color:rgba(68,115,157,.30);
  background:rgba(245,250,254,.88);
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  background:linear-gradient(180deg,#fff,#EAF3FA);
  border-color:rgba(60,113,157,.22);
}

html.embedded,html.embedded body {
  background:transparent !important;
}
html.embedded .app-main {
  max-width:none;
  padding:18px 20px 30px;
}
html.embedded .page-back { display:none; }

@media (max-width:720px) {
  .app-main { padding:20px 14px 36px; }
  .app-topbar { padding:10px 14px; }
  .panel { border-radius:14px; }
  th,td { padding:10px 12px; }
  .modal,.modal-panel { border-radius:17px !important; }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}

/* Cloudflare Turnstile (กันบอท) */
.turnstile-box{min-height:65px;margin:4px 0 14px}

/* ชื่อคนในตารางอยู่บรรทัดเดียว — ตารางในแผงเลื่อนซ้ายขวาได้แทน (span.nm ใส่ให้อัตโนมัติจาก api.js) */
td .nm { white-space: nowrap; }
.panel:has(> table), .panel:has(> * > table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== ลิงก์ทั้งระบบเป็นปุ่มการ์ด (ไม่มีขีดเส้นใต้ / ไม่เป็นข้อความเปล่า) ทั้งมือถือและ PC ===== */
a { text-decoration:none; }
.btn { text-decoration:none; }
:where(a:not([class]):not(:has(img,svg,canvas)):not(nav a):not(.sidebar a):not([role=tab],[role=menuitem],[role=option])),
:where(a.page-back,a.link-chip) {
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 14px; min-height:36px;
  border:1px solid #cfe0ef; border-radius:11px;
  background:linear-gradient(180deg,#fff,#f3f8fd);
  color:#1D5F9E; font-weight:600; line-height:1.3;
  text-decoration:none; vertical-align:middle;
  box-shadow:0 1px 2px rgba(30,60,90,.06),0 3px 10px rgba(30,60,90,.05);
  transition:background .15s,border-color .15s,box-shadow .15s,transform .12s;
  cursor:pointer;
}
:where(a:not([class]):not(:has(img,svg,canvas)):not(nav a):not(.sidebar a):not([role=tab],[role=menuitem],[role=option])):hover,
:where(a.page-back,a.link-chip):hover { background:#e9f3fc; border-color:#a9cbe9; color:#0b5fae; box-shadow:0 4px 14px rgba(22,105,201,.12); }
:where(a:not([class]):not(:has(img,svg,canvas)):not(nav a):not(.sidebar a):not([role=tab],[role=menuitem],[role=option])):active,
:where(a.page-back,a.link-chip):active { transform:scale(.97); }
/* ในตาราง/บรรทัดข้อความ ใช้ขนาดเล็กลง */
:where(:is(td,th,li,p,small,.tw-current) > a:not([class]):not(:has(img,svg,canvas))) { padding:3px 10px; min-height:28px; font-size:.92em; border-radius:9px; margin:2px 1px; }
@media (max-width:720px){ :where(a:not([class]):not(:has(img,svg,canvas)):not(nav a):not(.sidebar a)), :where(a.page-back,a.link-chip){ min-height:40px; } :where(:is(td,th,li,p,small,.tw-current) > a:not([class]):not(:has(img,svg,canvas))){ min-height:34px; } }
/* หน้าเข้าสู่ระบบ/สมัคร/ลืมรหัสผ่าน: ลิงก์เป็นข้อความธรรมดา ไม่ทำเป็นการ์ด */
.auth-card a:not([class]),.auth-card a:not([class]):hover,.auth-card a:not([class]):active{display:inline;padding:0;min-height:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none;font-weight:600;color:#1D5F9E}
.auth-card a:not([class]):hover{text-decoration:underline}
a[hidden]{display:none!important}

/* ===== หน้าเข้าสู่ระบบ/สมัคร/ลืมรหัส: สไตล์ premium (ปุ่มนูน + hover ไล่สีฟ้า) ===== */
.auth-shell{background:radial-gradient(circle at 20% 10%,#f7fbff,#e6eef7 70%)}
.auth-card{background:#f4f7fb;border:1px solid rgba(84,111,138,.12);border-radius:22px;box-shadow:0 24px 50px rgba(24,49,83,.16),-6px -6px 16px rgba(255,255,255,.7)}
.auth-card .auth-mark{border-radius:50%;background:#fff;box-shadow:0 0 0 4px #fff,0 0 0 5px rgba(53,80,201,.25),0 8px 18px rgba(36,72,112,.18)}
.auth-card input:not([type=checkbox]):not([type=radio]),.auth-card select{border:0;border-radius:12px;background:#eef3f8;box-shadow:inset 3px 3px 7px #d3dde8,inset -3px -3px 7px #fff;transition:box-shadow .2s,background .2s}
.auth-card input:not([type=checkbox]):not([type=radio]):focus,.auth-card select:focus{outline:none;background:#fff;box-shadow:inset 2px 2px 5px #d3dde8,inset -2px -2px 5px #fff,0 0 0 3px rgba(53,80,201,.25)}
.auth-card .btn{border:0;border-radius:12px;background:#fff;color:#28405a;font-weight:600;box-shadow:-3px -3px 7px #fff,3px 3px 8px #d3dde8;transition:background .2s,color .2s,transform .2s,box-shadow .2s}
.auth-card .btn:hover:not(:disabled),.auth-card .btn:focus-visible{background:linear-gradient(135deg,#7AA2F7,#3550C9);color:#fff;transform:translateY(-2px);box-shadow:0 8px 18px rgba(53,80,201,.3);outline:none}
.auth-card .btn-primary{background:linear-gradient(135deg,#7AA2F7,#3550C9);color:#fff;box-shadow:0 6px 16px rgba(53,80,201,.3)}
.auth-card .btn-primary:hover:not(:disabled){filter:brightness(1.05)}
.auth-card .btn:active:not(:disabled){transform:translateY(0);box-shadow:inset 2px 2px 6px rgba(0,0,0,.15)}

/* ===== สไตล์ premium ทั้งระบบ (โทนเย็น): ปุ่มนูน · ช่องกรอกยุบ · การ์ดนูน · hover ไล่สี =====
   สีหลักของหน้าทั่วไป = ฟ้า (--pm-a/--pm-b) ส่วนต่าง ๆ ใช้สีของตัวเอง: ค้นหา=เทอร์ควอยซ์ เมนูผู้ใช้=คราม แจ้งเตือน=ฟ้าน้ำทะเล ตัวเลขภาพรวม=เขียวมิ้นต์ */
:root{--pm-a:#58A8F0;--pm-b:#1A70CD;--pm-shadow:rgba(26,112,205,.3);--pm-raise:-3px -3px 7px rgba(255,255,255,.9),3px 3px 8px rgba(184,201,219,.55)}
.btn,.btn-ghost{border-color:transparent;border-radius:12px;background:#fff;color:#28405a;box-shadow:var(--pm-raise)}
.btn:hover:not(:disabled),.btn-ghost:hover:not(:disabled){background:linear-gradient(135deg,var(--pm-a),var(--pm-b));color:#fff;border-color:transparent;transform:translateY(-2px);box-shadow:0 8px 18px var(--pm-shadow)}
.btn-primary{background:linear-gradient(135deg,var(--pm-a),var(--pm-b));color:#fff;border-color:transparent;box-shadow:0 6px 16px var(--pm-shadow)}
.btn-primary:hover:not(:disabled){background:linear-gradient(135deg,var(--pm-a),var(--pm-b));filter:brightness(1.06)}
.btn:active:not(:disabled){transform:translateY(0);box-shadow:inset 2px 2px 6px rgba(0,0,0,.14)}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not(.global-search *),textarea,select{border-color:transparent;border-radius:12px;background-color:#eef3f8;box-shadow:inset 3px 3px 7px #d6e0ea,inset -3px -3px 7px #fff}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not(.global-search *):focus,textarea:focus,select:focus{border-color:transparent;background-color:#fff;box-shadow:inset 2px 2px 5px #d6e0ea,inset -2px -2px 5px #fff,0 0 0 3px rgba(26,112,205,.22)}
.panel,.module-card{border-color:rgba(84,111,138,.1);border-radius:18px;box-shadow:-6px -6px 16px rgba(255,255,255,.75),6px 8px 22px rgba(160,182,206,.35)}
.module-card:hover{transform:translateY(-3px);border-color:transparent;box-shadow:0 14px 30px var(--pm-shadow)}
table tbody tr{transition:background .15s}
table tbody tr:hover{background:rgba(88,168,240,.07)}

/* ===== ชุดการ์ดย่อทั้งระบบ: .pm-grid (หลายคอลัมน์) · .pm-card (การ์ดนูน+แถบสีสถานะ) · .pm-badge · .pm-more (ชี้เมาส์ดูรายละเอียด)
   สีสถานะโทนเย็น: st-ok=เสร็จ/อนุมัติ(มิ้นต์) st-wait=รอ(คราม) st-work=กำลังทำ(ฟ้า) st-warn=เลยกำหนด/ด่วน(น้ำเงินม่วงเข้ม) st-no=ไม่อนุมัติ(เทาน้ำเงิน) st-off=ยกเลิก/ปิด(เทาอ่อน) */
.pm-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;align-items:start}
.pm-card{--st:#58A8F0;position:relative;display:flex;flex-direction:column;gap:6px;min-width:0;padding:14px 14px 12px 18px;border:0;border-radius:16px;background:#fff;box-shadow:-4px -4px 10px rgba(255,255,255,.9),4px 6px 14px rgba(170,190,212,.45);transition:transform .18s,box-shadow .18s}
.pm-card::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:4px;border-radius:0 4px 4px 0;background:var(--st)}
.pm-card:hover{transform:translateY(-3px);box-shadow:0 12px 24px rgba(40,90,140,.18);z-index:21}
.st-ok{--st:#13a88a}.st-wait{--st:#5b6be8}.st-work{--st:#1a8fd0}.st-warn{--st:#3f37c9}.st-no{--st:#6b7f95}.st-off{--st:#a9b6c4}
.pm-badge{display:inline-block;flex:0 0 auto;padding:2px 9px;border-radius:999px;font-size:11.5px;font-weight:700;color:var(--st);background:color-mix(in srgb,var(--st) 12%,#fff);white-space:nowrap}
.pm-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.pm-title{margin:0;font-size:14px;font-weight:700;color:#1d3550;overflow-wrap:anywhere}
.pm-sub{font-size:12.5px;color:#6b8199}
.pm-more{position:absolute;left:8px;right:8px;top:calc(100% - 6px);z-index:20;padding:10px 12px;border-radius:12px;background:#1d3550;color:#eaf3ff;font-size:12.5px;line-height:1.55;box-shadow:0 14px 28px rgba(20,40,70,.28);opacity:0;visibility:hidden;transform:translateY(-4px);transition:opacity .16s,transform .16s,visibility 0s .16s;pointer-events:none}
.pm-more::before{content:"";position:absolute;top:-6px;left:22px;border:6px solid transparent;border-top:0;border-bottom-color:#1d3550}
.pm-more p{margin:0 0 3px;white-space:pre-wrap;overflow-wrap:anywhere}.pm-more p:last-child{margin:0}.pm-more b{color:#8fd3ff}
.pm-card:hover .pm-more{opacity:1;visibility:visible;transform:none;transition:opacity .16s,transform .16s}
@media(hover:none){.pm-more{display:none}}
