:root {
  --emerald-950: #0A211B;
  --emerald-900: #0F2E26;
  --emerald-800: #0B6B53;
  --emerald-700: #0E7C61;
  --turquoise: #0E8A72;
  --turquoise-h: #0B705C;
  --turquoise-l: #E3F6F1;
  --mint-bg: #F3F8F6;
  --mint-soft: #EBF5F1;
  --mint-border: #DCECE6;
  --card-bg: #FFFFFF;
  --gold: #C59B27;
  --gold-d: #9E7916;
  --gold-l: #FBF4DC;
  --danger-ret: #DC2626;
  --brown: #0B6B53;
  --brown-d: #0F2E26;
  --caramel: #0E8A72;
  --brown-l: #E3F6F1;
  --cream: #F3F8F6;
  --cream-2: #EBF5F1;
  --green: #0E8A72;
  --green-d: #0B6B53;
  --green-m: #14A387;
  --green-l: #E3F6F1;
  --line: #E0EFEA;
  --ink: #0F2922;
  --muted: #607D74;
}

/* ===== โหมดกลางคืน (Night / Dark Mode) ===== */
body.dark-mode {
  --mint-bg: #0A1814;
  --mint-soft: #132B24;
  --mint-border: #1E4036;
  --card-bg: #10241E;
  --turquoise-l: #15352C;
  --cream: #0A1814;
  --cream-2: #132B24;
  --green-l: #15352C;
  --line: #1D3D33;
  --ink: #E6F5F0;
  --muted: #8AB5A8;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans Thai', 'Prompt', 'Sarabun', sans-serif;
  background-color: var(--mint-bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-title, .kpi .num, .seg button, .sb-sec {
  font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
}

/* Explicit typographic hierarchy scale & Thai leading rhythm (Impeccable Typeset) */
h1 { font-size: 2.5rem; line-height: 1.25; font-weight: 700; text-wrap: balance; }
h2 { font-size: 2.0rem; line-height: 1.28; font-weight: 700; text-wrap: balance; }
h3 { font-size: 1.6rem; line-height: 1.32; font-weight: 650; text-wrap: balance; }
h4 { font-size: 1.25rem; line-height: 1.38; font-weight: 600; text-wrap: balance; }
h5 { font-size: 1.0625rem; line-height: 1.42; font-weight: 600; text-wrap: balance; }
h6 { font-size: 0.875rem; line-height: 1.45; font-weight: 600; text-wrap: balance; }

p, .text-muted, .form-text, .lead {
  text-wrap: pretty;
}

a {
  text-decoration: none;
  cursor: pointer;
  color: var(--turquoise);
  transition: all 0.2s ease;
}

body.role-student .staff-only { display: none !important; }
body.role-student .teacher-expert-only { display: none !important; }
body:not(.role-admin):not(.role-staff) .teacher-expert-only { display: none !important; }
body:not(.role-admin) .admin-only { display: none !important; }
body:not(.role-student) .student-only { display: none !important; }

/* ===== App Shell Layout (Sidebar + Topbar + Content) ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ===== Left Sidebar ===== */
.app-sidebar {
  width: 278px;
  background: linear-gradient(180deg, #091E18 0%, #0D2922 100%);
  color: #D1EAE2;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s ease;
}

.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ไม่ใส่กรอบไอคอนตรามหาวิทยาลัย */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff !important;
  flex: 1;
  min-width: 0;
}
.brand .logo {
  width: 40px;
  height: 50px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-text {
  min-width: 0;
  line-height: 1.28;
}
.brand-text b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
}
.brand-text small {
  display: block;
  font-size: 11.2px;
  color: #8FD1BE;
  line-height: 1.32;
}
.brand-text small span {
  display: block;
  white-space: nowrap;
}

.sb-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #B4D6CC;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.sb-toggle-btn:hover {
  background: rgba(14, 138, 114, 0.35);
  color: #ffffff;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 18px;
  scrollbar-width: thin;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sb-sec {
  font-size: 11px;
  font-weight: 600;
  color: #6B9A8B;
  padding: 14px 10px 6px;
  letter-spacing: 0.04em;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9.5px 12px;
  border-radius: 11px;
  color: #C2DFD6;
  font-weight: 500;
  font-size: 13.8px;
  margin-bottom: 3px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sb-link i {
  font-size: 15px;
  width: 22px;
  text-align: center;
  color: #7BB3A2;
  transition: color 0.2s ease;
}
.sb-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.sb-link:hover i { color: #5EEAD4; }
.sb-link.active {
  background: linear-gradient(90deg, #0E8A72 0%, #14A387 100%);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(14, 138, 114, 0.36);
}
.sb-link.active i { color: #ffffff; }

/* เวลาพับแถบเมนูด้านซ้าย (sb-collapsed) ให้ซ่อนโลโก้และชื่อระบบทั้งหมด */
body.sb-collapsed .app-sidebar { width: 72px; }
body.sb-collapsed .brand,
body.sb-collapsed .brand .logo,
body.sb-collapsed .brand-text,
body.sb-collapsed .sb-sec,
body.sb-collapsed .sb-link span { display: none !important; }
body.sb-collapsed .sb-head { justify-content: center; padding: 16px 8px; }
body.sb-collapsed .sb-link { justify-content: center; padding: 11px; }
body.sb-collapsed .sb-link i { font-size: 17px; width: auto; }

/* Mobile Sidebar Backdrop */
.sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 33, 27, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1035;
  display: none;
}
@media (max-width: 991px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  body.sb-mobile-open .app-sidebar { transform: translateX(0); }
  body.sb-mobile-open .sb-backdrop { display: block; }
}

/* ===== Main Content Wrapper & Topbar ===== */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: 62px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1025;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.crumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb-bar .c-home {
  color: var(--muted);
  cursor: pointer;
}
.crumb-bar .c-home:hover { color: var(--turquoise); }
.crumb-bar .c-cur {
  color: var(--ink);
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ปุ่มสลับโหมดกลางวัน / กลางคืน (จัดกึ่งกลางไอคอนทั้งแนวนอนและแนวตั้งเป๊ะ 100%) */
.theme-btn {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--mint-bg);
  color: var(--ink);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}
.theme-btn .theme-icon-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px;
  height: 18px;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.theme-btn svg,
.theme-btn i {
  display: block !important;
  width: 18px;
  height: 18px;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.theme-btn i::before {
  display: block !important;
  line-height: 1 !important;
  vertical-align: 0 !important;
}
.theme-btn:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
  transform: rotate(12deg);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-pill:hover {
  border-color: var(--turquoise);
  background: var(--mint-soft);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0E8A72, #0B6B53);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-info {
  line-height: 1.15;
  text-align: left;
}
.user-info b {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}
.user-info small {
  font-size: 11px;
  color: var(--turquoise);
  font-weight: 600;
}

.main {
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 44px;
  flex: 1;
}
@media (max-width: 767px) {
  .main { padding: 16px 14px 36px; }
  .app-topbar { padding: 0 14px; }
}

.page { display: none; }
.page.active {
  display: block;
  animation: fadePage 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadePage {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Page Banner Card ===== */
.page-banner {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.03);
}
.banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.b-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.b-chip.status {
  background: #DCFCE7;
  color: #15803D;
}
.b-chip.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
}
.b-chip.fac {
  background: #E0F2FE;
  color: #0369A1;
}
.b-chip.date {
  background: var(--mint-soft);
  color: var(--muted);
}

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-head .ic, .ic-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(14, 138, 114, 0.22);
  flex-shrink: 0;
}
.page-head h4 {
  margin: 0;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}

/* ===== Cards ===== */
.cardx {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.03);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.25s ease;
}
.cardx:hover {
  border-color: var(--turquoise);
  box-shadow: 0 8px 22px rgba(11, 107, 83, 0.07);
}

/* ===== Hero Banner ===== */
.hero {
  background: linear-gradient(130deg, #0B6B53 0%, #0E8A72 60%, #14A387 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(11, 107, 83, 0.16);
}
.hero::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

/* ===== KPI Cards ===== */
.kpi {
  padding: 20px;
  height: 100%;
  cursor: pointer;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s ease;
}
.kpi:hover {
  transform: translateY(-3px);
  border-color: var(--turquoise);
  box-shadow: 0 10px 24px rgba(14, 138, 114, 0.1);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: var(--bg, #E3F6F1);
  color: var(--c, #0E8A72);
}
.kpi-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--mint-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Prompt', sans-serif;
}
.kpi .num {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.kpi .lbl {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}
.kpi-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.kpi-foot .act {
  color: var(--turquoise);
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
}

/* ===== Buttons ===== */
.btn-main {
  background: var(--turquoise);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 15px;
  font-size: 13.5px;
  box-shadow: 0 3px 10px rgba(14, 138, 114, 0.2);
  transition: all 0.2s ease;
}
.btn-main:hover, .btn-main:focus {
  background: var(--emerald-800);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-brown {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 15px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-brown:hover, .btn-brown:focus {
  background: #0284C7;
  color: #ffffff;
}
.btn-soft {
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-soft:hover {
  background: var(--mint-soft);
  border-color: var(--turquoise);
  color: var(--turquoise);
}
.btn-dl-xlsx {
  background: #E8F8EE;
  color: #136B3D;
  border: 1px solid #BFEAD0;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-dl-xlsx:hover, .btn-dl-xlsx:focus-visible {
  background: #16A34A;
  color: #ffffff;
  border-color: #15803D;
}
.btn-dl-pdf {
  background: #FDECEC;
  color: #B42323;
  border: 1px solid #F7CACA;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-dl-pdf:hover, .btn-dl-pdf:focus-visible {
  background: #DC2626;
  color: #ffffff;
  border-color: #B91C1C;
}
.btn-dl-docx {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-dl-docx:hover, .btn-dl-docx:focus-visible {
  background: #0284C7;
  color: #ffffff;
  border-color: #0369A1;
}
body.dark-mode .btn-dl-xlsx {
  background: rgba(22, 163, 74, 0.22);
  color: #86EFAC;
  border-color: rgba(74, 222, 128, 0.42);
}
body.dark-mode .btn-dl-xlsx:hover, body.dark-mode .btn-dl-xlsx:focus-visible {
  background: #16A34A;
  color: #ffffff;
  border-color: #22C55E;
}
body.dark-mode .btn-dl-pdf {
  background: rgba(220, 38, 38, 0.22);
  color: #FCA5A5;
  border-color: rgba(248, 113, 113, 0.42);
}
body.dark-mode .btn-dl-pdf:hover, body.dark-mode .btn-dl-pdf:focus-visible {
  background: #DC2626;
  color: #ffffff;
  border-color: #EF4444;
}
body.dark-mode .btn-dl-docx {
  background: rgba(2, 132, 199, 0.24);
  color: #7DD3FC;
  border-color: rgba(56, 189, 248, 0.44);
}
body.dark-mode .btn-dl-docx:hover, body.dark-mode .btn-dl-docx:focus-visible {
  background: #0284C7;
  color: #ffffff;
  border-color: #38BDF8;
}
.btn-xs {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ===== Forms ===== */
.form-control {
  background-color: var(--card-bg);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 10px;
  font-size: 13.8px;
}
.form-control:focus {
  background-color: var(--card-bg);
  color: var(--ink);
  border-color: var(--turquoise);
  box-shadow: 0 0 0 0.2rem rgba(14, 138, 114, 0.14);
}
.form-control.is-invalid { border-color: #DC2626; }

/* ดีไซน์ Soft Grey Pill สำหรับ Dropdown Select ทุกจุดทั้งแอดมินและเจ้าหน้าที่ (ตามรูปที่ 1 และ 2) */
.form-select {
  border-radius: 9999px !important;
  background-color: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
  color: #1E293B !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  padding-left: 14px !important;
  padding-right: 32px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  transition: all 0.18s ease;
  line-height: 1.5;
}
.form-select:hover {
  background-color: #EEF2F6 !important;
  border-color: #CBD5E1 !important;
}
.form-select:focus {
  background-color: #FFFFFF !important;
  border-color: var(--turquoise) !important;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.15) !important;
  outline: none;
}
.form-select.is-invalid { border-color: #DC2626; }

body.dark-mode .form-select {
  background-color: #132B24 !important;
  border: 1px solid #1E4036 !important;
  color: #E6F5F0 !important;
  font-weight: 400 !important;
}
body.dark-mode .form-select:hover {
  background-color: #17382E !important;
  border-color: #2DD4BF !important;
}
body.dark-mode .form-select:focus {
  background-color: #10241E !important;
  border-color: #2DD4BF !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2) !important;
}
.form-check-input:checked {
  background-color: var(--turquoise);
  border-color: var(--turquoise);
}
.form-label {
  font-weight: 600;
  font-size: 12.8px;
  color: var(--ink);
  margin-bottom: 4px;
}
.dpk {
  max-width: 44px;
  padding-left: 6px;
  padding-right: 2px;
  color: transparent;
}
.sec {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  color: var(--turquoise);
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
  margin-top: 10px;
  font-size: 13.8px;
}

/* ===== ข้อ 3: ป้ายความคืบหน้า สถานะเอกสาร และป้าย ประวัติเดิม / สถานที่ฝึกปัจจุบัน อยู่ในกรอบแคปซูลบรรทัดเดียวสวยงาม ===== */
/* ป้ายสถานะฝึกและสถานะเอกสาร: กรอบทรงแท็กโค้งมนทันสมัย บรรทัดเดียวสวยงาม จุดสถานะนิ่งสะอาดตา */
.badge-st, .badge-pg, .badge-grp-cur, .badge-grp-hist {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  border-radius: 8px;
  padding: 4.5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  text-align: left;
  border: 1px solid transparent;
  line-height: 1.38;
  box-shadow: 0 1px 2px rgba(15, 41, 34, 0.04);
}
.badge-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 4.5px;
}

.badge-grp-cur {
  background: #DCFCE7;
  color: #15803D;
  border-color: #86EFAC;
}
.badge-grp-hist {
  background: #FFE4E6;
  color: #BE123C;
  border-color: #FDA4AF;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  gap: 4px;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2.5px 10px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
  color: var(--ink);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.25;
}
.chip.g {
  background: var(--turquoise-l);
  border-color: rgba(14, 138, 114, 0.3);
  color: var(--turquoise);
}
.chip.b {
  background: #E0F2FE;
  border-color: #BAE6FD;
  color: #0369A1;
}
.code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--ink);
}

/* ===== Search Box ===== */
.search-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 5px 6px 5px 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 700px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
}
.search-box input {
  border: 0 !important;
  box-shadow: none !important;
  font-size: 1rem;
  background: transparent !important;
  color: #0F2922 !important;
}

/* ===== Student Card & Stepper ===== */
.st-card {
  overflow: hidden;
  height: 100%;
}
.st-card .head {
  padding: 12px 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #ffffff;
}
.st-card .head .fw-bold,
.st-card .head .small {
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

/* แอนิเมชันแถบขั้นตอนความคืบหน้าการฝึก (.stepper): เส้นแสงไหลต่อเนื่อง + จุดไฟวิ่งตามเส้นครบทุกหัวข้อ + วงกลมกระพริบไล่จังหวะ */
@keyframes stepperLineFlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes stepperDotTravel {
  0% { left: -45%; opacity: 0; transform: translateY(-50%) scale(0.6); }
  20% { opacity: 1; transform: translateY(-50%) scale(1.1); }
  80% { opacity: 1; transform: translateY(-50%) scale(1.1); }
  100% { left: 45%; opacity: 0; transform: translateY(-50%) scale(0.6); }
}
@keyframes stepperNodeWave {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(14, 138, 114, 0.55);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 0 8px rgba(14, 138, 114, 0);
  }
}
@keyframes stepperCurWave {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.65);
  }
  50% {
    transform: scale(1.14);
    box-shadow: 0 0 0 9px rgba(2, 132, 199, 0);
  }
}
@keyframes stepperRetWave {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65);
  }
  50% {
    transform: scale(1.14);
    box-shadow: 0 0 0 9px rgba(220, 38, 38, 0);
  }
}
.stepper {
  display: flex;
  margin: 14px 0 8px;
  gap: 2px;
}
.stepper .st {
  flex: 1;
  min-width: 0;
  text-align: center;
  position: relative;
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
}
.stepper .st small {
  display: block;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.stepper .st::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  width: 100%;
  height: 3.5px;
  background: var(--line);
  border-radius: 4px;
}
.stepper .st:first-child::before,
.stepper .st:first-child::after { display: none !important; }
.stepper .st .b {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  margin: 0 auto 5px;
  font-weight: 700;
  font-size: 11.5px;
  transition: all 0.25s ease;
}
.stepper .st.done .b {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: #ffffff;
  animation: stepperNodeWave 2s infinite ease-in-out;
}
.stepper .st:nth-child(1).done .b { animation-delay: 0s; }
.stepper .st:nth-child(2).done .b { animation-delay: 0.3s; }
.stepper .st:nth-child(3).done .b { animation-delay: 0.6s; }
.stepper .st:nth-child(4).done .b { animation-delay: 0.9s; }
.stepper .st:nth-child(5).done .b { animation-delay: 1.2s; }
.stepper .st:nth-child(6).done .b { animation-delay: 1.5s; }

.stepper .st.done::before,
.stepper .st.cur::before,
.stepper .st.pulse-next::before {
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 30%, #34D399 50%, #0E8A72 70%, #0B6B53 100%);
  background-size: 200% 100%;
  animation: stepperLineFlow 2.2s linear infinite;
}
.stepper .st.pulse-next::before {
  opacity: 0.55;
}
.stepper .st.done::after,
.stepper .st.cur::after,
.stepper .st.pulse-next::after {
  content: '';
  position: absolute;
  top: 15.7px;
  left: -45%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px 2px rgba(52, 211, 153, 0.85);
  z-index: 1;
  animation: stepperDotTravel 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.stepper .st:nth-child(2)::after { animation-delay: 0s; }
.stepper .st:nth-child(3)::after { animation-delay: 0.45s; }
.stepper .st:nth-child(4)::after { animation-delay: 0.9s; }
.stepper .st:nth-child(5)::after { animation-delay: 1.35s; }
.stepper .st:nth-child(6)::after { animation-delay: 1.8s; }

.stepper .st.done small {
  color: var(--turquoise);
  font-weight: 600;
}
.stepper .st.cur .b {
  background: #0284C7;
  border-color: #0284C7;
  color: #ffffff;
  animation: stepperCurWave 1.6s infinite ease-in-out;
}
.stepper .st.cur small {
  color: var(--ink);
  font-weight: 700;
}
.stepper .st.ret .b {
  background: #DC2626;
  border-color: #DC2626;
  color: #ffffff;
  animation: stepperRetWave 1.6s infinite ease-in-out;
}
.stepper .st.ret::before {
  background: linear-gradient(90deg, #991B1B 0%, #DC2626 40%, #F87171 50%, #DC2626 60%, #991B1B 100%);
  background-size: 200% 100%;
  animation: stepperLineFlow 2.2s linear infinite;
}
.stepper .st.ret::after {
  content: '';
  position: absolute;
  top: 15.7px;
  left: -45%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F87171;
  box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.85);
  z-index: 1;
  animation: stepperDotTravel 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.stepper-custom-box {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  color: #0F766E;
  font-size: 12.2px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
body.dark-mode .stepper-custom-box {
  background: rgba(13, 148, 136, 0.16);
  border-color: rgba(45, 212, 191, 0.35);
  color: #5EEAD4;
}

.pbar {
  height: 7px;
  background: var(--mint-soft);
  border-radius: 9px;
  overflow: hidden;
}
.pbar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0B6B53, #14A387);
  border-radius: 9px;
  transition: width 0.6s ease;
}

/* ===== Bento Grid & Filter Bar ===== */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.bento > .b4 { grid-column: span 4; }
.bento > .b6 { grid-column: span 6; }
.bento > .b8 { grid-column: span 8; }
.bento > .b12 { grid-column: span 12; }
@media (max-width: 991px) {
  .bento > * { grid-column: span 12 !important; }
}
.card-t {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-t h5, .card-t h6 {
  margin: 0;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  text-wrap: balance;
}
.filterbar {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* ===== ตารางพร้อมหัวคอลัมน์กดเรียงลำดับได้ (Sortable Table) ===== */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-hover-bg: var(--mint-soft);
  --bs-table-hover-color: var(--ink);
  color: var(--ink);
}
.tablex thead th {
  background: var(--mint-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  padding: 10px 10px;
}
.tablex thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.tablex thead th.sortable:hover {
  background: var(--turquoise-l);
  color: var(--turquoise);
}
.tablex thead th.sortable .sort-ic {
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.45;
}
.tablex thead th.sortable.sorted {
  color: var(--turquoise);
  background: var(--turquoise-l);
}
.tablex thead th.sortable.sorted .sort-ic {
  opacity: 1;
  color: var(--turquoise);
}
.tablex td {
  vertical-align: middle;
  border-color: var(--line);
  font-size: 13.8px;
  padding: 10px 10px;
  color: var(--ink);
}
.tablex tfoot td {
  background: var(--turquoise-l);
  font-weight: 700;
  color: var(--turquoise);
}
.tablex .clk { cursor: pointer; transition: background 0.15s ease; }
.tablex .clk:hover {
  background: var(--turquoise-l);
  color: var(--turquoise);
  font-weight: 700;
}

/* ===== Province Rows & Cards ===== */
.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.prow:hover { background: var(--turquoise-l); }
.rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint-soft);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex: none;
  color: var(--turquoise);
}
.rank.top {
  background: var(--turquoise);
  color: #ffffff;
}
.prov-card {
  padding: 18px;
  cursor: pointer;
  height: 100%;
  border-radius: 18px;
}
.prov-card:hover {
  border-color: var(--turquoise);
  transform: translateY(-3px);
}
.prov-card .big {
  font-family: 'Prompt', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--turquoise);
  line-height: 1;
}

/* ===== Files & Dropzone ===== */
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--card-bg);
  flex-wrap: wrap;
}
.file-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex: none;
}
.file-act {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}
.cat-h {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--turquoise);
  margin: 10px 0 5px;
}
.dropzone {
  border: 2px dashed var(--turquoise);
  background: var(--mint-bg);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}
.dropzone.over, .dropzone:hover {
  background: var(--turquoise-l);
  border-color: var(--emerald-800);
}
.dz-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.dz-chip {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}
.dz-chip i {
  cursor: pointer;
  color: #DC2626;
  margin-left: 5px;
}

.stu-row {
  display: grid;
  grid-template-columns: 24px 1.1fr 2fr 110px 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.stu-row .no {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 576px) {
  .stu-row { grid-template-columns: 20px 1fr 1fr; }
}

.ac-box {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1070;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-height: 260px;
  overflow: auto;
  display: none;
}
.ac-box div {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13.5px;
}
.ac-box div:hover { background: var(--turquoise-l); }

/* ===== Announcements ===== */
.ann {
  padding: 18px;
  border-left: 4px solid var(--turquoise);
  margin-bottom: 12px;
}
.ann.pin { border-left-color: var(--emerald-800); }
.ann .body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

/* ===== Guide Cards ===== */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.roadmap-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.roadmap-card .step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--turquoise-l);
  color: var(--turquoise);
  font-family: 'Prompt', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}

/* ===== Letters Page Groups & Steps ===== */
.grp-item {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--card-bg);
  transition: all 0.18s ease;
}
.grp-item:hover { background: var(--mint-bg); border-color: var(--turquoise); }
.grp-item.active {
  border-color: var(--turquoise);
  background: var(--turquoise-l);
}
.step-card {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  height: 100%;
}
.step-card .hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  color: var(--turquoise);
  margin-bottom: 10px;
}
.step-card .hd .n {
  background: var(--turquoise);
  color: #ffffff;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-card.s2 .hd { color: #0284C7; }
.step-card.s2 .hd .n { background: #0284C7; }
.step-card.s3 { border-color: #DDD6FE; background: linear-gradient(180deg, rgba(243,232,255,0.28) 0%, var(--card-bg) 100%); }
.step-card.s3 .hd { color: #6D28D9; }
.step-card.s3 .hd .n { background: #6D28D9; }
.step-upload-box {
  background: var(--mint-soft);
  border: 1px dashed var(--turquoise);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
.step-card.s2 .step-upload-box {
  background: #F0F9FF;
  border-color: #7DD3FC;
}
.step-card.s3 .step-upload-box {
  background: #F5F3FF;
  border-color: #C4B5FD;
}

/* ===== Preview Modal & Loading (ขนาดเริ่มต้นเท่า Popup ประกาศ และรองรับ Zoom In / Zoom Out) ===== */
#pvStage {
  max-height: calc(100dvh - 165px);
  overflow: auto;
  background: #ffffff;
  border-radius: 10px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
#pvInner {
  display: inline-block;
  min-width: 100%;
  text-align: center;
}
#pvInner img {
  max-width: none;
  transition: width 0.15s ease;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
.pv-zoom-dialog {
  transition: max-width 0.2s ease;
}
.pv-zoom-dialog.is-zoomed {
  max-width: min(95vw, 860px) !important;
}
#loading {
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 34, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
}
.empty i {
  font-size: 2.3rem;
  display: block;
  margin-bottom: 8px;
  color: var(--turquoise);
}
.modal-content {
  background: var(--card-bg);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(7, 78, 60, 0.25);
}
.modal-header {
  background: var(--mint-soft);
  border-radius: 18px 18px 0 0;
  border-bottom: 1px solid var(--line);
}
.modal-footer {
  border-top: 1px solid var(--line);
}
.dropdown-menu {
  background: var(--card-bg);
  border: 1px solid var(--line) !important;
}
.dropdown-item {
  color: var(--ink);
  font-size: 13.5px;
  padding: 7px 16px;
}
.dropdown-item:hover {
  background: var(--mint-soft);
  color: var(--turquoise);
}
.pagination .page-link {
  background: var(--card-bg);
  color: var(--turquoise);
  border-color: var(--line);
}
.pagination .active .page-link {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: #ffffff;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--card-bg);
}
.footer .ft-main {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
}
.footer .ft-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.footer .dev-link {
  color: var(--turquoise);
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}
.footer .dev-link:hover {
  color: var(--emerald-800);
  text-decoration: none !important;
}

/* ===== Interactive Walkthrough Product Tour (driver.js) ดีไซน์พรีเมียมทันสมัย ===== */

body.driver-active .app-sidebar {
  transition: none !important;
}
.driver-popover {
  position: fixed !important;
  z-index: 1000000000 !important;
  font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif !important;
  border-radius: 20px !important;
  border: 1.5px solid rgba(14, 138, 114, 0.4) !important;
  box-shadow: 0 24px 60px -10px rgba(7, 45, 35, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  padding: 20px 20px 16px !important;
  max-width: 410px !important;
  min-width: 300px !important;
  background: var(--card-bg) !important;
  color: var(--ink) !important;
  overflow: hidden;
}
@media (max-width: 767px) {
  .driver-popover {
    max-width: calc(100vw - 24px) !important;
    min-width: min(280px, calc(100vw - 24px)) !important;
    padding: 16px 16px 14px !important;
    border-radius: 16px !important;
  }
  .driver-popover-title {
    font-size: 14.8px !important;
  }
  .driver-popover-description {
    font-size: 12.8px !important;
  }
}
/* สไตล์สำหรับหน้าต่างเลือกนักศึกษาที่จะย้าย/เปลี่ยนสถานที่ฝึก (1, 2, 3, 4... คน) */
.split-stu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  text-align: left;
  padding: 4px 2px;
}
.split-stu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.split-stu-item:hover {
  border-color: var(--turquoise);
  background: var(--mint-soft);
}
.split-stu-item.checked {
  border-color: var(--turquoise);
  background: var(--turquoise-l);
}
.split-stu-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0E8A72;
  cursor: pointer;
  flex-shrink: 0;
}
.driver-popover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 45%, #10B981 100%);
}
.driver-popover-close-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: var(--mint-soft) !important;
  color: var(--muted) !important;
  display: grid !important;
  place-items: center !important;
  top: 14px !important;
  right: 14px !important;
  font-size: 16px !important;
  transition: all 0.2s ease !important;
}
.driver-popover-close-btn:hover {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
}
.driver-popover-title {
  font-family: 'Prompt', sans-serif !important;
  color: var(--ink) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  padding-right: 28px !important;
  line-height: 1.3 !important;
}
.driver-popover-description {
  color: var(--ink) !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  margin-bottom: 4px !important;
}
.tour-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(14, 138, 114, 0.3);
}
.tour-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--turquoise);
  background: var(--turquoise-l);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 3px;
}
.tour-info-box {
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-left: 3.5px solid var(--turquoise);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12.6px;
  line-height: 1.48;
}
.tour-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tour-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.8px;
  font-weight: 600;
  color: var(--emerald-800);
}
.tour-contact-card {
  background: linear-gradient(135deg, var(--mint-soft) 0%, var(--turquoise-l) 100%);
  border: 1px solid rgba(14, 138, 114, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.6px;
}
.tour-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.42;
}
.tour-contact-row i {
  color: var(--turquoise);
  font-size: 14.5px;
  margin-top: 1px;
  flex-shrink: 0;
}
.driver-popover-footer {
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--line) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.driver-popover-progress-text {
  font-family: 'Prompt', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--turquoise) !important;
  background: var(--turquoise-l);
  padding: 4px 11px;
  border-radius: 999px;
}
.driver-popover-navigation-btns {
  display: flex !important;
  gap: 6px !important;
}
.driver-popover-navigation-btns button {
  text-shadow: none !important;
  border-radius: 999px !important;
  font-family: 'Prompt', sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 6px 16px !important;
  transition: all 0.2s ease !important;
}
.driver-popover-prev-btn {
  background: var(--mint-soft) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}
.driver-popover-prev-btn:hover {
  border-color: var(--turquoise) !important;
  color: var(--turquoise) !important;
}
.driver-popover-next-btn {
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 5px 14px rgba(14, 138, 114, 0.32) !important;
}
.driver-popover-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(14, 138, 114, 0.42) !important;
}

/* ===== Segmented Control ===== */
.seg {
  display: inline-flex;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: none;
  padding: 6px 12px;
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  transition: all 0.2s ease;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.seg button.on {
  background: var(--turquoise);
  color: #ffffff;
  font-weight: 600;
}

.swal2-popup {
  font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif !important;
  border-radius: 18px !important;
  background: var(--card-bg) !important;
  color: var(--ink) !important;
}
mark {
  background: #FEF08A;
  color: #0F2922;
  padding: 0 4px;
  border-radius: 4px;
}

/* ===== ข้อ 2: การ์ดตัวอย่างและการเบลอปกปิดข้อมูลอ่อนไหว (PDPA Sample Card) ===== */
.sample-card-outer {
  border: 1.5px solid rgba(14, 138, 114, 0.35);
  border-radius: 18px;
  background: var(--card-bg);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(14, 138, 114, 0.08);
}
.sample-card-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--turquoise-l);
  border: 1px solid rgba(14, 138, 114, 0.3);
  color: var(--emerald-800);
  border-radius: 10px;
  padding: 5px 14px;
  margin-bottom: 10px;
  width: fit-content;
  max-width: 100%;
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.st-card.sample-demo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
}
.sensitive-blur {
  filter: blur(4.2px);
  user-select: none;
  pointer-events: none;
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
}
.sensitive-mask-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mint-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 2px 8px;
}
.pdpa-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
}

/* ===== ข้อ 4 & ข้อ 6: ชิปสรุปข้อมูลกราฟเดือน/วัน และปุ่มเลือกเปรียบเทียบรายปี ===== */
.stat-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.8px;
  color: var(--ink);
}
.stat-mini-chip b {
  color: var(--turquoise);
  font-family: 'Prompt', sans-serif;
}

.cmp-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}
.cmp-check-pill:hover {
  border-color: var(--turquoise);
}
.cmp-check-pill.active {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(14, 138, 114, 0.25);
}
.cmp-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.cmp-item-chip.active {
  background: var(--turquoise-l);
  border-color: var(--turquoise);
  color: var(--turquoise);
  font-weight: 600;
}
.cmp-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.cmp-delta.up { background: #DCFCE7; color: #15803D; }
.cmp-delta.down { background: #FEE2E2; color: #B91C1C; }
.cmp-delta.flat { background: var(--mint-soft); color: var(--muted); }

/* ===== ข้อ 3: Responsive Design ครบวงจร (Desktop / Laptop / Tablet / Mobile) ===== */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.app-sidebar {
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.dash-auto-sel {
  width: auto;
  min-width: 170px;
}

/* ระดับ Laptop & Tablet แนวนอน (max-width: 1199px) */
@media (max-width: 1199px) {
  .main {
    padding: 18px 18px 40px;
  }
  .bento > .b8 { grid-column: span 12; }
  .bento > .b4 { grid-column: span 4; }
  .bento > .b6 { grid-column: span 6; }
  .kpi .num { font-size: 1.85rem; }
}

/* ระดับ Tablet แนวตั้ง (max-width: 991px) */
@media (max-width: 991px) {
  .app-sidebar {
    width: 276px;
    max-width: 84vw;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.25);
    z-index: 1050;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sb-backdrop {
    z-index: 1045;
  }
  .bento > .b8,
  .bento > .b6,
  .bento > .b12 {
    grid-column: span 12 !important;
  }
  .bento > .b4 {
    grid-column: span 6 !important;
  }
  #cardGender.b4 {
    grid-column: span 12 !important;
  }
  .filterbar {
    grid-template-columns: repeat(3, 1fr);
  }
  #gList {
    max-height: 360px !important;
  }
}

/* ระดับสมาร์ตโฟนและจอขนาดกลาง (max-width: 767px) */
@media (max-width: 767px) {
  body {
    font-size: 13.8px;
  }
  .app-topbar {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }
  .crumb-bar {
    font-size: 13px;
  }
  .crumb-bar .c-cur {
    max-width: 185px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .theme-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .user-pill {
    padding: 3px 8px 3px 4px;
  }
  .main {
    padding: 12px 10px 38px;
  }
  .hero {
    padding: 18px 16px;
    border-radius: 16px;
  }
  .hero h3 {
    font-size: 1.2rem;
  }
  .search-box {
    padding: 4px 5px 4px 10px;
    border-radius: 12px;
  }
  .search-box input {
    font-size: 14px !important;
    min-height: 36px;
  }
  .search-box .btn {
    padding: 6px 14px !important;
    font-size: 13px;
    white-space: nowrap;
  }
  .page-banner {
    padding: 14px 14px;
    border-radius: 15px;
    margin-bottom: 14px;
  }
  .page-head {
    gap: 10px;
  }
  .page-head .ic {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    border-radius: 11px;
  }
  .page-head h4 {
    font-size: 1.08rem;
    line-height: 1.3;
  }
  .page-head > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .page-head > div:last-child .btn {
    flex: 1 1 auto;
  }
  .dash-ctrl-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
  .dash-ctrl-bar .seg {
    width: 100%;
    display: flex;
  }
  .dash-ctrl-bar .seg button {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 12px;
  }
  .dash-auto-sel {
    width: 100% !important;
  }
  .dash-export-grp {
    width: 100%;
    margin-left: 0 !important;
    justify-content: stretch;
  }
  .dash-export-grp .btn {
    flex: 1 1 calc(50% - 6px);
  }
  .filterbar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 12px !important;
    border-radius: 14px;
  }
  .bento {
    gap: 12px;
  }
  .bento > * {
    grid-column: span 12 !important;
  }
  .kpi {
    padding: 14px 16px;
    border-radius: 15px;
  }
  .kpi .num {
    font-size: 1.65rem;
  }
  .kpi-foot {
    flex-wrap: wrap;
    gap: 4px;
  }
  .cardx {
    border-radius: 15px;
  }
  .card-t {
    gap: 6px;
  }
  .card-t h5, .card-t h6 {
    font-size: 14px;
    line-height: 1.4;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .table-toolbar > div {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .table-toolbar select,
  .table-toolbar input[type="search"] {
    width: 100% !important;
    flex: 1 1 100%;
  }
  .tablex thead th,
  .tablex td {
    padding: 8px 8px;
    font-size: 12.5px;
  }
  .stu-row {
    grid-template-columns: 24px 1fr 110px 34px;
    gap: 6px;
    padding: 8px;
    background: var(--mint-soft);
    border-radius: 10px;
    margin-bottom: 8px;
  }
  .stu-row input:nth-of-type(1) {
    grid-column: 2 / 5;
  }
  .stu-row input:nth-of-type(2) {
    grid-column: 1 / 3;
  }
  .form-control, .form-select {
    font-size: 16px !important; /* ป้องกัน iOS Safari ซูมหน้าจออัตโนมัติขณะพิมพ์ */
    min-height: 40px;
  }
  .form-control-sm, .form-select-sm {
    font-size: 14px !important;
    min-height: 36px;
  }
  .modal-dialog:not(.modal-fullscreen-md-down):not(.modal-fullscreen-lg-down):not(.modal-fullscreen-sm-down) {
    margin: 10px auto !important;
    max-width: calc(100% - 20px) !important;
  }
  .driver-popover {
    max-width: calc(100vw - 28px) !important;
    padding: 14px !important;
  }
}

/* ระดับสมาร์ตโฟนจอเล็ก (max-width: 575px) */
@media (max-width: 575px) {
  .filterbar {
    grid-template-columns: 1fr !important;
  }
  .stepper {
    margin: 10px 0 6px;
  }
  .stepper .st small {
    font-size: 10.5px;
    display: block;
    line-height: 1.2;
  }
  .stepper .st .b {
    width: 24px;
    height: 24px;
    font-size: 10.5px;
  }
  .stepper .st::before {
    top: 12px;
  }
  .st-card .head {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .seg {
    flex-wrap: wrap;
  }
  .seg button {
    padding: 4px 9px;
    font-size: 11.5px;
  }
}

/* ===== ข้อ 7 & 8: กรอบตัวกรองแดชบอร์ดระเบียบสวยงาม + ปุ่มกากบาทลบตัวกรองย่อย ===== */
.filterbar-wrap {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.03);
}
.filterbar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.filterbar-wrap .filterbar {
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px 12px;
}
.filter-box {
  display: flex;
  flex-direction: column;
}
.filter-lbl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.filter-lbl-row .form-label {
  margin-bottom: 0;
  font-size: 12.2px;
}
.filter-clear-x {
  border: 0;
  background: #FEE2E2;
  color: #DC2626;
  border-radius: 999px;
  width: 19px;
  height: 19px;
  font-size: 11px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.filter-clear-x:hover {
  background: #DC2626;
  color: #ffffff;
}
/* ===== ตัวกรองทรงแคปซูลมน (Soft Grey Pill Filter Selects) ตามธีมรูปที่ 3 สำหรับทั้งแอดมินและเจ้าหน้าที่ ===== */
.filterbar select,
.filter-box select,
.dash-ctrl-bar select,
#pvFilterCard select,
#pvFilterCard input[type="search"],
#page-list select,
#page-list input[type="search"],
#page-incomplete select,
#page-incomplete input[type="search"],
#dFilters select,
#cmpFilters select,
#dQuickMajor,
#dQuickProg,
#dQuickStatus,
#dSize,
#dQ,
#dHistMode,
#dBy,
#cmpHistMode,
#upCat,
#upWho {
  border-radius: 9999px !important;
  background-color: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
  color: #1E293B !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  padding-left: 14px !important;
  padding-right: 32px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  transition: all 0.18s ease;
}

#pvFilterCard input[type="search"],
#page-list input[type="search"],
#page-incomplete input[type="search"],
#dQ {
  padding-right: 14px !important;
}

.filterbar select:hover,
.filter-box select:hover,
.dash-ctrl-bar select:hover,
#pvFilterCard select:hover,
#pvFilterCard input[type="search"]:hover,
#page-list select:hover,
#page-list input[type="search"]:hover,
#page-incomplete select:hover,
#page-incomplete input[type="search"]:hover,
#dFilters select:hover,
#cmpFilters select:hover,
#dQuickMajor:hover,
#dQuickProg:hover,
#dQuickStatus:hover,
#dSize:hover,
#dQ:hover,
#dHistMode:hover,
#dBy:hover,
#cmpHistMode:hover,
#upCat:hover,
#upWho:hover {
  background-color: #EEF2F6 !important;
  border-color: #CBD5E1 !important;
}

.filterbar select:focus,
.filter-box select:focus,
.dash-ctrl-bar select:focus,
#pvFilterCard select:focus,
#pvFilterCard input[type="search"]:focus,
#page-list select:focus,
#page-list input[type="search"]:focus,
#page-incomplete select:focus,
#page-incomplete input[type="search"]:focus,
#dFilters select:focus,
#cmpFilters select:focus,
#dQuickMajor:focus,
#dQuickProg:focus,
#dQuickStatus:focus,
#dSize:focus,
#dQ:focus,
#dHistMode:focus,
#dBy:focus,
#cmpHistMode:focus,
#upCat:focus,
#upWho:focus {
  background-color: #FFFFFF !important;
  border-color: var(--turquoise) !important;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.15) !important;
  outline: none;
}

/* เมื่อมีการเลือกค่าที่กรอง (Active Filter) หรือฟิลด์ที่ถูกล็อคตามสิทธิ์สาขา */
.filter-select-active,
.form-select:disabled,
.form-select:disabled:hover,
.filterbar select:has(option:checked:not([value=""])),
.filter-box select:has(option:checked:not([value=""])),
#pvFilterCard select:has(option:checked:not([value=""])),
#page-list select:has(option:checked:not([value=""])),
#page-incomplete select:has(option:checked:not([value=""])),
#dQuickMajor:has(option:checked:not([value=""])),
#dQuickProg:has(option:checked:not([value=""])),
#dQuickStatus:has(option:checked:not([value=""])),
#dFilters .form-select:has(option:checked:not([value=""])),
#cmpFilters .form-select:has(option:checked:not([value=""])) {
  background-color: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #1E293B !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

body.dark-mode .filter-select-active,
body.dark-mode .form-select:disabled,
body.dark-mode .form-select:disabled:hover,
body.dark-mode .filterbar select:has(option:checked:not([value=""])),
body.dark-mode .filter-box select:has(option:checked:not([value=""])),
body.dark-mode #pvFilterCard select:has(option:checked:not([value=""])),
body.dark-mode #page-list select:has(option:checked:not([value=""])),
body.dark-mode #page-incomplete select:has(option:checked:not([value=""])),
body.dark-mode #dQuickMajor:has(option:checked:not([value=""])),
body.dark-mode #dQuickProg:has(option:checked:not([value=""])),
body.dark-mode #dQuickStatus:has(option:checked:not([value=""])),
body.dark-mode #dFilters .form-select:has(option:checked:not([value=""])),
body.dark-mode #cmpFilters .form-select:has(option:checked:not([value=""])) {
  background-color: #132B24 !important;
  border-color: #1E4036 !important;
  color: #E6F5F0 !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}
.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--turquoise-l);
  border: 1px solid var(--turquoise);
  color: var(--turquoise);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.active-filter-pill .rm-x {
  cursor: pointer;
  color: #DC2626;
  font-size: 13px;
  line-height: 1;
  margin-left: 2px;
}
.active-filter-pill .rm-x:hover {
  transform: scale(1.15);
}

/* ===== ข้อ 2: การแสดงผลรูปประกาศเต็มภาพ & โปสเตอร์ประกาศเมื่อคลิกหัวข้อ ===== */
.ann-title-link {
  cursor: pointer;
  color: var(--ink);
  transition: color 0.18s ease;
}
.ann-title-link:hover {
  color: var(--turquoise);
  text-decoration: underline;
}
.pin-auto-dialog {
  width: fit-content !important;
  min-width: 310px;
  max-width: min(92vw, 500px) !important;
  margin: 12px auto !important;
}
.ann-full-img-wrap {
  margin: 10px 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  display: inline-block;
  max-width: 100%;
}
.ann-full-img-wrap img,
.ann-full-img-wrap canvas {
  width: auto !important;
  height: auto !important;
  max-width: 280px !important;
  max-height: 390px !important;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  cursor: pointer;
}
#pinPopBody {
  background: #ffffff !important;
}
#pinPopBody img,
#pinPopBody canvas,
#annViewBody .ann-full-img-wrap img,
#annViewBody .ann-full-img-wrap canvas {
  width: auto !important;
  height: auto !important;
  max-width: min(86vw, 460px) !important;
  max-height: calc(100dvh - 185px) !important;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
}
#annViewBody .ann-full-img-wrap {
  display: block;
  text-align: center;
}
.pdf-canvas-page {
  display: block;
  margin: 0 auto 10px;
  max-width: 100%;
  height: auto !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  background: #ffffff;
}
@media (max-width: 767px) {
  .ann-full-img-wrap img,
  .ann-full-img-wrap canvas {
    max-width: 240px !important;
    max-height: 330px !important;
  }
  #pinPopBody img,
  #pinPopBody canvas,
  #annViewBody .ann-full-img-wrap img,
  #annViewBody .ann-full-img-wrap canvas {
    max-height: calc(100dvh - 185px) !important;
  }
  .ann-poster-card {
    padding: 20px 18px;
    min-height: 180px;
  }
  .ann-poster-card h4 {
    font-size: 1.1rem;
  }
  .ann-poster-card .poster-body {
    font-size: 13.5px;
    padding: 12px 14px;
  }
}
.ann-poster-card {
  background: linear-gradient(135deg, #0B6B53 0%, #0E8A72 55%, #14A387 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(11, 107, 83, 0.22);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ann-poster-card::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, transparent 70%);
  pointer-events: none;
}
.ann-poster-card .poster-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 14px;
}
.ann-poster-card h4 {
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #ffffff;
}
.ann-poster-card .poster-body {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}


/* ===== จัดวางภาพตัวอย่างประกาศไว้ด้านซ้ายของข้อความประกาศและรายละเอียด ===== */
.ann-flex-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.ann-thumb-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 135px;
}
.ann-thumb-box {
  width: 135px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  position: relative;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.ann-thumb-box:hover {
  border-color: var(--turquoise);
  transform: translateY(-2px);
}
.ann-thumb-box img,
.ann-thumb-box canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 125px !important;
  max-height: 175px !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}
.ann-thumb-zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(14, 138, 114, 0.9);
  color: #ffffff;
  border: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.ann-content-col {
  flex: 1;
  min-width: 0;
}
@media (max-width: 575px) {
  .ann-flex-row {
    gap: 12px;
  }
  .ann-thumb-col,
  .ann-thumb-box {
    width: 104px;
  }
  .ann-thumb-box img,
  .ann-thumb-box canvas {
    max-width: 94px !important;
    max-height: 138px !important;
  }
}


/* ===== โหมดขยายเต็มจอ (Fullscreen Modal) รองรับทุกแพลตฟอร์ม และแสดงเอกสารหลายหน้าได้ครบทุกหน้าตั้งแต่หน้าแรก ===== */
.modal.modal-is-fullscreen {
  padding: 0 !important;
}
.modal.modal-is-fullscreen .modal-dialog {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
}
.modal.modal-is-fullscreen .modal-content {
  width: 100vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: 0 !important;
  display: flex;
  flex-direction: column;
}
.modal.modal-is-fullscreen .modal-body {
  flex: 1;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  display: block !important;
  text-align: center !important;
  padding: 16px !important;
  -webkit-overflow-scrolling: touch;
}
.modal.modal-is-fullscreen #pvStage {
  max-height: calc(100dvh - 76px) !important;
  height: calc(100dvh - 76px) !important;
  width: 100%;
  display: block !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  text-align: center !important;
  padding: 8px 0 24px !important;
}
.modal.modal-is-fullscreen #pinPopBody img,
.modal.modal-is-fullscreen #pinPopBody canvas,
.modal.modal-is-fullscreen #annViewBody .ann-full-img-wrap img,
.modal.modal-is-fullscreen #annViewBody .ann-full-img-wrap canvas,
.modal.modal-is-fullscreen #pvStage canvas.pdf-canvas-page {
  max-width: min(94vw, 1020px) !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto 16px !important;
  display: block !important;
}


/* ===== ปรับตารางรายชื่อนักศึกษา (#dListCard และ #listTableCard) ให้ช่องพอดีสวยงาม ไม่ซ้อนทับกันและไม่ล้นขอบ ===== */
@media (min-width: 992px) {
  .table-fit-window {
    width: 100% !important;
    table-layout: fixed !important;
  }
  .table-fit-window thead th {
    padding: 9px 8px !important;
    font-size: 12.2px !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .table-fit-window td {
    padding: 9px 8px !important;
    font-size: 13px !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    vertical-align: middle !important;
    overflow: hidden;
  }
  .table-fit-window td.stu-name-cell {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
  }
  .table-fit-window .badge-st,
  .table-fit-window .badge-pg,
  .table-fit-window .badge-grp-cur,
  .table-fit-window .badge-grp-hist {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    font-size: 11.2px !important;
    padding: 4px 8.5px !important;
    border-radius: 7px !important;
    line-height: 1.35 !important;
    max-width: 100%;
  }
}

/* ===== ระบบคำนวณชั่วโมงก่อนออกฝึก (#page-calc) ===== */
.calc-ref-card {
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  height: 100%;
}
.calc-preset-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: all 0.18s ease;
  cursor: pointer;
  margin-bottom: 8px;
}
.calc-preset-btn:last-child {
  margin-bottom: 0;
}
.calc-preset-btn:hover {
  border-color: var(--turquoise);
  background: rgba(14, 138, 114, 0.06);
  transform: translateY(-1px);
}
.calc-preset-btn.active {
  border-color: var(--turquoise);
  background: rgba(14, 138, 114, 0.12);
  box-shadow: 0 4px 12px rgba(14, 138, 114, 0.12);
}
.calc-preset-hrs {
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #DCFCE7;
  color: #15803D;
  white-space: nowrap;
}
body.dark-mode .calc-preset-hrs {
  background: rgba(22, 163, 74, 0.22);
  color: #86EFAC;
}
.calc-bi-box {
  background: linear-gradient(135deg, rgba(14, 138, 114, 0.07), rgba(2, 132, 199, 0.06));
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.calc-stat-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.calc-stat-card .stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}
.calc-stat-card .stat-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}
.calc-holiday-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}
body.dark-mode .calc-holiday-badge {
  background: rgba(217, 119, 6, 0.2);
  color: #FCD34D;
  border-color: rgba(217, 119, 6, 0.4);
}

/* ===== กรอบแสดงประวัติเดิม (ย้ายที่ฝึก / เปลี่ยนที่ฝึก / ปฏิเสธ / ส่งตัวกลับ) พร้อมสีตามสถานะและปุ่มรูปตาซ่อน/แสดง ===== */
.hist-section-wrap {
  margin-top: 12px;
}
.hist-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.hist-frame-card {
  border-radius: 14px;
  border: 2px solid var(--hist-bd, #EA580C);
  background: var(--hist-bg, #FFF7ED);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(15, 41, 34, 0.05);
  transition: all 0.2s ease;
}
body.dark-mode .hist-frame-card {
  background: var(--hist-dark-bg, rgba(234, 88, 12, 0.12));
}
.hist-frame-head {
  padding: 9px 14px;
  background: var(--hist-hd-bg, #FFEDD5);
  color: var(--hist-hd-tx, #9A3412);
  border-bottom: 1px solid var(--hist-bd, #FDBA74);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 13px;
}
body.dark-mode .hist-frame-head {
  background: rgba(15, 23, 42, 0.45);
  color: #F8FAFC;
}
.hist-frame-body {
  padding: 12px 14px;
  font-size: 12.8px;
  color: var(--ink);
}
.btn-eye-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 3.5px 11px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-eye-toggle:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
  background: var(--mint-soft);
}

/* ===== Hero Agricultural Terrace & Botanical Leaf Sway ===== */
@keyframes agTerraceDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes agLeafSway {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-4px); }
}
.hero.hero-ag-terrace {
  position: relative;
  overflow: hidden;
  background: linear-gradient(132deg, #084C3B 0%, #0E8A72 62%, #14A387 100%);
  border-radius: 16px;
  padding: 32px 30px 44px;
  color: #FFFFFF;
  box-shadow: 0 12px 32px rgba(8, 76, 59, 0.24);
}
.hero-ag-terrace .ag1-leaf-art {
  position: absolute;
  top: 14px;
  right: 26px;
  width: 132px;
  height: 132px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.42;
  transform-origin: bottom center;
  animation: agLeafSway 5.5s ease-in-out infinite;
}
.hero-ag-terrace .ag1-terrace {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 54px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.hero-ag-terrace .ag1-track {
  display: flex;
  width: 200%;
  height: 100%;
  animation: agTerraceDrift 18s linear infinite;
}
.hero-ag-terrace .ag1-track-back {
  animation-duration: 27s;
  animation-direction: reverse;
  opacity: 0.7;
}
.hero-ag-terrace .ag1-track svg {
  width: 50%;
  height: 100%;
  display: block;
}
.hero-ag-terrace .ag1-body {
  position: relative;
  z-index: 2;
}
.hero-ag-terrace .ag1-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
}
.hero-ag-terrace .ag-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 8px 24px rgba(8, 52, 41, 0.22);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.hero-ag-terrace .ag-search:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(8, 52, 41, 0.32);
}
.hero-ag-terrace .ag-search input {
  border: none !important;
  box-shadow: none !important;
  color: #0F2922;
}
body.dark-mode .hero-ag-terrace .ag-search {
  background: rgba(15, 36, 30, 0.92) !important;
  border: 1px solid rgba(45, 212, 191, 0.45) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 14px rgba(45, 212, 191, 0.22) !important;
}
body.dark-mode .hero-ag-terrace .ag-search:focus-within {
  border-color: #2DD4BF !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(45, 212, 191, 0.35) !important;
}
body.dark-mode .hero-ag-terrace .ag-search input {
  background: transparent !important;
  color: #FFFFFF !important;
}
body.dark-mode .hero-ag-terrace .ag-search input::placeholder {
  color: #A7F3D0 !important;
  opacity: 0.85;
}
body.dark-mode .hero-ag-terrace .ag-search i.bi-search {
  color: #2DD4BF !important;
}
.hero-ag-terrace .ag-btn {
  border-radius: 999px !important;
  padding: 9px 22px;
  font-weight: 600;
}
.ic-badge .ic-badge-staff-icon {
  display: inline-grid;
  place-items: center;
  font-size: 26px;
  color: #FFFFFF;
}

/* ===== Student Ambient Background Floating Collage ===== */
#page-student {
  position: relative;
  min-height: calc(100vh - 120px);
}
.student-content-layer {
  position: relative;
  z-index: 2;
}
.student-ambient-canvas {
  position: absolute;
  top: 180px;
  left: -20px;
  right: -20px;
  bottom: 0;
  min-height: 900px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
#page-student.has-query .student-ambient-canvas {
  opacity: 0.08 !important;
  filter: grayscale(40%) blur(1px);
}
.ambient-backdrop-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 55% at 50% 45%, rgba(14, 138, 114, 0.07) 0%, rgba(197, 155, 39, 0.03) 40%, transparent 70%);
  pointer-events: none;
}
.ambient-floating-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 900px;
}
.ambient-photo-card {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(14, 138, 114, 0.18);
  box-shadow: 0 10px 28px -8px rgba(11, 107, 83, 0.12), 0 3px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  padding: 6px;
  opacity: 0.26;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, border-color 0.45s ease;
  will-change: transform, opacity;
}
.ambient-photo-card:hover {
  opacity: 0.96 !important;
  transform: translateY(-8px) scale(1.06) rotate(0deg) !important;
  box-shadow: 0 20px 40px -10px rgba(14, 138, 114, 0.32), 0 6px 16px rgba(0, 0, 0, 0.12) !important;
  border-color: var(--turquoise) !important;
  z-index: 10 !important;
}
.ambient-photo-media {
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  background: #E5E7EB;
}
.ambient-photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.ambient-photo-card:hover .ambient-photo-media img {
  transform: scale(1.06);
}
.ambient-photo-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
  pointer-events: none;
}
.ambient-photo-caption {
  padding: 6px 6px 3px;
}
.ambient-photo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--turquoise);
  line-height: 1.3;
}
.ambient-photo-sub {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dark mode adjustments */
.dark-theme .ambient-photo-card {
  background: rgba(18, 38, 32, 0.78);
  border-color: rgba(110, 231, 183, 0.2);
  opacity: 0.18;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.35);
}
.dark-theme .ambient-photo-card:hover {
  background: rgba(18, 38, 32, 0.95);
  border-color: #6EE7B7 !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(110, 231, 183, 0.25) !important;
}
.dark-theme .ambient-backdrop-radial {
  background: radial-gradient(ellipse 65% 55% at 50% 45%, rgba(110, 231, 183, 0.05) 0%, transparent 70%);
}

/* Individual Card Positions */
.ambient-card-1 {
  width: 230px;
  top: 40px;
  left: 2%;
  animation: ambientDriftA 22s ease-in-out infinite alternate;
}
.ambient-card-2 {
  width: 175px;
  top: 20px;
  right: 2%;
  animation: ambientDriftB 26s ease-in-out infinite alternate;
}
.ambient-card-3 {
  width: 170px;
  top: 290px;
  left: 3%;
  animation: ambientDriftC 24s ease-in-out infinite alternate;
}
.ambient-card-4 {
  width: 235px;
  top: 270px;
  right: 2.5%;
  animation: ambientDriftD 28s ease-in-out infinite alternate;
}
.ambient-card-5 {
  width: 215px;
  top: 530px;
  left: 10%;
  animation: ambientDriftB 25s ease-in-out infinite alternate;
}
.ambient-card-6 {
  width: 175px;
  top: 510px;
  right: 9%;
  animation: ambientDriftA 23s ease-in-out infinite alternate;
}
.ambient-card-7 {
  width: 175px;
  top: 570px;
  left: 48%;
  animation: ambientDriftC 27s ease-in-out infinite alternate;
}

/* Float Drift Keyframe Animations */
@keyframes ambientDriftA {
  0%   { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50%  { transform: translate3d(10px, -16px, 0) rotate(-0.5deg); }
  100% { transform: translate3d(-8px, -28px, 0) rotate(-3deg); }
}
@keyframes ambientDriftB {
  0%   { transform: translate3d(0, 0, 0) rotate(2deg); }
  50%  { transform: translate3d(-12px, -18px, 0) rotate(3.2deg); }
  100% { transform: translate3d(8px, -30px, 0) rotate(1deg); }
}
@keyframes ambientDriftC {
  0%   { transform: translate3d(0, 0, 0) rotate(1.5deg); }
  50%  { transform: translate3d(14px, -12px, 0) rotate(0deg); }
  100% { transform: translate3d(-8px, -22px, 0) rotate(2.5deg); }
}
@keyframes ambientDriftD {
  0%   { transform: translate3d(0, 0, 0) rotate(-1.8deg); }
  50%  { transform: translate3d(-14px, -16px, 0) rotate(-3deg); }
  100% { transform: translate3d(10px, -28px, 0) rotate(-0.5deg); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .ambient-card-1 { width: 190px; left: 1%; }
  .ambient-card-2 { width: 150px; right: 1%; }
  .ambient-card-3 { width: 145px; left: 1.5%; top: 270px; }
  .ambient-card-4 { width: 195px; right: 1.5%; top: 250px; }
  .ambient-card-5 { width: 175px; left: 6%; top: 480px; }
  .ambient-card-6 { width: 145px; right: 5%; top: 460px; }
  .ambient-card-7 { width: 145px; left: 45%; top: 510px; }
}

@media (max-width: 992px) {
  .student-ambient-canvas {
    top: 220px;
    opacity: 0.85;
  }
  .ambient-photo-card {
    opacity: 0.18;
  }
  .ambient-card-1 { width: 150px; top: 20px; left: 1%; }
  .ambient-card-2 { width: 130px; top: 15px; right: 1%; }
  .ambient-card-3 { display: none; }
  .ambient-card-4 { width: 155px; top: 230px; right: 2%; }
  .ambient-card-5 { width: 150px; top: 240px; left: 2%; }
  .ambient-card-6 { display: none; }
  .ambient-card-7 { width: 130px; top: 440px; left: 50%; transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .student-ambient-canvas {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    min-height: auto;
    margin-top: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    pointer-events: auto;
  }
  .student-ambient-canvas::-webkit-scrollbar { display: none; }
  .ambient-backdrop-radial { display: none; }
  .ambient-floating-stage {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: auto;
    padding: 6px 12px 14px;
    width: max-content;
  }
  .ambient-photo-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    animation: none !important;
    width: 170px !important;
    flex-shrink: 0;
    opacity: 0.75 !important;
  }
  .ambient-photo-card:hover {
    transform: translateY(-4px) scale(1.02) !important;
  }
}

/* ===== ซ่อนภาพพื้นหลังเคลื่อนไหวหน้าตรวจสอบสถานะ (ข้อ 2) ===== */
.student-ambient-canvas {
  display: none !important;
}

/* ===== กรอบป้ายเลขที่หนังสือ ขอเข้า / ส่งตัว / นิเทศ ให้สวยงามเข้าชุดกับป้ายสถานะ (ข้อ 5) ===== */
.badge-book {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 4.5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.38;
  white-space: nowrap;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 41, 34, 0.05);
}
.badge-book i {
  font-size: 11px;
  line-height: 1;
}
.badge-book.b-step1 {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #065F46;
}
.badge-book.b-step1 i { color: #059669; }
.badge-book.b-step2 {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1E40AF;
}
.badge-book.b-step2 i { color: #2563EB; }
.badge-book.b-step3 {
  background: #F5F3FF;
  border-color: #C4B5FD;
  color: #5B21B6;
}
.badge-book.b-step3 i { color: #6D28D9; }
body.dark-mode .badge-book.b-step1 {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(110, 231, 183, 0.4);
  color: #A7F3D0;
}
body.dark-mode .badge-book.b-step2 {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(147, 197, 253, 0.4);
  color: #BFDBFE;
}
body.dark-mode .badge-book.b-step3 {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(196, 181, 253, 0.4);
  color: #DDD6FE;
}

/* ===== สีปุ่มกดขั้นตอนที่ 1 (โทนสีเขียวทั้งหมด) และขั้นตอนที่ 2 (โทนสีฟ้าทั้งหมด) (ข้อ 6) ===== */
.step-card.s1 {
  border-color: #A7F3D0;
  background: linear-gradient(180deg, rgba(209, 250, 229, 0.25) 0%, var(--card-bg) 100%);
}
.btn-step1-solid {
  background: #0E8A72;
  color: #ffffff;
  border: 1px solid #0E8A72;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  box-shadow: 0 3px 10px rgba(14, 138, 114, 0.18);
  transition: all 0.2s ease;
}
.btn-step1-solid:hover, .btn-step1-solid:focus {
  background: #0B6B53;
  border-color: #0B6B53;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-step1-TONE {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step1-TONE:hover, .btn-step1-TONE:focus {
  background: #0E8A72;
  border-color: #0E8A72;
  color: #ffffff;
}
.btn-step1-soft {
  background: #F0FDF4;
  color: #065F46;
  border: 1px solid #A7F3D0;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step1-soft:hover, .btn-step1-soft:focus {
  background: #D1FAE5;
  border-color: #0E8A72;
  color: #065F46;
}

.step-card.s2 {
  border-color: #BAE6FD;
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.32) 0%, var(--card-bg) 100%);
}
.step-card.s2 .form-control:focus,
.step-card.s2 .form-select:focus {
  border-color: #0284C7;
  box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.15);
}
.btn-step2-solid {
  background: #0284C7;
  color: #ffffff;
  border: 1px solid #0284C7;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.2);
  transition: all 0.2s ease;
}
.btn-step2-solid:hover, .btn-step2-solid:focus {
  background: #0369A1;
  border-color: #0369A1;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-step2-tone {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #7DD3FC;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step2-tone:hover, .btn-step2-tone:focus {
  background: #0284C7;
  border-color: #0284C7;
  color: #ffffff;
}
.btn-step2-soft {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step2-soft:hover, .btn-step2-soft:focus {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
}


/* ===== ขั้นตอนที่ 3: ปุ่มกดโทนสีม่วงทั้งหมด (ข้อ 2) ===== */
.step-card.s3 {
  border-color: #C4B5FD !important;
  background: linear-gradient(180deg, rgba(237, 233, 254, 0.38) 0%, var(--card-bg) 100%) !important;
}
.step-card.s3 .form-control:focus,
.step-card.s3 .form-select:focus {
  border-color: #6D28D9;
  box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.16);
}
.btn-step3-solid {
  background: #6D28D9;
  color: #ffffff;
  border: 1px solid #6D28D9;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.22);
  transition: all 0.2s ease;
}
.btn-step3-solid:hover, .btn-step3-solid:focus {
  background: #5B21B6;
  border-color: #5B21B6;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-step3-tone {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #C4B5FD;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step3-tone:hover, .btn-step3-tone:focus {
  background: #6D28D9;
  border-color: #6D28D9;
  color: #ffffff;
}
.btn-step3-soft {
  background: #F5F3FF;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-step3-soft:hover, .btn-step3-soft:focus {
  background: #EDE9FE;
  border-color: #6D28D9;
  color: #4C1D95;
}
body.dark-mode .btn-step3-tone {
  background: rgba(109, 40, 217, 0.28);
  color: #DDD6FE;
  border-color: rgba(196, 181, 253, 0.45);
}
body.dark-mode .btn-step3-soft {
  background: rgba(109, 40, 217, 0.16);
  color: #DDD6FE;
  border-color: rgba(196, 181, 253, 0.35);
}

/* ===== คู่มือการบริหารจัดการระบบ (Admin Guide) ดีไซน์ใหม่ ทันสมัย อ่านเข้าใจง่าย (ข้อ 5) ===== */
.guide-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.guide-filter-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(15, 41, 34, 0.04);
}
.guide-filter-btn:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
  transform: translateY(-1px);
}
.guide-filter-btn.active {
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%);
  border-color: #0E8A72;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 138, 114, 0.25);
}
.guide-flow-banner {
  background: linear-gradient(135deg, #F0FDF4 0%, #E0F2FE 52%, #F5F3FF 100%);
  border: 1px solid #A7F3D0;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 0 rgba(14, 138, 114, 0.12), 0 8px 22px rgba(15, 41, 34, 0.06);
}
body.dark-mode .guide-flow-banner {
  background: linear-gradient(135deg, rgba(14, 138, 114, 0.18) 0%, rgba(2, 132, 199, 0.16) 52%, rgba(109, 40, 217, 0.18) 100%);
  border-color: rgba(110, 231, 183, 0.3);
}
.guide-flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.guide-flow-node {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  position: relative;
  box-shadow: 0 3px 0 rgba(15, 41, 34, 0.06), 0 4px 12px rgba(15, 41, 34, 0.04);
  transition: transform 0.2s ease;
}
.guide-flow-node:hover {
  transform: translateY(-2px);
}
.guide-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}
.guide-mod-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-top: 4px solid var(--mod-color, #0E8A72);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 0 rgba(15, 41, 34, 0.05), 0 8px 20px rgba(15, 41, 34, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-mod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(15, 41, 34, 0.07), 0 12px 26px rgba(15, 41, 34, 0.09);
}
.guide-mod-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.guide-mod-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mod-soft, #ECFDF5);
  color: var(--mod-color, #0E8A72);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid var(--mod-bd, #A7F3D0);
}
.guide-sublist {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  display: grid;
  gap: 8px;
}
.guide-sublist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.guide-sublist .num-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mod-soft, #ECFDF5);
  color: var(--mod-color, #0E8A72);
  font-weight: 700;
  font-size: 11px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--mod-bd, #A7F3D0);
}
.guide-tip-box {
  background: var(--mint-soft);
  border-left: 3px solid var(--mod-color, #0E8A72);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--ink);
}

/* ===== กล่องแจ้งเตือนยินดีต้อนรับ / ออกจากระบบ / รหัสผิด: กรอบมนเหลี่ยมขึ้น + Opacity จางลงอย่างเหมาะสม (ข้อ 1) ===== */
.rmu-toast-host {
  position: fixed;
  top: 64px;
  right: 18px;
  z-index: 1000000005;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 28px);
}
.rmu-toast-item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #0F2922;
  border: 1px solid rgba(14, 138, 114, 0.25);
  border-left: 3.5px solid #0E8A72;
  border-radius: 8px;
  padding: 8px 14px 8px 11px;
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 6px 20px rgba(15, 41, 34, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 340px;
  animation: rmuToastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.rmu-toast-item.is-hide {
  animation: rmuToastOut 0.18s ease forwards;
}
.rmu-toast-item.t-error {
  border-color: rgba(225, 29, 72, 0.28);
  border-left: 3.5px solid #E11D48;
}
.rmu-toast-item.t-warn {
  border-color: rgba(217, 119, 6, 0.3);
  border-left: 3.5px solid #D97706;
}
body.dark-mode .rmu-toast-item {
  background: rgba(16, 36, 30, 0.80);
  color: #E6F5F0;
  border-color: rgba(110, 231, 183, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}
.rmu-toast-ic {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  flex-shrink: 0;
}
.rmu-toast-item.t-ok .rmu-toast-ic {
  background: rgba(16, 185, 129, 0.18);
  color: #059669;
}
.rmu-toast-item.t-error .rmu-toast-ic {
  background: rgba(225, 29, 72, 0.16);
  color: #E11D48;
}
.rmu-toast-item.t-warn .rmu-toast-ic {
  background: rgba(217, 119, 6, 0.18);
  color: #D97706;
}
@keyframes rmuToastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rmuToastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

/* ปรับขนาดกล่อง SweetAlert2 ให้เป็นกรอบเหลี่ยมมนขึ้น + พื้นหลังโปร่งแสงจางลงเล็กน้อย */
.swal2-popup.rmu-swal-compact {
  width: min(92vw, 330px) !important;
  padding: 16px 18px 14px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(14, 138, 114, 0.22) !important;
  box-shadow: 0 14px 34px rgba(15, 41, 34, 0.14) !important;
  font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif !important;
}
body.dark-mode .swal2-popup.rmu-swal-compact {
  background: rgba(16, 36, 30, 0.86) !important;
  border-color: rgba(110, 231, 183, 0.25) !important;
}
.swal2-popup.rmu-swal-compact .swal2-icon {
  transform: scale(0.6) !important;
  margin: -8px auto -6px !important;
}
.swal2-popup.rmu-swal-compact .swal2-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  padding: 0 !important;
  margin-bottom: 4px !important;
}
.swal2-popup.rmu-swal-compact .swal2-html-container {
  font-size: 12.8px !important;
  color: var(--muted) !important;
  margin: 4px 0 10px !important;
  line-height: 1.45 !important;
}
.swal2-popup.rmu-swal-compact .swal2-actions {
  margin-top: 6px !important;
  gap: 8px !important;
}
.swal2-popup.rmu-swal-compact .swal2-confirm,
.swal2-popup.rmu-swal-compact .swal2-cancel {
  border-radius: 7px !important;
  padding: 5px 15px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* ===== เส้นชี้เชื่อมโยง (Callout Leader Lines) อธิบายหน้าต่างข้อมูลผู้พัฒนาในขั้นตอนที่ 8 (ข้อ 6) ===== */
.driver-popover.tour-step8-wide {
  max-width: min(95vw, 680px) !important;
  width: min(95vw, 680px) !important;
}
.tour-dev-annotated-wrap {
  display: grid;
  grid-template-columns: 255px 1fr;
  gap: 0;
  align-items: stretch;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  padding: 12px;
  margin-top: 8px;
  position: relative;
}
body.dark-mode .tour-dev-annotated-wrap {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.25);
}
.tour-dev-mock-modal {
  background: #ffffff;
  border: 1.5px solid #0E8A72;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(14, 138, 114, 0.14);
  color: #0F2922;
  font-size: 11.5px;
}
.tour-dev-mock-hd {
  background: #ECFDF5;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 11.5px;
  border-bottom: 1px solid #D1FAE5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #065F46;
}
.tour-dev-mock-body {
  padding: 10px;
  text-align: center;
}
.tour-dev-mock-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 6px;
  border: 2.5px solid #0E8A72;
  background: #ECFDF5;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}
.tour-dev-mock-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tour-dev-mock-info {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 7px 8px;
  text-align: left;
  margin-top: 6px;
  display: grid;
  gap: 5px;
}
.tour-dev-mock-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.8px;
  line-height: 1.3;
  padding: 2.5px 4px;
  border-radius: 6px;
  position: relative;
}
.tour-dev-mock-row.hl-1 { background: rgba(14, 138, 114, 0.09); border: 1px dashed rgba(14, 138, 114, 0.45); }
.tour-dev-mock-row.hl-2 { background: rgba(2, 132, 199, 0.09); border: 1px dashed rgba(2, 132, 199, 0.45); }
.tour-dev-mock-row.hl-3 { background: rgba(217, 119, 6, 0.09); border: 1px dashed rgba(217, 119, 6, 0.45); }
.tour-dev-mock-row.hl-4 { background: rgba(109, 40, 217, 0.09); border: 1px dashed rgba(109, 40, 217, 0.45); }
.tour-dev-mock-row.hl-5 { background: rgba(225, 29, 72, 0.09); border: 1px dashed rgba(225, 29, 72, 0.45); }

.tour-callout-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 4px;
  gap: 6px;
}
.tour-callout-item {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}
.tour-leader-line {
  width: 28px;
  height: 2px;
  background: var(--pin-col, #0E8A72);
  position: relative;
  flex-shrink: 0;
}
.tour-leader-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pin-col, #0E8A72);
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.2);
}
.tour-leader-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -3px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--pin-col, #0E8A72);
}
.tour-callout-box {
  flex: 1;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-left: 3.5px solid var(--pin-col, #0E8A72);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #0F2922;
  box-shadow: 0 2px 6px rgba(15, 41, 34, 0.05);
}
body.dark-mode .tour-callout-box {
  background: #10241E;
  border-color: rgba(110, 231, 183, 0.25);
  color: #E6F5F0;
}
.tour-pin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--pin-col, #0E8A72);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-right: 4px;
  flex-shrink: 0;
}
/* ป้ายเส้นชี้บนหน้าต่างจริง #devViewModal เมื่อเปิดทัวร์ขั้นตอนที่ 8 */
.dv-tour-pin {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
#devViewModal.tour-annotated-active .dv-tour-pin {
  display: inline-flex;
}

@media (max-width: 640px) {
  .tour-dev-annotated-wrap {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .tour-leader-line {
    width: 14px;
  }
}

/* ===== รองรับทุกแพลตฟอร์ม: มือถือ, แท็บเล็ต, โน้ตบุ๊ก, PC ไหลลื่นทุกขนาดหน้าจอ (ข้อ 3) ===== */
html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  overscroll-behavior-x: none;
}
a, button, .btn, .sb-link, .grp-item, .chip, select, input {
  touch-action: manipulation;
}
.table-responsive, .sb-nav, #gList, #pvStage {
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 991.98px) {
  .app-main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .main {
    padding: 14px 12px 24px !important;
  }
  .page-banner {
    padding: 14px 14px !important;
    border-radius: 16px !important;
  }
  .page-head {
    flex-wrap: wrap;
    gap: 10px !important;
  }
  .page-head h4 {
    font-size: 1.08rem !important;
  }
  .guide-mod-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 575.98px) {
  .rmu-toast-host {
    top: 12px;
    right: 50%;
    transform: translateX(50%);
    align-items: center;
    width: calc(100vw - 24px);
  }
  .rmu-toast-item {
    max-width: 100%;
  }
  .hero.hero-ag-terrace {
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }
  .hero h3 {
    font-size: 1.18rem !important;
  }
  .ag-search {
    padding: 4px 4px 4px 10px !important;
  }
  .ag-search .ag-btn {
    padding: 6px 12px !important;
    font-size: 12.5px !important;
  }
  .step-card .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .step-card .btn-group > .btn {
    flex: 1 1 auto;
    border-radius: 8px !important;
  }
  .stepper {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

/* ===== ช่องยืนยันตัวตนเจ้าของข้อมูล (โมเดิร์นเข้าธีมเว็บ) ===== */
.swal2-popup.rmu-swal-verify {
  width: min(92vw, 410px) !important;
  padding: 22px 22px 18px !important;
  border-radius: 18px !important;
}
.swal2-popup.rmu-swal-verify .swal2-title {
  font-size: 17px !important;
  margin-bottom: 8px !important;
}
.swal2-popup.rmu-swal-verify .swal2-input.rmu-swal-verify-input {
  width: 100% !important;
  height: 46px !important;
  margin: 10px 0 8px !important;
  padding: 0 16px !important;
  border-radius: 13px !important;
  border: 1.5px solid #CBD5E1 !important;
  background: #F8FAFC !important;
  color: #0F2922 !important;
  font-size: 14px !important;
  font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif !important;
  box-shadow: inset 0 1px 2px rgba(15, 41, 34, 0.04) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  box-sizing: border-box !important;
}
.swal2-popup.rmu-swal-verify .swal2-input.rmu-swal-verify-input::placeholder {
  color: #94A3B8 !important;
}
.swal2-popup.rmu-swal-verify .swal2-input.rmu-swal-verify-input:focus {
  border-color: #0E8A72 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 4px rgba(14, 138, 114, 0.15) !important;
  outline: none !important;
}
body.dark-mode .swal2-popup.rmu-swal-verify .swal2-input.rmu-swal-verify-input {
  background: rgba(15, 36, 30, 0.85) !important;
  border-color: rgba(110, 231, 183, 0.28) !important;
  color: #E6F5F0 !important;
}
body.dark-mode .swal2-popup.rmu-swal-verify .swal2-input.rmu-swal-verify-input:focus {
  border-color: #34D399 !important;
  background: #0F2922 !important;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18) !important;
}
.swal2-popup.rmu-swal-verify .swal2-confirm.rmu-swal-verify-confirm,
.swal2-popup.rmu-swal-verify .swal2-cancel.rmu-swal-verify-cancel {
  border-radius: 11px !important;
  padding: 8px 20px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
}

/* ===== ทัวร์ขั้นตอนที่ 8: แสดงหน้าต่างข้อมูลผู้ดูแลระบบตัวจริงพร้อมไฮไลท์ ===== */
#devViewModal.tour-modal-active {
  z-index: 100005 !important;
  pointer-events: none !important;
}
#devViewModal.tour-modal-active .modal-dialog {
  transition: none !important;
  transform: none !important;
}
@media (min-width: 576px) {
  #devViewModal.tour-modal-active .modal-dialog {
    padding-bottom: 72px;
  }
}
#devViewModal.tour-modal-active .modal-content {
  pointer-events: auto !important;
  box-shadow: 0 18px 48px rgba(14, 138, 114, 0.28) !important;
  border: 2px solid #0E8A72 !important;
}
#tourFooter.tour-footer-active {
  position: relative !important;
  z-index: 100004 !important;
  border-top: 2px solid #0E8A72 !important;
  box-shadow: 0 -10px 30px rgba(14, 138, 114, 0.24) !important;
}
#tourFooter.tour-footer-active #tourFooterContact {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--mint-soft);
  border: 1.5px solid #0E8A72;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(14, 138, 114, 0.2);
}

/* ===== ปุ่มและเมนู ซ่อน/แสดงสถานะและคอลัมน์ ===== */
.cardx.vis-overflow-card {
  overflow: visible;
}
.cardx.vis-open-host,
.page-banner.vis-open-host,
.filterbar-wrap.vis-open-host,
.cardx:has(.vis-menu.show),
.page-banner:has(.vis-menu.show),
.filterbar-wrap:has(.vis-menu.show) {
  overflow: visible !important;
  z-index: 80 !important;
}
.vis-dropdown {
  position: relative;
  display: inline-block;
}
.vis-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12.5px;
  transition: all 0.16s ease;
}
.vis-trigger-btn:hover,
.vis-trigger-btn.has-hidden {
  border-color: var(--turquoise);
  background: var(--mint-soft);
  color: var(--emerald-800);
}
body.dark-mode .vis-trigger-btn.has-hidden {
  color: #6EE7B7;
}
.vis-count-pill {
  background: #E11D48;
  color: #ffffff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}
.vis-menu {
  min-width: 278px;
  max-width: min(92vw, 320px);
  max-height: 410px;
  overflow-y: auto;
  padding: 10px !important;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
  background: var(--card-bg) !important;
  box-shadow: 0 16px 38px rgba(15, 41, 34, 0.16) !important;
  z-index: 1085 !important;
}
.vis-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 6px 2px 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.vis-sec-head:first-child {
  margin-top: 0;
}
.vis-item-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}
.vis-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid #E2E8F0;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.vis-item-btn:hover {
  border-color: var(--turquoise);
  background: var(--mint-soft);
}
.vis-item-btn.is-hidden {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}
.vis-item-btn.is-hidden .vis-item-lbl {
  text-decoration: line-through;
  opacity: 0.8;
}
body.dark-mode .vis-item-btn {
  background: rgba(16, 36, 30, 0.72);
  border-color: rgba(110, 231, 183, 0.2);
}
body.dark-mode .vis-item-btn.is-hidden {
  background: rgba(159, 18, 57, 0.22);
  border-color: rgba(253, 164, 175, 0.35);
  color: #FDA4AF;
}
.vis-state-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.vis-state-tag.shown {
  background: #DCFCE7;
  color: #15803D;
}
.vis-state-tag.hidden {
  background: #FFE4E6;
  color: #BE123C;
}
.vis-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
}
.vis-active-chip i.rm-x {
  cursor: pointer;
  font-size: 12px;
}

/* ===== การ์ดหน้าเปรียบเทียบข้อมูลเปิด/ปิดได้ และปุ่มเรียงลำดับบนการ์ด ===== */
.card-collapse-btn i {
  display: inline-block;
  transition: transform 0.2s ease;
}
.card-collapse-btn.is-collapsed i {
  transform: rotate(180deg);
}
.card-sort-btn.is-sorted {
  background: var(--mint-soft);
  border-color: var(--turquoise);
  color: var(--turquoise);
}

/* ===== หน้าข้อมูลที่ยังไม่กรอก, Quick Fill และระบบสแกน QR เข้าสู่ระบบ ===== */
.inc-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.inc-field-chip:hover {
  border-color: var(--turquoise);
  background: var(--mint-soft);
}
.inc-field-chip.on {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: #ffffff;
}
.inc-field-chip .cnt {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(245, 158, 11, 0.18);
  color: #B45309;
  font-weight: 700;
}
.inc-field-chip.on .cnt {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}
.inc-miss-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #FFF7ED;
  color: #9A3412;
  border: 1px solid #FED7AA;
}
.inc-miss-pill.crit {
  background: #FFF1F2;
  color: #9F1239;
  border-color: #FECDD3;
}
.inc-field-highlight {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.2) !important;
}
.qr-scan-box {
  width: 100%;
  min-height: 220px;
  max-height: 280px;
  background: var(--mint-soft);
  border: 1.5px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-scan-box.is-live {
  background: #0B1914;
  border-style: solid;
  border-color: var(--turquoise);
  height: 245px;
}
.qr-scan-box.drag {
  border-color: var(--turquoise);
  background: rgba(14, 138, 114, 0.12);
}
.qr-scan-reticle {
  position: absolute;
  inset: 18px;
  max-width: 186px;
  max-height: 186px;
  margin: auto;
  border: 2px solid rgba(52, 211, 153, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  overflow: hidden;
}
.qr-scan-reticle span {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #34D399, transparent);
  animation: qrBeamMove 2s ease-in-out infinite;
}
@keyframes qrBeamMove {
  0%, 100% { top: 10%; }
  50% { top: 88%; }
}
.sec-qr-stage {
  background: var(--mint-soft);
  border: 1px dashed var(--line);
}
body.dark-mode .inc-miss-pill {
  background: rgba(154, 52, 18, 0.26);
  color: #FDBA74;
  border-color: rgba(251, 146, 60, 0.35);
}
body.dark-mode .inc-miss-pill.crit {
  background: rgba(159, 18, 57, 0.28);
  color: #FDA4AF;
  border-color: rgba(253, 164, 175, 0.38);
}
body.dark-mode .inc-field-chip .cnt {
  background: rgba(245, 158, 11, 0.28);
  color: #FDE68A;
}
.btn-line {
  background: #06C755;
  border-color: #06C755;
  color: #ffffff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  gap: 10px;
}
.btn-line:hover, .btn-line:focus {
  background: #05B34C;
  border-color: #05B34C;
  color: #ffffff;
}
.btn-line:active {
  background: #049E43 !important;
  border-color: #049E43 !important;
  color: #ffffff !important;
}
.branch-scope-bar {
  background: linear-gradient(135deg, #ECFDF5 0%, #E0F2FE 100%);
  border: 1px solid #99F6E4;
  color: #065F46;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body.dark-mode .branch-scope-bar {
  background: rgba(13, 148, 136, 0.16);
  border-color: rgba(45, 212, 191, 0.35);
  color: #CCFBF1;
}
.bs-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface, #fff);
}
.sec-int-block {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
body.dark-mode .sec-int-block {
  background: rgba(255, 255, 255, 0.035);
  border-color: #1E4036;
}
.bs-major-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
@media (max-width: 576px) {
  .bs-major-grid {
    grid-template-columns: 1fr;
  }
}
.bs-major-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--cream-2, #f8fafc);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  touch-action: manipulation;
}
.bs-major-opt:has(input:checked) {
  border-color: var(--turquoise);
  background: var(--mint-soft);
  font-weight: 600;
}
.bs-line-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #ECFDF5;
  border: 1px solid #86EFAC;
  color: #065F46;
  font-size: 12px;
  max-width: 100%;
}
.bs-line-chip > span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 575px) {
  .bs-line-chip > span {
    max-width: 140px;
  }
}
.btn-google {
  background: #ffffff !important;
  color: #1F2937 !important;
  border: 1px solid #D1D5DB !important;
  font-weight: 600;
  border-radius: 12px !important;
  padding: 8px 16px !important;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.16s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn-google:hover {
  background: #F9FAFB !important;
  border-color: #9CA3AF !important;
  color: #111827 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-google:active {
  background: #F3F4F6 !important;
}
.btn-google.btn-xs {
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.btn-google.btn-xs svg {
  width: 14px !important;
  height: 14px !important;
}
.btn-line.btn-xs {
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
}
body.dark-mode .btn-google {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}
body.dark-mode .btn-google:hover {
  background: #334155 !important;
  border-color: #475569 !important;
}
.bs-google-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #EFF6FF;
  border: 1px solid #93C5FD;
  color: #1E40AF;
  font-size: 12px;
  max-width: 100%;
}
.bs-google-chip > span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 575px) {
  .bs-google-chip > span {
    max-width: 140px;
  }
}
body.dark-mode .bs-google-chip {
  background: rgba(30, 58, 138, 0.35);
  border-color: rgba(96, 165, 250, 0.4);
  color: #BFDBFE;
}

/* ==========================================================================
   ENHANCED LOGIN MODAL & SECURITY MANAGEMENT STYLING (V70)
   ========================================================================== */
#loginModal .modal-dialog {
  max-width: 420px;
}
#loginModal .modal-content {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(14, 138, 114, 0.18);
  box-shadow: 0 20px 40px -10px rgba(14, 138, 114, 0.22), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAF9 100%);
  overflow: hidden;
  padding: 1.5rem !important;
}
#loginModal .modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0E8A72 0%, #10B981 50%, #06C755 100%);
}
#loginModal .btn-close {
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
#loginModal .btn-close:hover {
  opacity: 1;
}
#loginModal .ic-badge {
  background: #0E8A72 !important;
  border: none !important;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(14, 138, 114, 0.35);
}
#loginModal .ic-badge i, #loginModal .ic-badge .ic-badge-staff-icon {
  color: #FFFFFF !important;
}
#loginModal #lgHeading {
  font-weight: 800;
  font-size: 1.25rem;
  color: #0F172A;
  letter-spacing: -0.01em;
}
#loginModal #lgSubHeading {
  font-size: 0.82rem;
  color: #64748B;
  margin-top: 3px;
}
#loginModal #lgModeTabs {
  background: #F1F5F4;
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(14, 138, 114, 0.12);
  gap: 2px;
}
#loginModal #lgModeTabs button {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 9px;
  color: #475569;
  border: none;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#loginModal #lgModeTabs button.on {
  background: #FFFFFF;
  color: #0E8A72;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(14, 138, 114, 0.1);
}
#loginModal .form-control {
  border-color: #E2E8F0;
  border-radius: 10px;
  font-size: 0.9rem;
  padding: 9px 12px;
  transition: all 0.2s ease;
}
#loginModal .input-group-text {
  background: #F8FAFC;
  border-color: #E2E8F0;
  border-radius: 10px 0 0 10px;
}
#loginModal .input-group .form-control {
  border-radius: 0 10px 10px 0;
}
#loginModal .input-group .form-control:not(:last-child) {
  border-radius: 0;
}
#loginModal .form-control:focus {
  border-color: #0E8A72;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.15);
}
#loginModal .btn-main {
  background: linear-gradient(135deg, #0E8A72 0%, #129E83 100%);
  border: none;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(14, 138, 114, 0.25);
  transition: all 0.2s ease;
}
#loginModal .btn-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 138, 114, 0.35);
}
#loginModal .btn-google {
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
#loginModal .btn-line {
  background: #06C755;
  border: none;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 14px;
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.22);
}
#loginModal .btn-line:hover {
  background: #05B34C;
  color: #FFFFFF;
  transform: translateY(-1px);
}
body.dark-mode #loginModal .modal-content {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}
body.dark-mode #loginModal #lgHeading {
  color: #F8FAFC;
}
body.dark-mode #loginModal #lgSubHeading {
  color: #94A3B8;
}
body.dark-mode #loginModal #lgModeTabs {
  background: #0F172A;
  border-color: #334155;
}
body.dark-mode #loginModal #lgModeTabs button {
  color: #94A3B8;
}
body.dark-mode #loginModal #lgModeTabs button.on {
  background: #1E293B;
  color: #34D399;
}
body.dark-mode #loginModal .form-control {
  background: #0F172A;
  border-color: #334155;
  color: #F8FAFC;
}
body.dark-mode #loginModal .input-group-text {
  background: #1E293B;
  border-color: #334155;
  color: #94A3B8;
}

/* ==========================================================================
   AUDIT QUALITY FIXES: TOUCH TARGETS, DARK MODE & RESPONSIVE POLISH
   ========================================================================== */
/* ปุ่มถอดสิทธิ์รายคน ขนาดเป้าหมายสัมผัส (Touch Target) ตามมาตรฐาน WCAG 2.5.8 (อย่างน้อย 24px) */
.bs-chip-rm-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  margin-left: 3px;
  border-radius: 50%;
  color: #DC2626 !important;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.bs-chip-rm-btn:hover, .bs-chip-rm-btn:focus-visible {
  background-color: rgba(220, 38, 38, 0.14) !important;
  transform: scale(1.15);
  outline: none;
}
.bs-chip-rm-btn:active {
  transform: scale(0.95);
}

/* Dark Mode Overrides สำหรับกล่อง Staff กลาง & Staff ประจำสาขา */
body.dark-mode #secStaffConfigCard,
body.dark-mode .bs-card {
  background-color: #10241E !important;
  border-color: #1E4036 !important;
}
body.dark-mode .bs-card .border-bottom {
  border-bottom-color: #1E4036 !important;
}

/* Responsive Polish สำหรับการ์ดสาขาบนมือถือ (<576px) */
@media (max-width: 575px) {
  .bs-card .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .bs-card .d-flex.justify-content-between > div:last-child {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px dashed rgba(14, 138, 114, 0.18);
  }
}

/* ==========================================================================
   IMPECCABLE CRAFT FLOOR: BROWSER SURFACES, FOCUS RINGS, SELECTION & SCROLLBARS
   ========================================================================== */

/* 1. Selection & Caret Palette Theming */
::selection {
  background-color: rgba(14, 138, 114, 0.22);
  color: inherit;
}
input, textarea {
  caret-color: #0E8A72;
}
body.dark-mode ::selection {
  background-color: rgba(52, 211, 153, 0.32);
  color: #F8FAFC;
}
body.dark-mode input, body.dark-mode textarea {
  caret-color: #34D399;
}

/* 2. Global Accessible Focus Rings (WCAG 2.4.7 Focus Visible) */
a:focus-visible,
button:focus-visible,
.form-check-input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #0E8A72 !important;
  outline-offset: 2px !important;
}
body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode .form-check-input:focus-visible,
body.dark-mode [tabindex]:focus-visible {
  outline: 2px solid #34D399 !important;
  outline-offset: 2px !important;
}

/* Thin, Clean, High-end Focus Highlight for Form Controls */
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible,
.form-control:focus,
.form-control:focus-visible,
.form-select:focus,
.form-select:focus-visible,
#loginModal .form-control:focus {
  outline: none !important;
  outline-offset: 0 !important;
  border-color: #0E8A72 !important;
  box-shadow: 0 0 0 2px rgba(14, 138, 114, 0.16) !important;
}
body.dark-mode input:focus,
body.dark-mode input:focus-visible,
body.dark-mode textarea:focus,
body.dark-mode textarea:focus-visible,
body.dark-mode select:focus,
body.dark-mode select:focus-visible,
body.dark-mode .form-control:focus,
body.dark-mode .form-control:focus-visible,
body.dark-mode .form-select:focus,
body.dark-mode .form-select:focus-visible,
body.dark-mode #loginModal .form-control:focus {
  outline: none !important;
  outline-offset: 0 !important;
  border-color: #2DD4BF !important;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.22) !important;
}

/* 3. Tabular Numerals for Stable Numerical Readouts & Dashboard Counters */
.stat-number,
.stat-val,
.badge,
.table td,
.counter,
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 4. Link Underline Offset */
a {
  text-underline-offset: 3px;
}

/* 5. Themed Custom Scrollbars Across WebKit & Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 138, 114, 0.25) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(14, 138, 114, 0.25);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 138, 114, 0.45);
}
body.dark-mode * {
  scrollbar-color: rgba(52, 211, 153, 0.25) transparent;
}
body.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.25);
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 211, 153, 0.45);
}

/* ==========================================================================
   IMPECCABLE HARDEN: DEFENSIVE RESILIENCE, ZOOM PREVENTION & OVERFLOW GUARDS
   ========================================================================== */

/* 1. Card & Flex Children Text Overflow Guards */
.bs-card {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 2. Button Disabled & Busy States */
.btn:disabled,
.btn.disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* 3. Mobile Form Zoom Prevention (iOS Safari force-zooms inputs under 16px) */
@media (max-width: 767px) {
  #loginModal .form-control,
  #loginModal .form-select,
  #branchEditorModal .form-control,
  #branchEditorModal .form-select,
  #authSecurityModal .form-control,
  #authSecurityModal .form-select {
    font-size: 16px !important;
  }
}

/* ===== Letters Module Styles (Letters.html) ===== */
.doc-pv-stage {
  background: #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  overflow: auto;
  max-height: 76vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.doc-pv-canvas {
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.22);
  border-radius: 2px;
  max-width: 100%;
  height: auto;
}
.step-card.s3 {
  border-color: #DDD6FE;
  background: linear-gradient(180deg, rgba(243,232,255,0.28) 0%, var(--card-bg, #ffffff) 100%);
}
.step-card.s3 .hd { color: #6D28D9; }
.step-card.s3 .hd .n { background: #6D28D9; }
.step-upload-box {
  background: var(--mint-soft, #F0FDF4);
  border: 1px dashed var(--turquoise, #0E8A72);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
.step-card.s2 .step-upload-box {
  background: #F0F9FF;
  border-color: #7DD3FC;
}
.step-card.s3 .step-upload-box {
  background: #F5F3FF;
  border-color: #C4B5FD;
}
.signer-config-box {
  background: #F8FAFC;
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 12px;
  padding: 10px 12px;
}
body.dark-mode .signer-config-box {
  background: rgba(15, 23, 42, 0.4);
}
body.role-student .teacher-expert-only { display: none !important; }
body:not(.role-admin):not(.role-staff) .teacher-expert-only { display: none !important; }


/* ==========================================================================
   RMU AGRICULTURAL TECHNOLOGY UNIFIED POPUP & DIALOG THEME (LIGHT & DARK)
   ========================================================================== */
.swal2-container {
  z-index: 100020 !important;
}
.swal2-popup:not(.swal2-toast) {
  position: relative !important;
  overflow: hidden !important;
  width: min(92vw, 420px) !important;
  padding: 26px 24px 20px !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6FBF9 100%) !important;
  border: 1px solid rgba(14, 138, 114, 0.22) !important;
  box-shadow: 0 22px 48px -12px rgba(8, 76, 59, 0.26), 0 0 1px 1px rgba(14, 138, 114, 0.08) !important;
  font-family: 'IBM Plex Sans Thai', 'Prompt', 'Sarabun', sans-serif !important;
  color: var(--ink, #0F2922) !important;
}
.swal2-popup:not(.swal2-toast)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #084C3B 0%, #0E8A72 52%, #14A387 100%);
  z-index: 2;
}
.swal2-popup.rmu-swal-warn:not(.swal2-toast)::before {
  background: linear-gradient(90deg, #B45309 0%, #D97706 52%, #F59E0B 100%);
}
.swal2-popup.rmu-swal-danger:not(.swal2-toast)::before {
  background: linear-gradient(90deg, #9F1239 0%, #E11D48 52%, #FB7185 100%);
}
body.dark-mode .swal2-popup:not(.swal2-toast) {
  background: linear-gradient(180deg, #10241E 0%, #0B1915 100%) !important;
  border-color: rgba(45, 212, 191, 0.3) !important;
  box-shadow: 0 24px 52px -12px rgba(0, 0, 0, 0.72), 0 0 20px rgba(14, 138, 114, 0.18) !important;
  color: #E6F5F0 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon {
  transform: scale(0.76) !important;
  margin: -4px auto 2px !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success {
  border-color: rgba(14, 138, 114, 0.35) !important;
  color: #0E8A72 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: #0E8A72 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(14, 138, 114, 0.25) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-question {
  border-color: rgba(14, 138, 114, 0.35) !important;
  color: #0E8A72 !important;
}
.swal2-popup.rmu-swal-danger:not(.swal2-toast) .swal2-icon.swal2-question,
.swal2-popup.rmu-swal-danger:not(.swal2-toast) .swal2-icon.swal2-warning {
  border-color: rgba(225, 29, 72, 0.38) !important;
  color: #E11D48 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-title {
  font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif !important;
  font-size: 17.5px !important;
  font-weight: 700 !important;
  color: var(--ink, #0F2922) !important;
  padding: 0 4px !important;
  margin: 2px 0 8px !important;
  line-height: 1.35 !important;
}
body.dark-mode .swal2-popup:not(.swal2-toast) .swal2-title {
  color: #F0FDF9 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-html-container {
  font-size: 13.5px !important;
  color: var(--muted, #475569) !important;
  margin: 4px 0 14px !important;
  line-height: 1.55 !important;
}
body.dark-mode .swal2-popup:not(.swal2-toast) .swal2-html-container {
  color: #B4D6CA !important;
}
.swal2-popup:not(.swal2-toast) .swal2-actions {
  margin-top: 8px !important;
  gap: 10px !important;
  width: 100% !important;
  justify-content: center !important;
}
.swal2-popup:not(.swal2-toast) .swal2-confirm {
  border-radius: 12px !important;
  padding: 9px 22px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 6px 16px rgba(14, 138, 114, 0.28) !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease !important;
}
.swal2-popup:not(.swal2-toast) .swal2-confirm:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 20px rgba(14, 138, 114, 0.36) !important;
}
.swal2-popup.rmu-swal-danger:not(.swal2-toast) .swal2-confirm {
  background: linear-gradient(135deg, #E11D48 0%, #BE123C 100%) !important;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.28) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-cancel {
  border-radius: 12px !important;
  padding: 9px 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  background: #F1F5F4 !important;
  color: #334155 !important;
  border: 1px solid rgba(14, 138, 114, 0.18) !important;
  box-shadow: none !important;
  transition: background-color 0.16s ease !important;
}
.swal2-popup:not(.swal2-toast) .swal2-cancel:hover {
  background: #E2ECE9 !important;
}
body.dark-mode .swal2-popup:not(.swal2-toast) .swal2-cancel {
  background: rgba(20, 48, 40, 0.85) !important;
  color: #D1EAE2 !important;
  border-color: rgba(45, 212, 191, 0.25) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-input {
  width: 100% !important;
  height: 44px !important;
  margin: 8px 0 6px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1.5px solid #CBD5E1 !important;
  background: #F8FAFC !important;
  color: #0F2922 !important;
  font-size: 14px !important;
  font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif !important;
  box-sizing: border-box !important;
}
body.dark-mode .swal2-popup:not(.swal2-toast) .swal2-input {
  background: rgba(15, 36, 30, 0.88) !important;
  border-color: rgba(45, 212, 191, 0.3) !important;
  color: #E6F5F0 !important;
}

/* Custom RMU Popup Info Card inside SweetAlert2 */
.rmu-pop-card {
  text-align: left;
  background: var(--mint-soft, #E3F6F1);
  border: 1px solid rgba(14, 138, 114, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
  color: var(--ink, #0F2922);
  font-size: 13px;
}
body.dark-mode .rmu-pop-card {
  background: rgba(14, 138, 114, 0.14);
  border-color: rgba(45, 212, 191, 0.26);
  color: #E6F5F0;
}
.rmu-pop-card.warn {
  background: #FFFBEB;
  border-color: #FDE68A;
}
body.dark-mode .rmu-pop-card.warn {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(251, 191, 36, 0.3);
}
.rmu-pop-card.danger {
  background: #FFF1F2;
  border-color: #FECDD3;
}
body.dark-mode .rmu-pop-card.danger {
  background: rgba(225, 29, 72, 0.14);
  border-color: rgba(251, 113, 133, 0.3);
}
.rmu-pop-hero-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #E3F6F1 0%, #CCFBF1 100%);
  color: #0E8A72;
  border: 1px solid rgba(14, 138, 114, 0.22);
  box-shadow: 0 8px 20px rgba(14, 138, 114, 0.15);
}
body.dark-mode .rmu-pop-hero-badge {
  background: linear-gradient(135deg, rgba(14, 138, 114, 0.28) 0%, rgba(13, 148, 136, 0.2) 100%);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.32);
}
.rmu-pop-hero-badge.danger {
  background: linear-gradient(135deg, #FFE4E6 0%, #FECDD3 100%);
  color: #E11D48;
  border-color: rgba(225, 29, 72, 0.24);
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.14);
}
body.dark-mode .rmu-pop-hero-badge.danger {
  background: rgba(225, 29, 72, 0.24);
  color: #FB7185;
  border-color: rgba(251, 113, 133, 0.35);
}
.rmu-pop-hero-badge.warn {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #D97706;
  border-color: rgba(217, 119, 6, 0.24);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.14);
}
body.dark-mode .rmu-pop-hero-badge.warn {
  background: rgba(217, 119, 6, 0.24);
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.35);
}

/* Upload Modal (#upModal, #docModal, #stuDocModal) Enhanced Theme */
#upModal .modal-content,
#docModal .modal-content,
#stuDocModal .modal-content {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(14, 138, 114, 0.22);
  box-shadow: 0 22px 48px -12px rgba(8, 76, 59, 0.25);
  overflow: hidden;
}
#upModal .modal-content::before,
#docModal .modal-content::before,
#stuDocModal .modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #084C3B 0%, #0E8A72 52%, #14A387 100%);
  z-index: 3;
}
#upAlertBox {
  border-radius: 12px !important;
  border: 1px solid rgba(14, 138, 114, 0.24) !important;
  background: var(--mint-soft, #E3F6F1) !important;
  color: var(--ink, #0F2922) !important;
}
body.dark-mode #upAlertBox {
  background: rgba(14, 138, 114, 0.16) !important;
  border-color: rgba(45, 212, 191, 0.3) !important;
  color: #E6F5F0 !important;
}


/* ===== Fix Item 4: Enforce Strict Horizontal Table Header Layout on Summary & Comparison Tables ===== */
#dPivot,
#cmpTable,
.tablex {
  display: table !important;
  width: 100% !important;
  border-collapse: collapse !important;
}
#dPivot thead,
#cmpTable thead,
.tablex thead {
  display: table-header-group !important;
}
#dPivot tbody,
#cmpTable tbody,
.tablex tbody {
  display: table-row-group !important;
}
#dPivot tfoot,
#cmpTable tfoot,
.tablex tfoot {
  display: table-footer-group !important;
}
#dPivot tr,
#cmpTable tr,
.tablex tr {
  display: table-row !important;
}
#dPivot thead tr > th,
#cmpTable thead tr > th,
#dPivot tbody tr > td,
#cmpTable tbody tr > td,
#dPivot tfoot tr > td,
#cmpTable tfoot tr > td,
.tablex thead tr > th,
.tablex tbody tr > td,
.tablex tfoot tr > td {
  display: table-cell !important;
  float: none !important;
  vertical-align: middle !important;
}
#dPivot thead tr > th,
#cmpTable thead tr > th {
  white-space: nowrap !important;
}



/* ==========================================================================
   RMU AGT MOBILE UI/UX OVERHAUL: PROPORTIONAL, FULL-VISIBILITY & APP-LIKE
   ========================================================================== */

/* Hide Mobile Bottom Nav on Desktop/Tablet (>= 768px) */
.mobile-bottom-nav {
  display: none;
}

/* Mobile Filter Toggle Button (Hidden on Desktop >= 768px) */
.mobile-filter-toggle-btn {
  display: none;
}

@media (max-width: 767.98px) {
  /* 1. Safe Bottom Spacing for Fixed Mobile Bottom Navigation Bar */
  .main {
    padding: 12px 10px 88px !important;
  }
  .app-footer {
    padding-bottom: 84px !important;
  }

  /* 2. Mobile Bottom Navigation Bar (Themed Light & Dark Mode) */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(14, 138, 114, 0.2);
    box-shadow: 0 -6px 24px rgba(8, 76, 59, 0.1);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  body.dark-mode .mobile-bottom-nav {
    background: rgba(11, 25, 21, 0.96);
    border-top-color: rgba(45, 212, 191, 0.24);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.55);
  }
  body.role-admin .mobile-bottom-nav .stu-mnav,
  body.role-staff .mobile-bottom-nav .stu-mnav {
    display: none !important;
  }
  body.role-student .mobile-bottom-nav .staff-mnav {
    display: none !important;
  }
  .mobile-bottom-nav .mnav-item {
    flex: 1 1 0;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--muted, #64748B);
    padding: 5px 2px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    transition: all 0.18s ease;
  }
  .mobile-bottom-nav .mnav-item i {
    font-size: 17px;
    line-height: 1;
    margin-bottom: 1px;
    transition: transform 0.18s ease;
  }
  .mobile-bottom-nav .mnav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .mobile-bottom-nav .mnav-item.active {
    background: var(--mint-soft, #E3F6F1);
    color: var(--turquoise, #0E8A72);
    font-weight: 700;
  }
  .mobile-bottom-nav .mnav-item.active i {
    transform: translateY(-1px);
  }
  body.dark-mode .mobile-bottom-nav .mnav-item {
    color: #94A3B8;
  }
  body.dark-mode .mobile-bottom-nav .mnav-item.active {
    background: rgba(14, 138, 114, 0.24);
    color: #34D399;
  }

  /* 3. Topbar & Breadcrumb Proportions on Mobile */
  .app-topbar {
    height: 54px !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }
  .crumb-bar {
    font-size: 12px !important;
    gap: 4px !important;
  }
  .crumb-bar #bcGroup {
    display: none;
  }
  .crumb-bar .bi-chevron-right {
    display: none;
  }
  .user-pill {
    padding: 3px 9px 3px 4px !important;
    gap: 6px !important;
  }
  .user-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
  }
  .user-info b {
    font-size: 11.5px !important;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-info small {
    font-size: 10px !important;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }
  .theme-btn {
    width: 34px !important;
    height: 34px !important;
  }

  /* 4. Page Banners & Action Button Groups on Mobile */
  .page-banner {
    padding: 12px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
  }
  .banner-meta {
    gap: 5px !important;
    margin-bottom: 6px !important;
  }
  .b-chip {
    font-size: 10.5px !important;
    padding: 3px 8px !important;
  }
  .page-head .ic {
    width: 36px !important;
    height: 36px !important;
    font-size: 17px !important;
    border-radius: 10px !important;
  }
  .page-head h4 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }
  .page-head .small.text-muted {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }
  .page-head > .d-flex {
    width: 100%;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-top: 4px;
  }
  .page-head > .d-flex > .btn {
    flex: 1 1 auto;
    font-size: 11.5px !important;
    padding: 6px 8px !important;
    text-align: center;
    justify-content: center;
  }

  /* 5. Balanced 2x2 KPI Cards on Mobile (See All 4 KPIs at a Glance!) */
  #dKpi > [class*="col-"],
  #cmpKpi > [class*="col-"],
  #pvKpi > [class*="col-"] {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
  #dKpi .kpi-card,
  #cmpKpi .kpi-card,
  #pvKpi .kpi-card,
  #dKpi .cardx,
  #cmpKpi .cardx,
  #pvKpi .cardx {
    padding: 10px 11px !important;
    border-radius: 13px !important;
  }
  #dKpi .kpi-val,
  #cmpKpi .kpi-val,
  #pvKpi .kpi-val,
  .kpi-num {
    font-size: 1.32rem !important;
    line-height: 1.15 !important;
  }
  #dKpi .kpi-lbl,
  #cmpKpi .kpi-lbl,
  #pvKpi .kpi-lbl {
    font-size: 11px !important;
  }

  /* 6. Collapsible Mobile Filter Bar (1-Tap Expand/Collapse) */
  .mobile-filter-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 11px;
    border: 1px solid rgba(14, 138, 114, 0.24);
    background: var(--mint-soft, #E3F6F1);
    color: var(--ink, #0F2922);
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
  }
  body.dark-mode .mobile-filter-toggle-btn {
    background: rgba(14, 138, 114, 0.18);
    border-color: rgba(45, 212, 191, 0.28);
    color: #E6F5F0;
  }
  .mobile-filter-collapsed > .row > [class*="col-"]:not(.mobile-keep-visible) {
    display: none !important;
  }
  .mobile-filter-collapsed .mobile-hide-when-collapsed {
    display: none !important;
  }

  /* 7. Proportional 5-Step Progress Stepper on Mobile (Fits 100% Width Without Clipping!) */
  .stepper {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 2px !important;
    padding: 8px 4px !important;
    overflow-x: visible !important;
  }
  .stepper .st-item {
    min-width: 0 !important;
    padding: 0 1px !important;
  }
  .stepper .st-circle,
  .stepper .dot {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
    margin: 0 auto 4px !important;
  }
  .stepper .st-label,
  .stepper .lbl {
    font-size: 9.5px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    display: block !important;
  }

  /* 8. Sticky First Column & Compact Proportions on Summary / Comparison / Student Tables */
  .table-responsive {
    border-radius: 12px;
    position: relative;
  }
  .table-responsive::before {
    content: '↔ ปัดตารางซ้าย-ขวาเพื่อดูข้อมูลครบทุกคอลัมน์';
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--turquoise, #0E8A72);
    background: var(--mint-soft, #E3F6F1);
    padding: 4px 10px;
    border-radius: 8px 8px 0 0;
    text-align: right;
    border-bottom: 1px solid rgba(14, 138, 114, 0.15);
  }
  body.dark-mode .table-responsive::before {
    background: rgba(14, 138, 114, 0.16);
    color: #34D399;
  }
  #dPivot th, #dPivot td,
  #cmpTable th, #cmpTable td,
  .tablex th, .tablex td {
    padding: 7px 8px !important;
    font-size: 12px !important;
  }
  #dPivot th:first-child,
  #dPivot td:first-child,
  #cmpTable th:first-child,
  #cmpTable td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: var(--card-bg, #ffffff) !important;
    box-shadow: 2px 0 6px rgba(15, 41, 34, 0.07);
    max-width: 145px;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  body.dark-mode #dPivot th:first-child,
  body.dark-mode #dPivot td:first-child,
  body.dark-mode #cmpTable th:first-child,
  body.dark-mode #cmpTable td:first-child {
    background: #10241E !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.4);
  }

  /* 9. Mistake-Proof File Row (.file-row) Layout on Mobile */
  .file-row {
    flex-wrap: wrap !important;
    padding: 10px 11px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }
  .file-row > .flex-grow-1 {
    width: calc(100% - 46px) !important;
    flex: 1 1 calc(100% - 46px) !important;
  }
  .file-row > .file-act {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding-top: 6px !important;
    border-top: 1px dashed rgba(14, 138, 114, 0.18) !important;
  }
  .file-row > .file-act .btn-xs {
    min-width: 36px !important;
    min-height: 34px !important;
    padding: 5px 10px !important;
    font-size: 12.5px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .file-row > .file-act .btn-outline-danger {
    margin-left: auto !important;
  }

  /* 10. Mobile-Optimized Modals (#viewModal, #formModal, #docModal, #upModal, #pvModal) */
  .modal-dialog {
    margin: 8px !important;
    max-width: calc(100vw - 16px) !important;
  }
  .modal-content {
    border-radius: 18px !important;
    max-height: calc(100dvh - 16px) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-header {
    padding: 12px 14px !important;
    position: sticky;
    top: 0;
    z-index: 5;
    background: inherit;
    border-radius: 18px 18px 0 0 !important;
  }
  .modal-body {
    padding: 12px 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 10px 14px !important;
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--card-bg, #ffffff);
    border-top: 1px solid var(--line, #E2E8F0);
    border-radius: 0 0 18px 18px !important;
  }
  body.dark-mode .modal-footer {
    background: #10241E !important;
    border-top-color: #1E4036 !important;
  }
  #viewModal #vBody > .d-flex.flex-wrap > .ms-auto {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 6px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  #viewModal #vBody > .d-flex.flex-wrap > .ms-auto > .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    padding: 7px 8px !important;
  }

  /* 11. Announcement Cards & Student Search Cards on Mobile */
  .ann-flex-row {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .ann-thumb-col {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }
  .ann-thumb-box {
    max-width: 240px !important;
    margin: 0 auto !important;
  }

  /* 12. Prevent iOS Safari Auto-Zoom on All Inputs & Selects */
  input.form-control,
  select.form-select,
  textarea.form-control,
  .ag-search input {
    font-size: 16px !important;
  }
}


/* ===== Internship & Document Queue Calendar Styles (#page-calendar — Minimal Clean UI) ===== */
.cal-min-banner {
  padding: 14px 18px !important;
  margin-bottom: 12px !important;
}
.cal-min-toolbar {
  border-radius: 14px;
  border: 1px solid var(--line, #E2E8F0);
}
.cal-nav-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.cal-min-filter {
  width: auto;
  min-width: 145px;
  max-width: 220px;
  border-radius: 10px;
  font-size: 12.5px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.cal-min-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
}
.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cal-stat-card {
  border-radius: 14px;
  border: 1px solid var(--line, #E2E8F0);
  background: var(--card-bg, #ffffff);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cal-stat-card:hover {
  border-color: rgba(14, 138, 114, 0.35);
}
.cal-stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.cal-stat-item {
  font-size: 11.5px;
  color: var(--muted, #64748B);
  padding: 2px 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s ease;
}
.cal-stat-item:hover {
  color: var(--turquoise, #0E8A72);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.cal-dow {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 8px;
  background: #F8FAFC;
  color: #475569;
  border: 1px solid rgba(226, 232, 240, 0.6);
}
.cal-dow.wknd {
  background: #FFF5F5;
  color: #DC2626;
  border-color: rgba(254, 202, 202, 0.5);
}
body.dark-mode .cal-dow {
  background: rgba(14, 138, 114, 0.14);
  color: #CBD5E1;
  border-color: rgba(255, 255, 255, 0.06);
}
body.dark-mode .cal-dow.wknd {
  background: rgba(225, 29, 72, 0.15);
  color: #FDA4AF;
}
.cal-cell {
  min-height: 88px;
  border: 1px solid var(--line, #E8EEF3);
  border-radius: 11px;
  padding: 6px 7px;
  background: var(--card-bg, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.14s ease;
}
.cal-cell.other-month {
  opacity: 0.32;
  background: transparent;
}
.cal-cell.is-holiday,
.cal-cell.is-weekend {
  background: rgba(254, 242, 242, 0.38);
}
body.dark-mode .cal-cell.is-holiday,
body.dark-mode .cal-cell.is-weekend {
  background: rgba(159, 18, 57, 0.1);
}
.cal-cell.is-today {
  border: 1.5px solid var(--turquoise, #0E8A72) !important;
  background: rgba(14, 138, 114, 0.025);
}
.cal-cell.admin-clickable {
  cursor: pointer;
}
.cal-cell.admin-clickable:hover {
  border-color: var(--turquoise, #0E8A72);
  background: rgba(14, 138, 114, 0.03);
}
.cal-day-num {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink, #0F2922);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}
.cal-cell.is-today .cal-day-num > span:first-child {
  background: var(--turquoise, #0E8A72);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.cal-cell-add-ic {
  opacity: 0;
  font-size: 11px;
  color: var(--turquoise, #0E8A72);
  transition: opacity 0.12s ease;
}
.cal-cell.admin-clickable:hover .cal-cell-add-ic {
  opacity: 0.85;
}
.cal-ev-pill {
  font-size: 10.5px;
  line-height: 1.25;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cal-ev-pill.ev-dispatch {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FED7AA;
}
.cal-ev-pill.ev-start {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.cal-ev-pill.ev-sup {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}
.cal-ev-pill.ev-end {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.cal-ev-pill.ev-orient {
  background: #ECFEFF;
  color: #0E7490;
  border: 1px solid #A5F3FC;
}
.cal-ev-pill.ev-custom {
  background: #FEFCE8;
  color: #A16207;
  border: 1px solid #FEF08A;
}
.cal-ev-pill.ev-done {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Minimal Side List Item */
.cal-side-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--line, #E8EEF3);
  background: var(--card-bg, #ffffff);
  transition: border-color 0.14s ease;
}
.cal-side-item:hover {
  border-color: rgba(14, 138, 114, 0.35);
}
.cal-line-time-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(6, 199, 85, 0.09);
  color: #059669;
  border: 1px solid rgba(6, 199, 85, 0.24);
}
.cal-line-time-tag.sent {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

/* ===== Minimal Clean Calendar Event Modal (.rmu-cal-min-popup) ===== */
.swal2-popup.rmu-cal-min-popup {
  width: 470px !important;
  max-width: 95vw !important;
  padding: 20px 22px 18px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(15, 41, 34, 0.08) !important;
  box-shadow: 0 20px 45px -12px rgba(15, 41, 34, 0.18) !important;
  background: var(--card-bg, #ffffff) !important;
}
.swal2-popup.rmu-cal-min-popup::before {
  display: none !important;
}
.swal2-popup.rmu-cal-min-popup .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
.swal2-popup.rmu-cal-min-popup .swal2-actions {
  margin: 14px 0 0 !important;
  padding: 0 !important;
  width: 100% !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}
.cal-min-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line, #EEF2F6);
}
.cal-min-modal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink, #0F2922);
  margin: 0;
}
.cal-min-modal-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #ECFDF5;
  color: #0E8A72;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cal-min-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.cal-min-close-btn:hover {
  background: #F1F5F9;
  color: #334155;
}
.cal-min-lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-min-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.cal-min-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #475569;
  font-size: 11.8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.14s ease;
}
.cal-min-type-btn:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
}
.cal-min-type-btn.active {
  background: #ECFDF5;
  color: #0B6B53;
  border-color: #10B981;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.12);
}
body.dark-mode .cal-min-type-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #CBD5E1;
}
body.dark-mode .cal-min-type-btn.active {
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
  border-color: #10B981;
}
.cal-min-input {
  width: 100%;
  height: 35px;
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: var(--card-bg, #ffffff);
  color: var(--ink, #0F2922);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.cal-min-input:focus {
  border-color: #0E8A72;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.12);
}
.cal-min-row2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.cal-min-line-card {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  transition: all 0.16s ease;
}
.cal-min-line-card.is-on {
  background: rgba(6, 199, 85, 0.045);
  border-color: rgba(6, 199, 85, 0.3);
}
body.dark-mode .cal-min-line-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .cal-min-line-card.is-on {
  background: rgba(6, 199, 85, 0.09);
  border-color: rgba(6, 199, 85, 0.35);
}
.cal-notify-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.cal-notify-chip {
  padding: 3.5px 9px;
  border-radius: 99px;
  border: 1px solid #CBD5E1;
  background: #ffffff;
  color: #475569;
  font-size: 11.2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.cal-notify-chip:hover {
  border-color: #06C755;
  color: #059669;
}
.cal-notify-chip.active {
  background: #06C755;
  color: #ffffff;
  border-color: #06C755;
}
body.dark-mode .cal-notify-chip {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
}
body.dark-mode .cal-notify-chip.active {
  background: #06C755;
  color: #ffffff;
  border-color: #06C755;
}
.cal-time-preset {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #ffffff;
  color: #64748B;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.cal-time-preset:hover,
.cal-time-preset.active {
  background: #ECFDF5;
  color: #059669;
  border-color: #6EE7B7;
}
@media (max-width: 767.98px) {
  .cal-grid {
    gap: 3px;
  }
  .cal-cell {
    min-height: 68px;
    padding: 4px 3px;
    border-radius: 8px;
  }
  .cal-ev-pill {
    font-size: 9.5px;
    padding: 1px 4px;
  }
  .cal-min-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cal-min-row2 {
    grid-template-columns: 1fr 1fr;
  }
}


/* ===== 4. ตราสัญลักษณ์ราชภัฏพร้อมออร่าสีทองละมุน (ไม่มีจุด 4 จุดกะพริบ) ===== */
@keyframes rmuGoldAuraBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.98;
  }
}
.brand {
  cursor: pointer;
}
.brand .logo {
  position: relative !important;
  width: 44px !important;
  height: 54px !important;
  z-index: 1;
  overflow: visible !important;
}
.brand .logo::before {
  content: '';
  position: absolute;
  inset: -9px -10px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(253, 224, 71, 0.40) 0%,
    rgba(245, 158, 11, 0.20) 44%,
    rgba(217, 119, 6, 0.06) 66%,
    transparent 80%
  );
  filter: blur(4px);
  z-index: -1;
  pointer-events: none;
  animation: rmuGoldAuraBreath 4.8s ease-in-out infinite;
}
.brand .logo::after {
  display: none !important;
  content: none !important;
}
.brand .logo img {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 7px rgba(250, 204, 21, 0.40)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  transition: transform 0.22s ease, filter 0.22s ease;
}
.brand:hover .logo img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 11px rgba(253, 224, 71, 0.58)) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

/* ===== 2. ปุ่มเลือกช่องทางแจ้งเตือน LINE / อีเมล ในหน้าต่างปฏิทิน ===== */
.cal-ch-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-ch-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid #CBD5E1;
  background: #ffffff;
  color: #64748B;
  cursor: pointer;
  transition: all 0.14s ease;
}
.cal-ch-pill:hover {
  border-color: #94A3B8;
}
.cal-ch-pill.active-line {
  background: #ECFDF5;
  color: #059669;
  border-color: #06C755;
  box-shadow: 0 1px 2px rgba(6, 199, 85, 0.12);
}
.cal-ch-pill.active-email {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #60A5FA;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}
body.dark-mode .cal-ch-pill {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.14);
  color: #94A3B8;
}
body.dark-mode .cal-ch-pill.active-line {
  background: rgba(6, 199, 85, 0.18);
  color: #6EE7B7;
  border-color: #06C755;
}
body.dark-mode .cal-ch-pill.active-email {
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
  border-color: #60A5FA;
}
.cal-email-time-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

/* ===== 5. ปรับปรุงการแสดงผลเฉพาะหน้าจอมือถือ (Full-Width Clean Mobile UI/UX & Full-View Mobile Tour) ===== */
.mob-stu-meta,
.mob-only-pg {
  display: none !important;
}

@media (max-width: 767.98px) {
  #dListCard table.tablex thead tr > th.mob-hide-col,
  #dListCard table.tablex tbody tr > td.mob-hide-col,
  #listTableCard table.tablex thead tr > th.mob-hide-col,
  #listTableCard table.tablex tbody tr > td.mob-hide-col,
  table.tablex thead tr > th.mob-hide-col,
  table.tablex tbody tr > td.mob-hide-col,
  th.mob-hide-col,
  td.mob-hide-col,
  .mob-hide-col {
    display: none !important;
  }

  /* บังคับให้การ์ดทุกใบใน Bento Grid (จัดอันดับจังหวัด, กราฟวงกลมทุกใบ, หน้าเปรียบเทียบ) กว้างเต็มจอมือถือ 100% */
  .bento > .b4,
  .bento > .b6,
  .bento > .b8,
  .bento > .b12,
  #cardProv.b4,
  #cardType.b4,
  #cardDegree.b4,
  #cardGender.b4 {
    grid-column: span 12 !important;
  }
  .mob-stu-meta {
    display: block !important;
    font-size: 11.2px !important;
    color: var(--muted, #64748B) !important;
    font-weight: 400 !important;
    line-height: 1.38 !important;
    margin-top: 2px !important;
  }
  .mob-only-pg {
    display: block !important;
  }

  /* 5.0 ขยายพื้นที่ใช้งานและหน้าต่าง Modal ให้เต็มหน้าจอมือถืออย่างสวยงาม */
  .main {
    padding: 10px 8px 86px !important;
  }
  .modal-dialog {
    margin: 6px auto !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
  }
  .modal-body {
    padding: 12px 12px !important;
  }

  /* 5.1 ระบบทัวร์แนะนำการใช้งานบนมือถือ (ไม่กระทบฝั่งคอมพิวเตอร์ 100%) */
  body.driver-active .main {
    padding-bottom: 240px !important;
  }
  .driver-popover {
    max-width: calc(100vw - 16px) !important;
    min-width: calc(100vw - 16px) !important;
    padding: 11px 13px 10px !important;
    border-radius: 15px !important;
  }
  .driver-popover-title {
    font-size: 13.5px !important;
    margin-bottom: 4px !important;
    gap: 7px !important;
    line-height: 1.25 !important;
  }
  .tour-step-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 11.8px !important;
    border-radius: 7px !important;
  }
  .tour-kicker {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
    margin-bottom: 1px !important;
  }
  .driver-popover-description {
    font-size: 11.6px !important;
    line-height: 1.42 !important;
    margin-bottom: 2px !important;
  }
  .tour-pill-row {
    gap: 4px !important;
    margin-top: 5px !important;
  }
  .tour-pill {
    font-size: 10px !important;
    padding: 2px 7px !important;
  }
  .driver-popover-footer {
    margin-top: 7px !important;
    padding-top: 7px !important;
  }
  .driver-popover-progress-text {
    font-size: 10.5px !important;
    padding: 3px 9px !important;
  }
  .driver-popover-navigation-btns button {
    padding: 4px 12px !important;
    font-size: 11.5px !important;
  }

  /* ข้อ 4 & 6: ขั้นตอนที่ 2 บนมือถือ — ย่อสัดส่วนการ์ดตัวอย่างให้แสดงครบ 100% ตั้งแต่หัวการ์ดถึงปุ่มอัปโหลดด้านล่าง */
  body.driver-active #sampleDemoCardWrap {
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    zoom: 0.72;
  }
  body.driver-active #sampleDemoCardWrap .sample-card-outer {
    padding: 6px !important;
    border-radius: 14px !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-card-banner {
    font-size: 10.5px !important;
    padding: 3px 8px !important;
    margin-bottom: 5px !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-demo-card .head {
    padding: 7px 10px !important;
    gap: 6px !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-demo-card .head i.fs-4 {
    font-size: 1rem !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-demo-card .head .fw-bold {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-demo-card .head .small {
    font-size: 9.5px !important;
    line-height: 1.2 !important;
  }
  body.driver-active #sampleDemoCardWrap .sample-demo-card > .p-3,
  body.driver-active #sampleDemoCardWrap .sample-demo-card > .p-md-4 {
    padding: 8px 9px !important;
  }
  body.driver-active #sampleDemoCardWrap h6.fw-bold {
    font-size: 11.8px !important;
    margin-bottom: 2px !important;
  }
  body.driver-active #sampleDemoCardWrap .small {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }
  body.driver-active #sampleDemoCardWrap .chip {
    font-size: 9.2px !important;
    padding: 2px 6px !important;
    margin: 1px 2px 1px 0 !important;
  }
  body.driver-active #sampleDemoCardWrap .stepper {
    padding: 4px 2px !important;
    margin: 4px 0 !important;
  }
  body.driver-active #sampleDemoCardWrap .stepper .st .b {
    width: 19px !important;
    height: 19px !important;
    font-size: 9.5px !important;
  }
  body.driver-active #sampleDemoCardWrap .stepper .st small {
    font-size: 8.5px !important;
    line-height: 1.12 !important;
  }
  body.driver-active #sampleDemoCardWrap .row.g-3.mt-1 {
    --bs-gutter-y: 4px !important;
    margin-top: 4px !important;
  }
  body.driver-active #sampleDemoCardWrap ol.ps-3 {
    margin-bottom: 2px !important;
    padding-left: 1rem !important;
  }
  body.driver-active #sampleDemoCardWrap ol.ps-3 li {
    margin-bottom: 1px !important;
    font-size: 10px !important;
  }
  body.driver-active #sampleDemoCardWrap .file-row {
    padding: 4px 7px !important;
    margin-bottom: 3px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  body.driver-active #sampleDemoCardWrap .file-ico {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }
  body.driver-active #sampleDemoCardWrap .file-row .btn-xs {
    padding: 2px 6px !important;
    font-size: 9.5px !important;
    min-height: 22px !important;
  }
  body.driver-active #sampleDemoCardWrap .border-top {
    margin-top: 6px !important;
    padding-top: 6px !important;
  }
  body.driver-active #sampleDemoCardWrap .border-top .btn-xs {
    font-size: 10px !important;
    padding: 4px 10px !important;
  }

  /* ข้อ 5: ขั้นตอนที่ 5 บนมือถือ — ซ่อนปุ่ม "รีเซ็ตค่าเริ่มต้น" ออกจากกรอบไฮไลต์ */
  body.driver-active #page-calc .page-head > .d-flex {
    display: none !important;
  }

  /* ข้อ 6: ขั้นตอนที่ 8 บนมือถือ — ย่อสัดส่วนหน้าต่างข้อมูลผู้พัฒนาให้แสดงครบ 100% เต็มจอมือถือ (ไม่ตัดข้อความติดต่อ) */
  body.driver-active #devViewModal {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 10px !important;
  }
  body.driver-active #devViewModal .modal-dialog,
  body.driver-active #devViewModal .modal-dialog-centered {
    margin: 0 auto !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    min-height: 0 !important;
    height: auto !important;
    align-items: flex-start !important;
    max-height: none !important;
  }
  body.driver-active #devViewModal .modal-content {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    border-radius: 16px !important;
    zoom: 0.88;
  }

  /* ข้อ 4: ปุ่มสลับโหมดเข้าสู่ระบบ (#lgModeTabs: Admin | Staff สาขา | สแกน LINE) เรียง 3 ปุ่มแถวเดียวเท่ากันสวยงาม */
  #loginModal #lgModeTabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 12px !important;
    width: 100% !important;
  }
  #loginModal #lgModeTabs button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 7px 4px !important;
    font-size: 11.8px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    border-radius: 9px !important;
    min-height: 36px !important;
  }
  #loginModal #lgModeTabs button i {
    margin: 0 !important;
    font-size: 12.5px !important;
  }
  body.driver-active #devViewModal .modal-header {
    padding: 8px 12px !important;
  }
  body.driver-active #devViewModal .modal-title {
    font-size: 13.5px !important;
  }
  body.driver-active #devViewModal .modal-body {
    padding: 10px 12px !important;
  }
  body.driver-active #devViewModal .dev-avatar-ring,
  body.driver-active #devViewModal img.rounded-circle,
  body.driver-active #devViewModal [id*="Avatar"] {
    width: 66px !important;
    height: 66px !important;
    margin-bottom: 6px !important;
  }
  body.driver-active #devViewModal h5,
  body.driver-active #devViewModal h4 {
    font-size: 14.5px !important;
    margin-bottom: 3px !important;
  }
  body.driver-active #devViewModal .small,
  body.driver-active #devViewModal .dev-info-row {
    font-size: 11.2px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }
  body.driver-active #devViewModal .modal-footer {
    padding: 7px 12px !important;
  }
  body.driver-active #devViewModal .modal-footer .btn {
    padding: 4px 14px !important;
    font-size: 12px !important;
  }

  /* ข้อ 3: หน้าต่างการให้สิทธิ์และบัญชีผู้ดูแลระบบ (#securityModal) — จัดปุ่ม 3 แท็บเป็นตาราง 3 ช่องเท่ากันในแถวเดียวสวยงาม */
  #securityModal #segSecRole {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 12px !important;
  }
  #securityModal #segSecRole button {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    border-radius: 9px !important;
    min-height: 48px !important;
    white-space: normal !important;
  }
  #securityModal #segSecRole button i {
    margin: 0 !important;
    font-size: 14px !important;
  }
  #securityModal #secBranchCountBadge {
    margin: 1px 0 0 !important;
    font-size: 9.5px !important;
    padding: 1px 6px !important;
  }
  #securityModal .cardx .btn-main,
  #securityModal .cardx .btn-soft,
  #securityModal .cardx .btn-brown {
    width: 100% !important;
    justify-content: center !important;
  }

  /* 5.2 ย่อแบนเนอร์หัวหน้าเว็บและซ่อนปุ่มซ้ำซ้อนบนมือถือ */
  .page-banner .banner-meta,
  .page-head .small.text-muted {
    display: none !important;
  }
  .page-banner {
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    border-radius: 13px !important;
  }
  .page-head {
    gap: 8px !important;
  }
  .page-head .ic {
    width: 32px !important;
    height: 32px !important;
    font-size: 15px !important;
    border-radius: 9px !important;
  }
  .page-head h4 {
    font-size: 14.8px !important;
    margin: 0 !important;
  }
  #page-dashboard .page-head > .d-flex > button:not(.btn-main) {
    display: none !important;
  }
  .dash-ctrl-bar {
    margin-top: 8px !important;
    padding-top: 8px !important;
    gap: 6px !important;
  }
  .dash-ctrl-bar .seg button {
    padding: 5px 6px !important;
    font-size: 11.2px !important;
    min-height: 30px !important;
  }
  .dash-export-grp {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
  }
  .dash-export-grp #dBy {
    grid-column: span 3 !important;
  }
  .dash-export-grp .btn {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }

  /* 5.3 พับเก็บกล่องตัวกรองข้อมูลอัตโนมัติในทุกหน้า */
  .mobile-filter-collapsed > .filterbar-head,
  .mobile-filter-collapsed > .filterbar {
    display: none !important;
  }
  .mobile-filter-collapsed > .row > [class*="col-"]:not(.mobile-keep-visible) {
    display: none !important;
  }
  .filterbar-wrap {
    padding: 8px 10px !important;
    border-radius: 13px !important;
    margin-bottom: 10px !important;
  }
  .mobile-filter-toggle-btn {
    margin-bottom: 0 !important;
    padding: 7px 11px !important;
    font-size: 12px !important;
  }
  .filterbar-wrap:not(.mobile-filter-collapsed) .mobile-filter-toggle-btn,
  .cardx:not(.mobile-filter-collapsed) .mobile-filter-toggle-btn {
    margin-bottom: 8px !important;
  }

  /* 5.4 ข้อ 1: ตารางรายชื่อนักศึกษา (#dListCard และ #listTableCard) แสดง 3 คอลัมน์เต็มจอมือถือ 100% ไม่บีบตัวหนังสือ */
  #dListCard .table-responsive::before,
  #listTableCard .table-responsive::before {
    display: none !important;
  }
  #listTableCard,
  #dListCard {
    padding: 10px 8px !important;
  }
  #listTableCard > .d-flex.border-bottom,
  #dListCard #dQuickMajor,
  #dListCard #dQuickProg,
  #dListCard #dQuickStatus,
  #dListCard #dashVisWrap,
  #dListCard #dashVisBadges {
    display: none !important;
  }
  #dListCard .table-toolbar {
    flex-direction: row !important;
    align-items: center !important;
    padding: 4px 0 8px !important;
    margin-bottom: 6px !important;
    gap: 6px !important;
  }
  #dListCard .table-toolbar > div:first-child {
    width: auto !important;
    flex-wrap: nowrap !important;
  }
  #dListCard .table-toolbar > div:last-child {
    flex: 1 1 auto !important;
    width: auto !important;
  }
  #dListCard .table-toolbar > div:last-child span {
    display: none !important;
  }
  #dListCard table.tablex colgroup,
  #listTableCard table.tablex colgroup {
    display: none !important;
  }
  #dListCard table.tablex,
  #listTableCard table.tablex {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
  }
  #dListCard table.tablex thead th,
  #listTableCard table.tablex thead th {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    background: var(--mint-soft, #E3F6F1) !important;
    color: var(--ink, #0F2922) !important;
    border-bottom: 1.5px solid rgba(14, 138, 114, 0.2) !important;
  }
  #dListCard table.tablex thead th:first-child,
  #listTableCard table.tablex thead th:first-child {
    width: 30px !important;
  }
  #dListCard table.tablex thead th:last-child,
  #listTableCard table.tablex thead th:last-child {
    width: 116px !important;
  }
  #dListCard table.tablex tbody td,
  #listTableCard table.tablex tbody td {
    padding: 9px 6px !important;
    font-size: 12.5px !important;
    vertical-align: top !important;
    white-space: normal !important;
    word-break: break-word !important;
    border-bottom: 1px solid var(--line, #E2E8F0) !important;
  }
  #dListCard table.tablex tbody td:first-child,
  #listTableCard table.tablex tbody td:first-child {
    width: 30px !important;
    font-size: 11px !important;
    color: var(--muted, #64748B) !important;
    padding-top: 10px !important;
  }
  #dListCard table.tablex tbody td.mob-status-cell,
  #listTableCard table.tablex tbody td.mob-status-cell {
    width: 116px !important;
  }
  #dListCard table.tablex .badge-st,
  #dListCard table.tablex .badge-pg,
  #listTableCard table.tablex .badge-st,
  #listTableCard table.tablex .badge-pg {
    font-size: 10px !important;
    padding: 3px 6px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    text-align: left !important;
  }

  /* 5.5 หน้าสถานที่ฝึกตามจังหวัด / อำเภอ / ตำบล (#page-provinces) */
  #pvGrid > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  #pvGrid .prov-card {
    padding: 10px 14px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px 10px !important;
  }
  #pvGrid .prov-card > div:first-child {
    flex: 1 1 55% !important;
    margin-bottom: 0 !important;
  }
  #pvGrid .prov-card > div:nth-child(2) {
    margin-top: 0 !important;
    gap: 12px !important;
  }
  #pvGrid .prov-card .big {
    font-size: 1.15rem !important;
    line-height: 1.1 !important;
  }
  #pvGrid .prov-card .bar {
    width: 100% !important;
    margin-top: 2px !important;
  }
  #segPvLevel {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
  #segPvLevel button {
    font-size: 11.2px !important;
    padding: 6px 4px !important;
    white-space: nowrap !important;
  }

  /* 5.6 หน้าเปรียบเทียบข้อมูล (#page-compare) และตารางสรุปยอด (#dPivot, #cmpTable, #incTable) */
  #dPivot,
  #cmpTable,
  #incTable {
    width: max-content !important;
    min-width: 100% !important;
    table-layout: auto !important;
  }
  #dPivot th, #dPivot td,
  #cmpTable th, #cmpTable td {
    padding: 6px 8px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
  #dPivot th:first-child,
  #dPivot td:first-child,
  #cmpTable th:first-child,
  #cmpTable td:first-child {
    max-width: 130px !important;
    white-space: normal !important;
    font-size: 11.2px !important;
  }
  .bento .card-t button[onclick*="savePng"],
  .bento .card-t button[onclick*="toggleDashCard"],
  #page-compare .card-t button[onclick*="savePng"],
  #page-compare .card-t button[onclick*="toggleCmpCard"] {
    display: none !important;
  }
  #cMajorWrap {
    height: 250px !important;
  }
  #cMonthWrap {
    min-height: 240px !important;
  }
  #cDaysWrap,
  #cAreaWrap {
    min-height: 220px !important;
  }

  /* 5.7 การ์ด KPI 2x2 ทุกหมวดหมู่ */
  #dKpi > [class*="col-"],
  #cmpKpi > [class*="col-"],
  #pvKpi > [class*="col-"],
  #incKpi > [class*="col-"],
  #calSmartCheckGrid > [class*="col-"] {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
  .kpi,
  #incKpi .kpi {
    padding: 10px 11px !important;
    border-radius: 12px !important;
  }
  .kpi .num,
  #incKpi .kpi .num {
    font-size: 1.28rem !important;
    line-height: 1.15 !important;
  }
  .kpi .lbl,
  #incKpi .kpi .lbl {
    font-size: 10.8px !important;
    line-height: 1.25 !important;
  }
  .kpi-foot,
  #incKpi .kpi-foot {
    font-size: 9.8px !important;
    margin-top: 3px !important;
  }

  /* 5.8 การ์ดตรวจสอบสถานะนักศึกษา (.st-card), ปฏิทิน และออกหนังสือราชการ */
  .st-card {
    border-radius: 14px !important;
    margin-bottom: 10px !important;
  }
  .st-card .head {
    padding: 10px 12px !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }
  .st-card > .p-3,
  .st-card > .p-md-4 {
    padding: 12px 13px !important;
  }
  .chip {
    white-space: normal !important;
    line-height: 1.35 !important;
    text-align: left !important;
    font-size: 11.2px !important;
    padding: 4px 9px !important;
    border-radius: 8px !important;
    margin: 2px 3px 2px 0 !important;
    max-width: 100% !important;
    word-break: break-word !important;
  }
  .cal-min-toolbar > .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .cal-min-toolbar > .d-flex > .d-flex:first-child {
    justify-content: space-between !important;
    width: 100% !important;
  }
  .cal-min-toolbar > .d-flex > .ms-auto {
    margin-left: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .cal-min-toolbar .cal-min-filter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .cal-min-toolbar #calEventType {
    grid-column: span 2 !important;
  }
  #page-letters #gList {
    max-height: 220px !important;
  }
}



/* ==========================================================================
   RMU INTERACTIVE THAILAND 77-PROVINCE MAP + CLEAN GLIDING BARS + STATUS PILL BAR
   (คุมธีมสีเขียวมรกต RMU AGT 100% ทั้งโหมดสว่างและโหมดมืด)
   ========================================================================== */
.rmu-thmap-box {
  position: relative;
  height: 100%;
  min-height: 440px;
  background: linear-gradient(180deg, #F6FBF9 0%, #EEF7F4 100%);
  border: 1px solid var(--line, #D7EAE4);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
body.dark-mode .rmu-thmap-box {
  background: linear-gradient(180deg, rgba(16, 36, 30, 0.9) 0%, rgba(11, 25, 21, 0.95) 100%);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-thmap-ctrls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rmu-thmap-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line, #D5E8E2);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink, #0F2922);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 107, 83, 0.08);
  transition: all 0.15s ease;
}
.rmu-thmap-btn:hover {
  background: var(--turquoise, #0E8A72);
  color: #ffffff;
  border-color: var(--turquoise, #0E8A72);
}
body.dark-mode .rmu-thmap-btn {
  background: rgba(16, 36, 30, 0.92);
  color: #E6F5F0;
  border-color: rgba(45, 212, 191, 0.28);
}
.rmu-thmap-svg-wrap {
  flex: 1 1 auto;
  width: 100%;
  height: 415px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  cursor: grab;
  user-select: none;
}
.rmu-thmap-svg-wrap:active {
  cursor: grabbing;
}
.rmu-thmap-svg-wrap svg {
  width: 100%;
  height: 100%;
  max-height: 405px;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}
.rmu-thmap-prov {
  stroke: #ffffff;
  stroke-width: 0.75;
  cursor: pointer;
  transition: fill 0.22s ease, opacity 0.2s ease, stroke-width 0.16s ease, filter 0.18s ease;
}
body.dark-mode .rmu-thmap-prov {
  stroke: #10241E;
}
.rmu-thmap-prov:hover {
  opacity: 0.88;
  stroke: #0B6B53;
  stroke-width: 1.5;
  filter: brightness(1.06);
}
.rmu-thmap-prov.is-selected {
  stroke: #F59E0B !important;
  stroke-width: 2.2 !important;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.45));
}
.rmu-thmap-tip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 7;
  background: rgba(15, 41, 34, 0.92);
  color: #ffffff;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 11.8px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  max-width: calc(100% - 60px);
}
.rmu-thmap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 11px;
  color: var(--muted, #5A7A70);
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line, #D7EAE4);
}
body.dark-mode .rmu-thmap-legend {
  background: rgba(11, 25, 21, 0.72);
  color: #94B8AC;
  border-top-color: rgba(45, 212, 191, 0.18);
}
.rmu-thmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rmu-thmap-legend i {
  width: 12px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(15, 41, 34, 0.12);
}

/* Right-hand Clean Map Summary & Smooth-Gliding Horizontal Pill Bars */
.rmu-map-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.rmu-map-kpi {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--line, #E2EFEA);
  border-radius: 13px;
  padding: 10px 12px;
}
.rmu-map-kpi .v {
  font-family: 'Prompt', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink, #0F2922);
  line-height: 1.15;
}
.rmu-map-kpi .l {
  font-size: 11.2px;
  color: var(--muted, #64748B);
  margin-top: 2px;
}
.rmu-glide-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rmu-glide-row {
  display: grid;
  grid-template-columns: minmax(115px, 1.15fr) 1fr 44px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.rmu-glide-row:hover {
  background: var(--mint-soft, #E3F6F1);
}
.rmu-glide-lbl {
  font-size: 12.6px;
  font-weight: 500;
  color: var(--ink, #0F2922);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmu-glide-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: var(--mint-soft, #E6F4EF);
  overflow: hidden;
}
body.dark-mode .rmu-glide-track {
  background: rgba(255, 255, 255, 0.08);
}
.rmu-glide-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0E8A72 0%, #34D399 100%);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width;
}
.rmu-glide-val {
  text-align: right;
  font-family: 'Prompt', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #0F2922);
}

/* ===== Clean Student Status Progress Pill Bar Card (RMU Emerald Theme) ===== */
.rmu-status-pill-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--line, #D7EAE4);
  border-radius: 16px;
  padding: 15px 20px;
  box-shadow: 0 3px 14px rgba(11, 107, 83, 0.04);
}
.rmu-status-pill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.rmu-status-pill-title {
  font-family: 'Prompt', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink, #0F2922);
}
.rmu-status-pill-title .em {
  color: var(--turquoise, #0E8A72);
  font-weight: 700;
}
.rmu-status-pill-pct {
  font-family: 'Prompt', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--turquoise, #0E8A72);
  letter-spacing: -0.01em;
}
.rmu-status-pill-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: var(--mint-soft, #E6F4EF);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 11px;
}
body.dark-mode .rmu-status-pill-track {
  background: rgba(255, 255, 255, 0.08);
}
.rmu-status-pill-seg {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width;
  min-width: 0;
}
.rmu-status-pill-seg.has-val {
  min-width: 10px;
}
.rmu-status-pill-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 12.2px;
  color: var(--muted, #527369);
}
.rmu-status-pill-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.14s ease;
}
.rmu-status-pill-leg-item:hover {
  color: var(--ink, #0F2922);
}
.rmu-status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.rmu-status-pill-leg-item b {
  font-weight: 700;
}

/* Compact version inside individual student card */
.rmu-stu-mini-status {
  background: rgba(14, 138, 114, 0.035);
  border: 1px solid var(--line, #D7EAE4);
  border-radius: 13px;
  padding: 10px 13px;
  margin: 10px 0 8px;
}
.rmu-stu-mini-status .rmu-status-pill-head {
  margin-bottom: 7px;
}
.rmu-stu-mini-status .rmu-status-pill-title {
  font-size: 12.5px;
}
.rmu-stu-mini-status .rmu-status-pill-pct {
  font-size: 13px;
}
.rmu-stu-mini-status .rmu-status-pill-track {
  height: 9px;
  margin-bottom: 8px;
}
.rmu-stu-mini-status .rmu-status-pill-legend {
  gap: 4px 12px;
  font-size: 11px;
}

@media (max-width: 767.98px) {
  .rmu-thmap-box {
    min-height: 340px;
  }
  .rmu-thmap-svg-wrap {
    height: 315px;
  }
  .rmu-map-kpis {
    gap: 6px;
  }
  .rmu-map-kpi {
    padding: 8px 9px;
  }
  .rmu-map-kpi .v {
    font-size: 1.1rem;
  }
  .rmu-glide-row {
    grid-template-columns: minmax(98px, 1.1fr) 1fr 36px;
    gap: 7px;
  }
  .rmu-glide-lbl {
    font-size: 11.8px;
  }
  .rmu-status-pill-card {
    padding: 12px 14px;
  }
  .rmu-status-pill-title {
    font-size: 13px;
  }
  .rmu-status-pill-pct {
    font-size: 13.8px;
  }
  .rmu-status-pill-legend {
    gap: 6px 12px;
    font-size: 11.2px;
  }
}

/* ==========================================================================
   CLEAN REFERENCE-INSPIRED FRAMES, PREVIEW MODAL & SHARE UI (RMU EMERALD THEME)
   ========================================================================== */
#pvMapSection {
  border: 1px solid #E2EFEA !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 14px rgba(11, 107, 83, 0.04) !important;
  background: #FFFFFF;
}
body.dark-mode #pvMapSection {
  background: var(--card, #11221D);
  border-color: rgba(45, 212, 191, 0.2) !important;
}
.rmu-thmap-box {
  background: #F6FBF9 !important;
  border: 1px solid #E2EFEA !important;
  border-radius: 14px !important;
}
.rmu-map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 4px 6px;
}
.rmu-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.rmu-map-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #E3F6F1;
  color: #0B6B53;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
body.dark-mode .rmu-map-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
}
.rmu-map-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink, #0F2922);
  margin: 0;
  line-height: 1.3;
}
.rmu-map-sub {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 12px;
}
.rmu-map-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.rmu-map-kpi {
  background: #FFFFFF;
  border: 1px solid #E2EFEA;
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.rmu-map-kpi:hover {
  border-color: #34D399;
  box-shadow: 0 3px 10px rgba(14, 138, 114, 0.07);
}
body.dark-mode .rmu-map-kpi {
  background: rgba(15, 34, 28, 0.72);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-map-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink, #0F2922);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.rmu-map-kpi-lbl {
  font-size: 11.5px;
  color: #64748B;
  margin-top: 3px;
}
.rmu-glide-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: #0E8A72;
  margin-bottom: 10px;
}
.rmu-glide-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rmu-glide-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.15fr) minmax(90px, 1.35fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 12.8px;
}
.rmu-glide-name {
  color: var(--ink, #0F2922);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmu-glide-track {
  height: 9px;
  background: #E8F3EF;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
body.dark-mode .rmu-glide-track {
  background: rgba(255, 255, 255, 0.08);
}
.rmu-glide-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0E8A72 0%, #10B981 100%);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.rmu-glide-num {
  font-weight: 700;
  color: var(--ink, #0F2922);
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rmu-map-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #D5E8E2;
  background: #FFFFFF;
  color: #0F2922;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.rmu-map-more-btn:hover {
  background: #E3F6F1;
  border-color: #0E8A72;
  color: #0B6B53;
}
body.dark-mode .rmu-map-more-btn {
  background: rgba(15, 34, 28, 0.8);
  border-color: rgba(45, 212, 191, 0.28);
  color: #E6F5F0;
}
.rmu-map-hint {
  margin-top: auto;
  padding-top: 12px;
  font-size: 11.5px;
  color: #64748B;
}

/* Clean Reference-style Status Pill Card (Dashboard & Student Card) */
.rmu-status-pill-card {
  background: #FFFFFF;
  border: 1px solid #E2EFEA;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(11, 107, 83, 0.04);
}
body.dark-mode .rmu-status-pill-card {
  background: var(--card, #11221D);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-stu-mini-status {
  background: #F8FCFA;
  border: 1px solid #E2EFEA;
  border-radius: 14px;
  padding: 13px 16px;
  margin: 8px 0 10px;
}
body.dark-mode .rmu-stu-mini-status {
  background: rgba(16, 36, 30, 0.65);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-status-pill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rmu-status-pill-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink, #0F2922);
}
.rmu-status-pill-title .em {
  color: #0E8A72;
  font-weight: 800;
}
.rmu-status-pill-pct {
  font-size: 15px;
  font-weight: 800;
  color: #0E8A72;
  font-variant-numeric: tabular-nums;
}
.rmu-status-pill-track {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 11px;
  background: #E9F3EF;
  border-radius: 999px;
  overflow: hidden;
  padding: 0;
}
body.dark-mode .rmu-status-pill-track {
  background: rgba(255, 255, 255, 0.08);
}
.rmu-status-pill-seg {
  height: 100%;
  border-radius: 999px;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}
.rmu-status-pill-seg.is-dot {
  min-width: 11px;
}
.rmu-status-pill-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #475569;
}
body.dark-mode .rmu-status-pill-legend {
  color: #CBD5E1;
}
.rmu-status-pill-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rmu-status-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.rmu-share-btn-clean {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid #D5E8E2;
  background: #FFFFFF;
  color: #0B6B53;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.rmu-share-btn-clean:hover {
  background: #E3F6F1;
  border-color: #0E8A72;
}
body.dark-mode .rmu-share-btn-clean {
  background: rgba(16, 36, 30, 0.85);
  border-color: rgba(45, 212, 191, 0.3);
  color: #6EE7B7;
}

/* Dashboard Summary Report Preview Modal */
.rmu-report-preview-sheet {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2EFEA;
  border-radius: 14px;
  padding: 24px 26px;
  max-height: 66vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(11, 107, 83, 0.06);
}
.rmu-report-preview-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.rmu-report-preview-sheet th {
  background: #0B6B53 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 7px 9px;
  border: 1px solid #0B6B53;
  text-align: left;
}
.rmu-report-preview-sheet td {
  padding: 6px 9px;
  border: 1px solid #D7EAE4;
  vertical-align: top;
}
.rmu-report-preview-sheet tbody tr:nth-child(even) td {
  background: #F6FBF9;
}
.rmu-report-preview-sheet tfoot td,
.rmu-report-preview-sheet tfoot th {
  background: #E3F6F1 !important;
  color: #0B6B53 !important;
  font-weight: 700;
}
.rmu-report-sec-h {
  font-size: 14px;
  font-weight: 700;
  color: #0B6B53;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #E3F6F1;
}
@media (max-width: 767.98px) {
  .rmu-map-kpi-grid { gap: 7px; }
  .rmu-map-kpi { padding: 9px 10px; }
  .rmu-map-kpi-val { font-size: 1.1rem; }
  .rmu-glide-row { grid-template-columns: minmax(90px, 1.1fr) minmax(70px, 1.2fr) auto; gap: 8px; font-size: 12px; }
  .rmu-status-pill-card { padding: 13px 14px; }
  .rmu-report-preview-sheet { padding: 14px; }
}

/* ==========================================================================
   V10: SOFT GRADIENT HEADERS, MINIMAL CLEAN UI, NO DASHED LETTERS,
        SOFT LAVENDER STEP 3, 5-DOT STATUS BAR & MULTI-PLATFORM SHARE
   ========================================================================== */

/* #9 Soft Emerald-Mint Gradient Page Headers (Dashboard & All Pages) */
.page-banner {
  background: linear-gradient(135deg, #F2FBF7 0%, #E4F6F0 52%, #F6FCFA 100%) !important;
  border: 1px solid #D9EDE6 !important;
  border-radius: 18px !important;
  padding: 18px 22px !important;
  box-shadow: 0 2px 12px rgba(11, 107, 83, 0.04) !important;
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0E8A72 0%, #34D399 55%, #A7F3D0 100%);
  opacity: 0.78;
}
body.dark-mode .page-banner {
  background: linear-gradient(135deg, rgba(16, 42, 35, 0.96) 0%, rgba(12, 32, 27, 0.98) 55%, rgba(18, 48, 39, 0.95) 100%) !important;
  border-color: rgba(45, 212, 191, 0.22) !important;
}

/* #10 Softer, lighter minimal icon badges & slimmer buttons */
.page-head .ic, .ic-badge {
  width: 44px !important;
  height: 44px !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, rgba(14, 138, 114, 0.14) 0%, rgba(16, 185, 129, 0.22) 100%) !important;
  color: #0B6B53 !important;
  border: 1px solid rgba(14, 138, 114, 0.22) !important;
  box-shadow: 0 2px 8px rgba(14, 138, 114, 0.08) !important;
  font-size: 1.2rem !important;
}
body.dark-mode .page-head .ic, body.dark-mode .ic-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(20, 184, 166, 0.14) 100%) !important;
  color: #6EE7B7 !important;
  border-color: rgba(110, 231, 183, 0.25) !important;
}
.btn-soft, .btn-outline-success, .btn-dl-xlsx, .btn-dl-pdf, .btn-dl-docx {
  border-width: 1px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}
.btn-main {
  border-width: 1px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(14, 138, 114, 0.16) !important;
}
.cardx {
  border: 1px solid #E4F0EC !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 8px rgba(11, 107, 83, 0.035) !important;
}
body.dark-mode .cardx {
  border-color: rgba(45, 212, 191, 0.18) !important;
}
.b-chip {
  font-weight: 500 !important;
  border: 1px solid rgba(14, 138, 114, 0.12);
}

/* #8 Official Letters: NO dashed borders + softer pastel lavender for Step 3 */
#page-letters .step-upload-box,
.step-upload-box,
#page-letters .dropzone,
.step-card .dropzone {
  border-style: solid !important;
  border-width: 1px !important;
  border-radius: 12px !important;
}
.step-card.s1 .step-upload-box {
  background: #F4FBF8 !important;
  border-color: #CBE8DD !important;
}
.step-card.s2 .step-upload-box {
  background: #F4FAFF !important;
  border-color: #C7E6FA !important;
}
.step-card.s3 {
  border-color: #E3E0F5 !important;
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.52) 0%, var(--card-bg, #ffffff) 100%) !important;
}
.step-card.s3 .hd {
  color: #6E65A8 !important;
}
.step-card.s3 .hd .n {
  background: #847BBF !important;
}
.step-card.s3 .step-upload-box {
  background: #F7F6FC !important;
  border-color: #DFDCF2 !important;
}
.step-card.s3 .form-control:focus,
.step-card.s3 .form-select:focus {
  border-color: #8E85C7 !important;
  box-shadow: 0 0 0 0.18rem rgba(132, 123, 191, 0.16) !important;
}
.btn-step3-solid {
  background: #847BBF !important;
  border-color: #847BBF !important;
  color: #ffffff !important;
}
.btn-step3-solid:hover {
  background: #7168AD !important;
  border-color: #7168AD !important;
}
.btn-step3-soft {
  background: #F4F3FA !important;
  border: 1px solid #DDD9F2 !important;
  color: #635B99 !important;
}
.btn-step3-soft:hover {
  background: #EAE7F7 !important;
  border-color: #B9B2E0 !important;
  color: #4F4882 !important;
}
body.dark-mode .step-card.s3 {
  border-color: rgba(167, 159, 224, 0.28) !important;
  background: linear-gradient(180deg, rgba(132, 123, 191, 0.12) 0%, var(--card-bg, #11221D) 100%) !important;
}
body.dark-mode .step-card.s3 .hd { color: #C2BCEB !important; }
body.dark-mode .step-card.s3 .step-upload-box {
  background: rgba(132, 123, 191, 0.08) !important;
  border-color: rgba(167, 159, 224, 0.24) !important;
}

/* #3 Map Top Filter Bar (kruphuchuay clean layout in emerald theme) */
.rmu-map-topbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EAF3EF;
}
.rmu-map-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rmu-map-filter-item label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
  margin: 0;
}
.rmu-map-filter-item .form-select {
  border-radius: 10px;
  border-color: #D9EBE5;
  font-size: 13px;
}
body.dark-mode .rmu-map-topbar {
  border-bottom-color: rgba(45, 212, 191, 0.16);
}
@media (max-width: 767.98px) {
  .rmu-map-topbar { grid-template-columns: 1fr; gap: 8px; }
}

/* #6 Smooth slower gliding bars matching reference pace */
.rmu-glide-fill {
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.rmu-status-pill-seg {
  transition: width 1.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* #4 Student 5-Milestone Segmented Pill Bar with Clear Separator Dots */
.rmu-stu-milestones {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  position: relative;
}
.rmu-ms-step {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rmu-ms-bar-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rmu-ms-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #DCEAE4;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #CBE0D8;
  transition: all 0.25s ease;
}
.rmu-ms-seg {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #E8F2EE;
  overflow: hidden;
}
.rmu-ms-seg-in {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
.rmu-ms-step.is-done .rmu-ms-dot {
  background: #0E8A72;
  box-shadow: 0 0 0 2px rgba(14, 138, 114, 0.2);
}
.rmu-ms-step.is-done .rmu-ms-seg-in {
  width: 100%;
  background: linear-gradient(90deg, #0B6B53 0%, #10B981 100%);
}
.rmu-ms-step.is-cur .rmu-ms-dot {
  background: #10B981;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.28);
  transform: scale(1.15);
}
.rmu-ms-step.is-cur .rmu-ms-seg-in {
  width: 100%;
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
}
.rmu-ms-step.is-alert .rmu-ms-dot {
  background: #E11D48;
  box-shadow: 0 0 0 3.5px rgba(225, 29, 72, 0.22);
}
.rmu-ms-step.is-alert .rmu-ms-seg-in {
  width: 100%;
  background: #E11D48;
}
.rmu-ms-lbl {
  font-size: 10.5px;
  line-height: 1.25;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmu-ms-step.is-done .rmu-ms-lbl {
  color: #0B6B53;
  font-weight: 600;
}
.rmu-ms-step.is-cur .rmu-ms-lbl {
  color: #065F46;
  font-weight: 700;
}
.rmu-ms-step.is-alert .rmu-ms-lbl {
  color: #E11D48;
  font-weight: 700;
}
body.dark-mode .rmu-ms-seg { background: rgba(255,255,255,0.08); }
body.dark-mode .rmu-ms-dot { background: #264239; border-color: #10241E; box-shadow: 0 0 0 1px rgba(45,212,191,0.22); }
body.dark-mode .rmu-ms-step.is-done .rmu-ms-lbl,
body.dark-mode .rmu-ms-step.is-cur .rmu-ms-lbl { color: #6EE7B7; }

/* #2 Multi-platform Share Modal Grid */
.rmu-share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.rmu-share-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid #E2EFEA;
  background: #FFFFFF;
  color: #0F2922;
  font-size: 12.8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}
.rmu-share-app-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 107, 83, 0.08);
}
.rmu-share-app-btn.line { background: #F0FDF4; border-color: #BBF7D0; color: #059669; }
.rmu-share-app-btn.ig { background: #FDF2F8; border-color: #FBCFE8; color: #BE185D; }
.rmu-share-app-btn.imsg { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.rmu-share-app-btn.email { background: #F0FDFA; border-color: #99F6E4; color: #0F766E; }
.rmu-share-app-btn.tiktok { background: #F8FAFC; border-color: #CBD5E1; color: #0F172A; }
.rmu-share-app-btn.native { background: #E3F6F1; border-color: #A7F3D0; color: #0B6B53; }

/* ==========================================================================
   V11: CLEAN ADMIN GUIDE, MINIMAL STATUS PILLS, CENTERED STEP 8 MODAL,
        AND ANIMATED LINE + MILESTONE DOTS STATUS BAR
   ========================================================================== */

/* #1 Admin Guide (#page-guide): Clean, calm emerald monochrome (no rainbow clutter) */
#page-guide #guideRoadmap .cardx,
#page-guide #guideRoadmap .g-flow-node,
#page-guide #guideRoadmap .g-card,
#page-guide #guideRoadmap .guide-card,
#page-guide #guideRoadmap .road-card {
  background: #FFFFFF !important;
  border: 1px solid #E4EFEA !important;
  border-radius: 15px !important;
  box-shadow: 0 1px 6px rgba(11, 107, 83, 0.03) !important;
}
#page-guide #guideRoadmap [style*="background:"] {
  background: #F4FAF7 !important;
  color: #0B6B53 !important;
  border-color: #DCECE6 !important;
}
#page-guide #guideRoadmap .badge,
#page-guide #guideRoadmap .chip {
  background: #EDF8F4 !important;
  color: #0B6B53 !important;
  border: 1px solid #D4EAE2 !important;
  font-weight: 600 !important;
}
#page-guide #guideRoadmap .btn-soft,
#page-guide #guideRoadmap .btn-sm {
  border-radius: 999px !important;
  border: 1px solid #D4EAE2 !important;
  background: #FFFFFF !important;
  color: #0B6B53 !important;
}
#page-guide #guideRoadmap .btn-soft:hover,
#page-guide #guideRoadmap .btn-sm:hover {
  background: #E8F6F1 !important;
}
body.dark-mode #page-guide #guideRoadmap .cardx,
body.dark-mode #page-guide #guideRoadmap [style*="background:"] {
  background: rgba(16, 36, 30, 0.85) !important;
  color: #E2F4EE !important;
  border-color: rgba(45, 212, 191, 0.2) !important;
}

/* #4 Minimal, calm table status pills (matching kruphuchuay clean aesthetic) */
.st-pill, .pg-pill, .st-badge, .status-pill {
  background: #F6FBF9 !important;
  border: 1px solid #DCECE6 !important;
  color: #0F3B2E !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  padding: 5px 10px !important;
  line-height: 1.35 !important;
}
body.dark-mode .st-pill, body.dark-mode .pg-pill, body.dark-mode .st-badge {
  background: rgba(16, 40, 33, 0.85) !important;
  border-color: rgba(45, 212, 191, 0.24) !important;
  color: #D1FAE5 !important;
}
.kpi {
  background: #FFFFFF !important;
  border: 1px solid #E5F0EC !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 6px rgba(11, 107, 83, 0.03) !important;
}
body.dark-mode .kpi {
  background: var(--card-bg, #11221D) !important;
  border-color: rgba(45, 212, 191, 0.18) !important;
}

/* #9 Center Step 8 Dev Profile Modal cleanly */
#devProfileModal .modal-dialog {
  margin: 1rem auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100% - 2rem);
}
#devProfileModal .modal-content {
  width: 100%;
  max-width: 440px;
  margin: 0 auto !important;
}

/* #10 Animated Continuous Line + 5 Milestone Dots Status Bar */
@keyframes rmuLineShoot {
  from { width: 0%; }
  to { width: var(--rmu-prog, 100%); }
}
@keyframes rmuDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1); }
}
.rmu-progline-wrap {
  position: relative;
  padding-top: 6px;
  margin-top: 4px;
}
.rmu-progline-rail {
  position: relative;
  height: 4px;
  background: #E5F0EC;
  border-radius: 999px;
  margin: 10px 8% 0;
  overflow: visible;
}
body.dark-mode .rmu-progline-rail {
  background: rgba(255, 255, 255, 0.1);
}
.rmu-progline-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 55%, #10B981 100%);
  width: var(--rmu-prog, 0%);
  animation: rmuLineShoot 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.rmu-progline-fill.is-alert {
  background: linear-gradient(90deg, #0E8A72 0%, #E11D48 100%);
}
.rmu-progline-nodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: relative;
  margin-top: -10px;
}
.rmu-pl-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.rmu-pl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #CBDCD6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  transition: all 0.25s ease;
  z-index: 2;
}
.rmu-pl-node.is-done .rmu-pl-dot {
  background: #0E8A72;
  border-color: #0E8A72;
  color: #FFFFFF;
}
.rmu-pl-node.is-cur .rmu-pl-dot {
  background: #10B981;
  border-color: #FFFFFF;
  color: #FFFFFF;
  transform: scale(1.16);
  animation: rmuDotPulse 2s ease-in-out infinite;
}
.rmu-pl-node.is-alert .rmu-pl-dot {
  background: #E11D48;
  border-color: #FFFFFF;
  color: #FFFFFF;
  box-shadow: 0 0 0 3.5px rgba(225, 29, 72, 0.22);
}
.rmu-pl-lbl {
  font-size: 11px;
  line-height: 1.25;
  color: #64748B;
  font-weight: 500;
}
.rmu-pl-node.is-done .rmu-pl-lbl {
  color: #0B6B53;
  font-weight: 600;
}
.rmu-pl-node.is-cur .rmu-pl-lbl {
  color: #065F46;
  font-weight: 700;
}
.rmu-pl-node.is-alert .rmu-pl-lbl {
  color: #E11D48;
  font-weight: 700;
}
body.dark-mode .rmu-pl-dot {
  background: #10241E;
  border-color: rgba(45, 212, 191, 0.3);
}
body.dark-mode .rmu-pl-node.is-done .rmu-pl-lbl,
body.dark-mode .rmu-pl-node.is-cur .rmu-pl-lbl {
  color: #6EE7B7;
}
@media (max-width: 575.98px) {
  .rmu-pl-lbl { font-size: 9.8px; }
  .rmu-pl-dot { width: 14px; height: 14px; font-size: 8px; }
}

/* ==========================================================================
   V12: ULTRA-MINIMAL STATUS BAR, LARGE CRISP THAILAND MAP, MODERN CAPSULE
        BADGES, SILKY SLOW GLIDING BARS & CLEAN ADMIN GUIDE
   ========================================================================== */

/* #2 Large, crisp Thailand map matching kruphuchuay prominence */
.rmu-thmap-box {
  min-height: 550px !important;
  background: #F9FCFB !important;
  border: 1px solid #E3EFEA !important;
  border-radius: 16px !important;
}
.rmu-thmap-svg-wrap {
  height: 500px !important;
  padding: 6px 4px !important;
}
.rmu-thmap-svg-wrap svg {
  max-height: 492px !important;
}
.rmu-thmap-group {
  filter: drop-shadow(0 3px 10px rgba(11, 107, 83, 0.14));
}
.rmu-thmap-prov {
  stroke: #FFFFFF;
  stroke-width: 0.95;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.rmu-thmap-prov.is-empty {
  stroke: #B2CBC1;
  stroke-width: 0.85;
}
.rmu-thmap-prov:hover {
  stroke: #065F46 !important;
  stroke-width: 1.65 !important;
  opacity: 0.94;
}
.rmu-thmap-prov.is-selected {
  stroke: #0B6B53 !important;
  stroke-width: 2.3 !important;
  filter: drop-shadow(0 0 6px rgba(11, 107, 83, 0.45));
}
.rmu-thmap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 9px 14px;
  border-top: 1px solid #EAF3EF;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11.5px;
  color: #475569;
}
.rmu-thmap-scale {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: #0F2922;
}
.rmu-thmap-gradbar {
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #A7F3D0 0%, #34D399 35%, #0E8A72 70%, #065F46 100%);
}
.rmu-thmap-zero {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #64748B;
}
.rmu-thmap-zero i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
body.dark-mode .rmu-thmap-box {
  background: rgba(13, 30, 25, 0.94) !important;
}
body.dark-mode .rmu-thmap-legend {
  background: rgba(15, 34, 28, 0.92);
  border-top-color: rgba(45, 212, 191, 0.16);
  color: #CBD5E1;
}
body.dark-mode .rmu-thmap-scale { color: #E2F4EE; }
body.dark-mode .rmu-thmap-prov.is-empty { stroke: rgba(148, 197, 180, 0.35); }

@media (max-width: 991.98px) {
  .rmu-thmap-box { min-height: 430px !important; }
  .rmu-thmap-svg-wrap { height: 390px !important; }
  .rmu-thmap-svg-wrap svg { max-height: 382px !important; }
}

/* #3 Modern, airy capsule status pills (.badge-st, .badge-pg) — replacing boxy rectangles */
.badge-st, .badge-pg {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 999px !important;
  padding: 4px 11px !important;
  font-size: 11.8px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  border-width: 1px !important;
  box-shadow: 0 1px 2px rgba(15, 41, 34, 0.03) !important;
  white-space: normal !important;
  max-width: 100%;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.badge-st .badge-dot, .badge-pg .badge-dot {
  width: 6.5px !important;
  height: 6.5px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}
.badge-st .st-k, .badge-pg .st-k {
  font-size: 10.8px;
  opacity: 0.68;
  font-weight: 500;
}

/* #3 Silky slower gliding horizontal bars */
.rmu-glide-track {
  height: 8px !important;
  background: #EAF4F0 !important;
  border-radius: 999px !important;
}
.rmu-glide-fill {
  background: linear-gradient(90deg, #0E8A72 0%, #10B981 100%) !important;
  transition: width 1.75s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.rmu-status-pill-seg {
  transition: width 1.75s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* #1 Ultra-minimal Student Status Progress Tracker (Apple/Linear style in RMU emerald) */
.rmu-stu-mini-status {
  background: #FFFFFF !important;
  border: 1px solid #E6F1ED !important;
  border-radius: 14px !important;
  padding: 14px 16px 12px !important;
  margin: 10px 0 12px !important;
  box-shadow: 0 1px 4px rgba(11, 107, 83, 0.025) !important;
}
body.dark-mode .rmu-stu-mini-status {
  background: rgba(15, 34, 28, 0.72) !important;
  border-color: rgba(45, 212, 191, 0.2) !important;
}
.rmu-stu-st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rmu-stu-st-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFFAF6;
  color: #0B6B53;
  border: 1px solid #D5ECE3;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.8px;
  font-weight: 600;
}
.rmu-stu-st-pill.is-alert {
  background: #FFF1F2;
  color: #BE123C;
  border-color: #FECDD3;
}
.rmu-stu-st-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}
.rmu-stu-st-pill.is-alert .dot { background: #E11D48; }
body.dark-mode .rmu-stu-st-pill {
  background: rgba(16, 185, 129, 0.16);
  color: #6EE7B7;
  border-color: rgba(110, 231, 183, 0.25);
}
.rmu-stu-st-meta {
  font-size: 12px;
  font-weight: 700;
  color: #0E8A72;
  font-variant-numeric: tabular-nums;
}
.rmu-progline-wrap {
  position: relative;
  padding: 2px 0 0 !important;
  margin: 0 !important;
}
.rmu-progline-rail {
  position: relative;
  height: 5px !important;
  background: #EAF3EF !important;
  border-radius: 999px !important;
  margin: 7px 9% 0 !important;
}
.rmu-progline-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 52%, #10B981 100%) !important;
  animation: rmuLineShoot 1.75s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.rmu-progline-nodes {
  margin-top: -10.5px !important;
}
.rmu-pl-dot {
  width: 14px !important;
  height: 14px !important;
  border: 2px solid #D4E4DE !important;
  background: #FFFFFF !important;
  font-size: 8.5px !important;
}
.rmu-pl-node.is-done .rmu-pl-dot {
  width: 13px !important;
  height: 13px !important;
  background: #0E8A72 !important;
  border-color: #0E8A72 !important;
}
.rmu-pl-node.is-cur .rmu-pl-dot {
  width: 16px !important;
  height: 16px !important;
  background: #10B981 !important;
  border: 3px solid #FFFFFF !important;
  box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.32) !important;
}
.rmu-pl-lbl {
  font-size: 10.8px !important;
  margin-top: 2px;
}

/* #5 Admin Guide (#page-guide): True calm minimal design */
#page-guide .guide-flow-grid,
#page-guide .guide-cats,
#page-guide #guideRoadmap {
  --g-accent: #0E8A72;
}
#page-guide #guideRoadmap * {
  box-shadow: none !important;
}
#page-guide #guideRoadmap .cardx,
#page-guide #guideRoadmap .g-flow-item,
#page-guide #guideRoadmap .guide-step-card,
#page-guide #guideRoadmap .guide-sec-card {
  background: #FFFFFF !important;
  border: 1px solid #E6F0EC !important;
  border-radius: 16px !important;
  transition: border-color 0.16s ease !important;
}
#page-guide #guideRoadmap .cardx:hover {
  border-color: #B7DDD0 !important;
}
#page-guide #guideRoadmap .guide-cat-btn,
#page-guide #guideRoadmap .nav-link,
#page-guide #guideRoadmap button.chip {
  background: #FFFFFF !important;
  color: #334155 !important;
  border: 1px solid #E2EEE9 !important;
  border-radius: 999px !important;
  font-weight: 500 !important;
}
#page-guide #guideRoadmap .guide-cat-btn.active,
#page-guide #guideRoadmap .guide-cat-btn.on,
#page-guide #guideRoadmap button.chip.on {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
  border-color: #0E8A72 !important;
}
#page-guide #guideRoadmap .bi {
  color: #0E8A72 !important;
}
#page-guide #guideRoadmap .guide-cat-btn.active .bi,
#page-guide #guideRoadmap .guide-cat-btn.on .bi,
#page-guide #guideRoadmap .btn-main .bi {
  color: #FFFFFF !important;
}
body.dark-mode #page-guide #guideRoadmap .cardx {
  background: var(--card-bg, #11221D) !important;
  border-color: rgba(45, 212, 191, 0.18) !important;
}

/* ==========================================================================
   V13: KRUPHUCHUAY-STYLE EMERALD STATUS PILL + DOT, NON-OVERLAPPING STEP 2,
        AND DEAD-CENTER STEP 8 (#devViewModal)
   ========================================================================== */

/* #1 Student status bar matching image_9777f6.png in RMU emerald theme */
.rmu-stu-pill-card {
  background: #FFFFFF;
  border: 1px solid #E5F0EC;
  border-radius: 16px;
  padding: 15px 18px;
  margin: 10px 0 12px;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.035);
}
body.dark-mode .rmu-stu-pill-card {
  background: rgba(15, 34, 28, 0.78);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-stu-pill-track {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  height: 11px;
  background: #EAF4F0;
  border-radius: 999px;
  overflow: hidden;
}
body.dark-mode .rmu-stu-pill-track {
  background: rgba(255, 255, 255, 0.09);
}
.rmu-stu-pill-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 55%, #10B981 100%);
  width: var(--rmu-prog, 0%);
  animation: rmuLineShoot 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.rmu-stu-pill-tipdot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}
.rmu-stu-pill-tipdot.is-alert {
  background: #E11D48;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.22);
}

/* #3 Keep Tour Step 2 mock card sleek & compact on desktop so popover sits cleanly outside */
@media (min-width: 992px) {
  #sampleDemoCardWrap .sample-card-outer {
    max-width: 920px;
    margin: 0 auto;
  }
  #sampleDemoCardWrap .st-card .p-3.p-md-4 {
    padding: 14px 18px !important;
  }
  #sampleDemoCardWrap .rmu-stu-pill-card {
    padding: 11px 14px;
    margin: 6px 0 8px;
  }
}

/* #4 Dead-center Step 8 Developer Profile Modal (#devViewModal) on Desktop */
#devViewModal {
  padding-right: 0 !important;
}
#devViewModal .modal-dialog {
  margin: 0 auto !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-width: 460px !important;
  width: calc(100% - 2rem) !important;
}
#devViewModal .modal-content {
  width: 100% !important;
  margin: 0 auto !important;
}

/* ==========================================================================
   V14: VIVID STAGE DOTS ON STATUS BAR, ZERO-OVERLAP STEP 2 TOUR,
        AND MODERN APP-ICON DOCK SHARE MODAL
   ========================================================================== */

/* #1 Clear semantic colored milestone dots on sleek green progress bar */
.rmu-stu-pill-track-wrap {
  position: relative;
  padding: 6px 0 4px;
}
.rmu-stu-pill-track {
  position: relative;
  height: 10px !important;
  background: #EAF4F0 !important;
  border-radius: 999px !important;
  overflow: hidden;
  display: block !important;
}
.rmu-stu-pill-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 52%, #10B981 100%);
  width: var(--rmu-prog, 0%);
  animation: rmuLineShoot 1.65s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.rmu-stu-pill-dots {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -13.5px;
  padding: 0 2px;
  pointer-events: none;
}
.rmu-stage-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid #CBDCD6;
  box-shadow: 0 1px 4px rgba(15, 41, 34, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 2;
}
.rmu-stage-dot.is-done {
  background: var(--dot-c, #0E8A72);
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(14, 138, 114, 0.22);
}
.rmu-stage-dot.is-cur {
  width: 19px;
  height: 19px;
  background: var(--dot-c, #E11D48);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 4px var(--dot-ring, rgba(225, 29, 72, 0.28));
  transform: scale(1.06);
}
.rmu-stage-labels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}
.rmu-stage-lbl {
  font-size: 10.6px;
  line-height: 1.25;
  color: #64748B;
  text-align: center;
  font-weight: 500;
}
.rmu-stage-lbl:first-child { text-align: left; }
.rmu-stage-lbl:last-child { text-align: right; }
.rmu-stage-lbl.is-done { color: #0B6B53; font-weight: 600; }
.rmu-stage-lbl.is-cur { color: var(--dot-c, #E11D48); font-weight: 700; }
body.dark-mode .rmu-stage-dot { background: #10241E; border-color: rgba(45, 212, 191, 0.28); }
body.dark-mode .rmu-stage-lbl.is-done { color: #6EE7B7; }

/* #4 Guarantee Tour Step 2 popover NEVER covers #sampleDemoCardWrap on desktop */
@media (min-width: 992px) {
  body.tour-step2-active #sampleDemoCardWrap {
    margin-bottom: 320px !important;
  }
  body.tour-step2-active .driver-popover {
    position: fixed !important;
    bottom: 24px !important;
    left: 50% !important;
    top: auto !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 560px !important;
    width: min(92vw, 560px) !important;
    z-index: 100005 !important;
    box-shadow: 0 18px 42px rgba(11, 107, 83, 0.22) !important;
  }
  body.tour-step2-active .driver-popover-arrow {
    display: none !important;
  }
}

/* #6 Modern Apple-style App Icon Dock for Share Modal */
.rmu-share-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px;
  margin-bottom: 14px;
}
.rmu-share-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none !important;
  color: #1E293B;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.rmu-share-tile:hover {
  background: #F4FAF7;
  transform: translateY(-2px);
  color: #0B6B53;
}
body.dark-mode .rmu-share-tile { color: #E2F4EE; }
body.dark-mode .rmu-share-tile:hover { background: rgba(16, 185, 129, 0.12); }
.rmu-share-ico {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #FFFFFF;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}
.rmu-share-ico.line { background: linear-gradient(135deg, #06C755 0%, #00B900 100%); }
.rmu-share-ico.imsg { background: linear-gradient(135deg, #34D399 0%, #16A34A 100%); }
.rmu-share-ico.email { background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%); }
.rmu-share-ico.ig { background: linear-gradient(135deg, #F58529 0%, #DD2A7B 55%, #8134AF 100%); }
.rmu-share-ico.tiktok { background: linear-gradient(135deg, #1E293B 0%, #090D16 100%); }
.rmu-share-ico.native { background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%); }
.rmu-share-lbl {
  font-size: 11.8px;
  font-weight: 600;
  line-height: 1.2;
}

/* ==========================================================================
   V15: ZERO-OVERLAP STEP 2 SIDE-BY-SIDE, PULSING RED-DOT MINIMAL STATUS BAR,
        2.4s SCROLL-TRIGGERED GLIDE & POLISHED BRAND SVG SHARE DOCK
   ========================================================================== */

/* #1 Desktop Tour Step 2: Side-by-Side Stage (Card on Left, Popover on Right — ZERO overlap!) */
@media (min-width: 992px) {
  body.tour-step2-active #sampleDemoCardWrap {
    max-width: calc(100% - 375px) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    margin-bottom: 40px !important;
  }
  body.tour-step2-active #sampleDemoCardWrap .sample-card-outer {
    max-width: 100% !important;
    margin: 0 !important;
  }
  body.tour-step2-active .driver-popover {
    position: fixed !important;
    top: 50% !important;
    right: 22px !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 340px !important;
    max-width: 340px !important;
    z-index: 100005 !important;
    box-shadow: 0 20px 50px rgba(11, 107, 83, 0.22) !important;
  }
  body.tour-step2-active .driver-popover-arrow {
    display: none !important;
  }
}

/* #3/#6 Calm, silky 2.4s gliding progress bars matching kruphuchuay pace */
.rmu-glide-fill {
  transition: width 2.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.rmu-status-pill-seg {
  transition: width 2.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* #5 Minimal Student Status Bar matching f243b4d6.jpeg with pulsing RED dot */
@keyframes rmuRedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.55);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(225, 29, 72, 0);
  }
}
.rmu-stu-min-card {
  background: #FFFFFF;
  border: 1px solid #E6F1ED;
  border-radius: 16px;
  padding: 16px 20px;
  margin: 10px 0 12px;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.03);
}
body.dark-mode .rmu-stu-min-card {
  background: rgba(15, 34, 28, 0.78);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-stu-min-track {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 11px;
  background: #EAF4F0;
  border-radius: 999px;
  overflow: visible;
  position: relative;
}
body.dark-mode .rmu-stu-min-track {
  background: rgba(255, 255, 255, 0.09);
}
.rmu-stu-min-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 55%, #10B981 100%);
  transition: width 2.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.rmu-stu-red-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E11D48;
  flex-shrink: 0;
  animation: rmuRedPulse 1.8s ease-in-out infinite;
}
.rmu-stu-red-dot-sm {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #E11D48;
  display: inline-block;
  flex-shrink: 0;
  animation: rmuRedPulse 1.8s ease-in-out infinite;
}

/* #4 Refined Share Sheet & Authentic SVG Brand Squircles */
.rmu-share-tile {
  padding: 10px 6px !important;
  border-radius: 16px !important;
}
.rmu-share-ico {
  width: 52px !important;
  height: 52px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255,255,255,0.28) !important;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease !important;
}
.rmu-share-tile:hover .rmu-share-ico {
  transform: scale(1.06) translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255,255,255,0.35) !important;
}
.rmu-share-ico svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* ==========================================================================
   V16: OFFICIAL BRAND SHARE SQUIRCLES, RED STAGE DIVIDER DOTS (NONE AT 100%),
        AND ULTRA-SILKY 2.8s GLIDING PROGRESS BARS
   ========================================================================== */

/* #4 Slower, silkier gliding bars */
.rmu-glide-fill,
.rmu-status-pill-seg,
.rmu-stu-min-fill {
  transition: width 2.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* #3 Student status bar with crisp red divider dots (hidden at 100% full green) */
.rmu-stu-min-track {
  position: relative !important;
  display: block !important;
  width: 100%;
  height: 11px;
  background: #EAF4F0;
  border-radius: 999px;
  overflow: visible !important;
}
.rmu-stu-min-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 52%, #10B981 100%);
  z-index: 1;
}
.rmu-stu-red-sep {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #E11D48;
  border: 1.5px solid #FFFFFF;
  z-index: 3;
  pointer-events: none;
}
.rmu-stu-red-sep.is-active {
  width: 13px;
  height: 13px;
  background: #E11D48;
  border: 2px solid #FFFFFF;
  animation: rmuRedPulse 1.8s ease-in-out infinite;
  transform: translate(-50%, -50%);
}
@keyframes rmuRedPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.58);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(225, 29, 72, 0);
  }
}

/* #2 Official brand colors for Share Dock icons */
.rmu-share-ico.line {
  background: #06C755 !important;
}
.rmu-share-ico.imsg {
  background: linear-gradient(180deg, #5BF675 0%, #19C63D 100%) !important;
}
.rmu-share-ico.email {
  background: linear-gradient(180deg, #38BDF8 0%, #007AFF 100%) !important;
}
.rmu-share-ico.ig {
  background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%) !important;
}
.rmu-share-ico.tiktok {
  background: #000000 !important;
}
.rmu-share-ico.native {
  background: linear-gradient(180deg, #10B981 0%, #0B6B53 100%) !important;
}
.rmu-share-ico svg {
  width: 28px !important;
  height: 28px !important;
}

/* ==========================================================================
   V17: HARMONIOUS EMERALD STAGE DOTS, 3D GLOSSY SHARE ICONS & SMOOTH PBAR
   ========================================================================== */

/* Smooth gliding province card bars */
.prov-card .pbar {
  background: #EAF4F0 !important;
  border-radius: 999px !important;
  overflow: hidden !important;
}
.prov-card .pbar i.rmu-glide-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53 0%, #0E8A72 55%, #10B981 100%) !important;
  transition: width 2.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Harmonious RMU emerald-theme divider dots on student progress bar */
@keyframes rmuEmeraldPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
}
.rmu-stu-red-sep {
  width: 8px !important;
  height: 8px !important;
  background: #FFFFFF !important;
  border: 2px solid #0B6B53 !important;
  box-shadow: 0 1px 3px rgba(11, 107, 83, 0.2) !important;
}
.rmu-stu-red-sep.is-active {
  width: 14px !important;
  height: 14px !important;
  background: #10B981 !important;
  border: 2.5px solid #FFFFFF !important;
  animation: rmuEmeraldPulse 1.9s ease-in-out infinite !important;
}
.rmu-stu-red-sep.is-alert {
  width: 14px !important;
  height: 14px !important;
  background: #F43F5E !important;
  border: 2.5px solid #FFFFFF !important;
  animation: rmuRedPulse 1.9s ease-in-out infinite !important;
}
.rmu-stu-cur-dot-sm {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  flex-shrink: 0;
  animation: rmuEmeraldPulse 1.9s ease-in-out infinite;
}

/* 3D Glossy Dimensional Share Dock Icons */
.rmu-share-tile {
  background: #FAFDFC !important;
  border: 1px solid #EAF3EF !important;
  border-radius: 16px !important;
  padding: 12px 8px 10px !important;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.2s ease, background 0.2s ease !important;
}
.rmu-share-tile:hover {
  background: #FFFFFF !important;
  border-color: #BFE3D6 !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 24px rgba(11, 107, 83, 0.1) !important;
}
body.dark-mode .rmu-share-tile {
  background: rgba(16, 36, 30, 0.72) !important;
  border-color: rgba(45, 212, 191, 0.18) !important;
}
.rmu-share-ico {
  position: relative;
  overflow: hidden;
  width: 54px !important;
  height: 54px !important;
  border-radius: 16px !important;
  box-shadow:
    0 10px 20px -4px rgba(15, 23, 42, 0.24),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18) !important;
}
.rmu-share-ico::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-radius: 16px 16px 50% 50% / 16px 16px 12px 12px;
  pointer-events: none;
}
.rmu-share-ico.line { box-shadow: 0 10px 20px -4px rgba(6, 199, 85, 0.42), inset 0 1.5px 1px rgba(255,255,255,0.45), inset 0 -3px 6px rgba(0,0,0,0.14) !important; }
.rmu-share-ico.imsg { box-shadow: 0 10px 20px -4px rgba(25, 198, 61, 0.40), inset 0 1.5px 1px rgba(255,255,255,0.45), inset 0 -3px 6px rgba(0,0,0,0.14) !important; }
.rmu-share-ico.email { box-shadow: 0 10px 20px -4px rgba(0, 122, 255, 0.38), inset 0 1.5px 1px rgba(255,255,255,0.45), inset 0 -3px 6px rgba(0,0,0,0.14) !important; }
.rmu-share-ico.ig { box-shadow: 0 10px 20px -4px rgba(214, 36, 159, 0.42), inset 0 1.5px 1px rgba(255,255,255,0.42), inset 0 -3px 6px rgba(0,0,0,0.16) !important; }
.rmu-share-ico.tiktok { box-shadow: 0 10px 20px -4px rgba(15, 23, 42, 0.45), inset 0 1.5px 1px rgba(255,255,255,0.28), inset 0 -3px 6px rgba(0,0,0,0.35) !important; }
.rmu-share-ico.native { box-shadow: 0 10px 20px -4px rgba(14, 138, 114, 0.40), inset 0 1.5px 1px rgba(255,255,255,0.45), inset 0 -3px 6px rgba(0,0,0,0.15) !important; }
.rmu-share-ico svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1.5px 2px rgba(0, 0, 0, 0.16));
}

/* ==========================================================================
   V18: MAP COLOR KEY, REFINED ROSE-RED STATUS DOTS & FLAT MODERN SHARE ICONS
   ========================================================================== */

/* #1 Concise color meaning key below Thailand map */
.rmu-thmap-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  width: 100%;
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid #EDF5F1;
  font-size: 11px;
  color: #64748B;
}
.rmu-thmap-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rmu-thmap-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
body.dark-mode .rmu-thmap-key {
  border-top-color: rgba(45, 212, 191, 0.14);
  color: #94A3B8;
}

/* #2 Refined, elegant rose-red dots on student progress bar */
@keyframes rmuRosePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(244, 63, 94, 0);
  }
}
.rmu-stu-red-sep {
  width: 7px !important;
  height: 7px !important;
  background: #FB7185 !important;
  border: 1.5px solid #FFFFFF !important;
  box-shadow: 0 1px 2px rgba(244, 63, 94, 0.25) !important;
}
.rmu-stu-red-sep.is-active,
.rmu-stu-red-sep.is-alert {
  width: 12px !important;
  height: 12px !important;
  background: linear-gradient(135deg, #FB7185 0%, #E11D48 100%) !important;
  border: 2px solid #FFFFFF !important;
  animation: rmuRosePulse 2s ease-in-out infinite !important;
}
.rmu-stu-cur-dot-sm {
  background: #F43F5E !important;
  animation: rmuRosePulse 2s ease-in-out infinite !important;
}

/* #3 Flat, modern, crisp Share icons (no 3D glossy dome, no heavy bevel) */
.rmu-share-tile {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  padding: 10px 6px !important;
  box-shadow: none !important;
}
.rmu-share-tile:hover {
  background: #F4FAF7 !important;
  border-color: #E2EFEA !important;
  transform: translateY(-2px) !important;
  box-shadow: none !important;
}
body.dark-mode .rmu-share-tile {
  background: transparent !important;
  border-color: transparent !important;
}
body.dark-mode .rmu-share-tile:hover {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(45, 212, 191, 0.2) !important;
}
.rmu-share-ico {
  width: 50px !important;
  height: 50px !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08) !important;
  transition: transform 0.18s ease, opacity 0.18s ease !important;
}
.rmu-share-ico::before {
  display: none !important;
  content: none !important;
}
.rmu-share-ico.line,
.rmu-share-ico.imsg,
.rmu-share-ico.email,
.rmu-share-ico.ig,
.rmu-share-ico.tiktok,
.rmu-share-ico.native {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09) !important;
}
.rmu-share-tile:hover .rmu-share-ico {
  transform: scale(1.05) !important;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.13) !important;
}
.rmu-share-ico svg {
  width: 26px !important;
  height: 26px !important;
  filter: none !important;
}

/* ==========================================================================
   V19: FLOWBITE V3 DESIGN SYSTEM (RMU EMERALD THEME)
   Stepper + Buttons + Chart Cards + Tables + Toggles + Inputs
   ========================================================================== */

/* 1) Flowbite Horizontal Icon Stepper (.rmu-fb-stepper) */
.rmu-fb-step-card {
  background: #FFFFFF;
  border: 1px solid #E4EFEA;
  border-radius: 12px;
  padding: 16px 18px 14px;
  margin: 10px 0 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.dark-mode .rmu-fb-step-card {
  background: rgba(15, 34, 28, 0.82);
  border-color: rgba(45, 212, 191, 0.22);
}
.rmu-fb-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #EDF5F1;
}
body.dark-mode .rmu-fb-step-head {
  border-bottom-color: rgba(45, 212, 191, 0.14);
}
.rmu-fb-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #E8F6F1;
  color: #0B6B53;
  border: 1px solid #CBE8DD;
}
.rmu-fb-step-badge.is-alert {
  background: #FFF1F2;
  color: #BE123C;
  border-color: #FECDD3;
}
body.dark-mode .rmu-fb-step-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
  border-color: rgba(110, 231, 183, 0.25);
}
.rmu-fb-stepper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}
.rmu-fb-step {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
}
.rmu-fb-step-row {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  position: relative;
}
.rmu-fb-step:not(:last-child) .rmu-fb-step-row::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(50% + 22px);
  width: calc(100% - 44px);
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #E5EFEA;
  transition: background 0.6s ease;
  z-index: 1;
}
.rmu-fb-step.is-done:not(:last-child) .rmu-fb-step-row::after {
  background: linear-gradient(90deg, #0E8A72 0%, #34D399 100%);
}
body.dark-mode .rmu-fb-step:not(:last-child) .rmu-fb-step-row::after {
  background: rgba(255, 255, 255, 0.12);
}
body.dark-mode .rmu-fb-step.is-done:not(:last-child) .rmu-fb-step-row::after {
  background: linear-gradient(90deg, #0E8A72 0%, #34D399 100%);
}
.rmu-fb-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F1F6F4;
  color: #64748B;
  border: 1.5px solid #E2ECE8;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.rmu-fb-circle svg {
  width: 19px;
  height: 19px;
}
.rmu-fb-step.is-done .rmu-fb-circle {
  background: #E3F6F1;
  color: #0B6B53;
  border-color: #A7F3D0;
}
.rmu-fb-step.is-cur .rmu-fb-circle {
  background: #0E8A72;
  color: #FFFFFF;
  border-color: #0E8A72;
  box-shadow: 0 0 0 4px rgba(14, 138, 114, 0.2);
}
.rmu-fb-step.is-alert .rmu-fb-circle {
  background: #E11D48;
  color: #FFFFFF;
  border-color: #E11D48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.2);
}
body.dark-mode .rmu-fb-circle {
  background: rgba(255, 255, 255, 0.07);
  color: #94A3B8;
  border-color: rgba(45, 212, 191, 0.2);
}
body.dark-mode .rmu-fb-step.is-done .rmu-fb-circle {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border-color: rgba(110, 231, 183, 0.35);
}
.rmu-fb-lbl {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  color: #64748B;
  font-weight: 500;
  padding: 0 2px;
}
.rmu-fb-step.is-done .rmu-fb-lbl {
  color: #0B6B53;
  font-weight: 600;
}
.rmu-fb-step.is-cur .rmu-fb-lbl {
  color: #0B6B53;
  font-weight: 700;
}
.rmu-fb-step.is-alert .rmu-fb-lbl {
  color: #E11D48;
  font-weight: 700;
}
body.dark-mode .rmu-fb-step.is-done .rmu-fb-lbl,
body.dark-mode .rmu-fb-step.is-cur .rmu-fb-lbl {
  color: #6EE7B7;
}
@media (max-width: 575.98px) {
  .rmu-fb-circle { width: 32px; height: 32px; }
  .rmu-fb-circle svg { width: 15px; height: 15px; }
  .rmu-fb-step:not(:last-child) .rmu-fb-step-row::after {
    left: calc(50% + 17px);
    width: calc(100% - 34px);
    height: 3px;
  }
  .rmu-fb-lbl { font-size: 9.8px; }
}

/* 2) Flowbite Buttons (rounded-base 8px, shadow-xs, focus:ring-4) */
.btn {
  border-radius: 8px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease !important;
}
.btn.rounded-pill {
  border-radius: 999px !important;
}
.btn-main {
  background: #0E8A72 !important;
  border: 1px solid transparent !important;
  color: #FFFFFF !important;
}
.btn-main:hover {
  background: #0B6B53 !important;
  color: #FFFFFF !important;
}
.btn-main:focus-visible {
  box-shadow: 0 0 0 4px rgba(14, 138, 114, 0.24) !important;
}
.btn-soft {
  background: #F8FBFA !important;
  border: 1px solid #D5E4DF !important;
  color: #1E293B !important;
}
.btn-soft:hover {
  background: #EDF6F2 !important;
  border-color: #BBD6CC !important;
  color: #0B6B53 !important;
}
.btn-soft:focus-visible {
  box-shadow: 0 0 0 4px rgba(14, 138, 114, 0.14) !important;
}
body.dark-mode .btn-soft {
  background: rgba(20, 42, 35, 0.85) !important;
  border-color: rgba(45, 212, 191, 0.24) !important;
  color: #E2F4EE !important;
}
body.dark-mode .btn-soft:hover {
  background: rgba(16, 185, 129, 0.18) !important;
}
.btn-danger {
  background: #DC2626 !important;
  border-color: transparent !important;
}
.btn-danger:hover { background: #B91C1C !important; }
.btn-danger:focus-visible { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.24) !important; }
.btn-warning {
  background: #D97706 !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
}
.btn-warning:hover { background: #B45309 !important; color: #FFFFFF !important; }
.btn-warning:focus-visible { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.24) !important; }

/* 3) Flowbite Chart Cards (.cardx, .card-t) */
.cardx {
  background: #FFFFFF;
  border: 1px solid #E4EFEA !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.cardx .card-t {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #EDF5F1;
}
body.dark-mode .cardx .card-t {
  border-bottom-color: rgba(45, 212, 191, 0.14);
}

/* 4) Flowbite Data Tables (clean crisp headers & hoverable rows) */
.table {
  --bs-table-hover-bg: #F5FBF8;
  --bs-table-border-color: #EDF5F1;
  font-size: 13.5px;
}
.table thead th {
  background: #F6FBF9 !important;
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  border-bottom: 1px solid #DCEBE5 !important;
  padding: 11px 12px !important;
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 12px !important;
  vertical-align: middle;
  border-bottom: 1px solid #EEF5F2 !important;
  color: var(--ink, #0F2922);
}
.table tbody tr:hover td {
  background: #F4FAF7 !important;
}
body.dark-mode .table thead th {
  background: rgba(15, 36, 30, 0.92) !important;
  color: #94A3B8 !important;
  border-bottom-color: rgba(45, 212, 191, 0.18) !important;
}
body.dark-mode .table tbody td {
  border-bottom-color: rgba(45, 212, 191, 0.1) !important;
}
body.dark-mode .table tbody tr:hover td {
  background: rgba(16, 185, 129, 0.08) !important;
}

/* 5) Flowbite Toggle Switches (w-9 h-5 pill, smooth thumb, brand focus ring) */
.form-switch .form-check-input {
  width: 2.35rem !important;
  height: 1.28rem !important;
  border-radius: 999px !important;
  background-color: #CBD5E1 !important;
  border: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease, background-position 0.2s ease, box-shadow 0.2s ease !important;
}
.form-switch .form-check-input:checked {
  background-color: #0E8A72 !important;
}
.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 4px rgba(14, 138, 114, 0.22) !important;
}

/* 6) Flowbite Inputs, Selects & File Inputs (rounded-base 8px, soft neutral bg, brand focus ring) */
.form-control,
.form-select {
  background-color: #F8FBFA !important;
  border: 1px solid #D5E4DF !important;
  border-radius: 8px !important;
  color: #0F2922 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease !important;
}
.form-control:focus,
.form-select:focus {
  background-color: #FFFFFF !important;
  border-color: #0E8A72 !important;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.18) !important;
}
.form-control[type="file"] {
  padding: 0.32rem 0.65rem !important;
  cursor: pointer;
}
.form-control[type="file"]::file-selector-button {
  background: #0B6B53;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  margin-right: 10px;
  font-weight: 500;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s ease;
}
.form-control[type="file"]::file-selector-button:hover {
  background: #0E8A72;
}
.form-check-input:not([role="switch"]):checked {
  background-color: #0E8A72 !important;
  border-color: #0E8A72 !important;
}
.form-check-input:focus {
  border-color: #0E8A72 !important;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.2) !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: rgba(15, 34, 28, 0.88) !important;
  border-color: rgba(45, 212, 191, 0.24) !important;
  color: #E2F4EE !important;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background-color: rgba(11, 27, 22, 0.96) !important;
  border-color: #34D399 !important;
}

/* ==========================================================================
   V20: PILLIO-INSPIRED ULTRA-CLEAN SAAS UI/UX (RMU EMERALD EDITION)
   Light airy canvas + Pure white minimal sidebar + Soft 18px bento cards
   ========================================================================== */

:root {
  --pillio-canvas: #F5F7F8;
  --pillio-surface: #FFFFFF;
  --pillio-border: #EAEEF0;
  --pillio-border-strong: #DCE3E6;
  --pillio-ink: #111827;
  --pillio-muted: #6B7280;
  --pillio-brand: #0E8A72;
  --pillio-brand-dark: #0B6B53;
  --pillio-brand-soft: #ECF8F4;
}

/* 1) Airy Pillio Canvas */
body:not(.dark-mode) {
  background: var(--pillio-canvas) !important;
  color: var(--pillio-ink) !important;
}
body:not(.dark-mode) .app-main,
body:not(.dark-mode) main {
  background: var(--pillio-canvas) !important;
}

/* 3) Minimal Clean Topbar */
body:not(.dark-mode) .topbar,
body:not(.dark-mode) .app-topbar {
  background: rgba(245, 247, 248, 0.88) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pillio-border) !important;
  box-shadow: none !important;
}

/* 4) Pillio Crisp White Page Header & Cards (18px radius, whisper hairline border, airy padding) */
body:not(.dark-mode) .page-banner {
  background: #FFFFFF !important;
  border: 1px solid var(--pillio-border) !important;
  border-radius: 20px !important;
  padding: 20px 24px !important;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.025) !important;
}
body:not(.dark-mode) .page-banner::before {
  display: none !important;
}
body:not(.dark-mode) .cardx {
  background: #FFFFFF !important;
  border: 1px solid var(--pillio-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.025) !important;
}
body:not(.dark-mode) .cardx .card-t {
  border-bottom: 1px solid #F1F4F6 !important;
}

/* 5) Pillio Minimal KPI Cards (Crisp White, Huge Clean Numbers, Zero Noise) */
body:not(.dark-mode) .kpi {
  background: #FFFFFF !important;
  border: 1px solid var(--pillio-border) !important;
  border-radius: 18px !important;
  padding: 18px 20px !important;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.025) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}
body:not(.dark-mode) .kpi:hover {
  transform: translateY(-2px);
  border-color: #CFE9DF !important;
  box-shadow: 0 8px 22px rgba(14, 138, 114, 0.07) !important;
}
body:not(.dark-mode) .kpi .ico {
  width: 36px !important;
  height: 36px !important;
  border-radius: 11px !important;
  font-size: 1rem !important;
}
body:not(.dark-mode) .kpi .num {
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: #111827 !important;
  letter-spacing: -0.03em !important;
  margin-top: 6px !important;
}
body:not(.dark-mode) .kpi .lbl {
  color: #4B5563 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
body:not(.dark-mode) .kpi .kpi-tag {
  background: #F4F6F8 !important;
  color: #6B7280 !important;
  border: none !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  padding: 3px 9px !important;
}
body:not(.dark-mode) .kpi .kpi-foot {
  border-top: 1px solid #F3F5F7 !important;
  padding-top: 10px !important;
  margin-top: 12px !important;
  font-size: 12px !important;
  color: #6B7280 !important;
}

/* 6) Pillio Sleek Pill Primary Buttons & Segmented Filter Tabs */
body:not(.dark-mode) .btn-main {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #FFFFFF !important;
  border-radius: 999px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.14) !important;
}
body:not(.dark-mode) .btn-main:hover {
  background: #0B6B53 !important;
  border-color: #0B6B53 !important;
}
body:not(.dark-mode) .btn-soft {
  background: #FFFFFF !important;
  border: 1px solid var(--pillio-border-strong) !important;
  color: #374151 !important;
  border-radius: 999px !important;
}
body:not(.dark-mode) .btn-soft:hover {
  background: #F4F7F6 !important;
  border-color: #0E8A72 !important;
  color: #0B6B53 !important;
}
body:not(.dark-mode) .seg {
  background: #F1F4F6 !important;
  border-radius: 999px !important;
  padding: 3px !important;
  border: none !important;
}
body:not(.dark-mode) .seg button {
  border-radius: 999px !important;
  color: #6B7280 !important;
  font-weight: 500 !important;
}
body:not(.dark-mode) .seg button.on {
  background: #FFFFFF !important;
  color: #111827 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08) !important;
}

/* 7) Pillio Clean Inputs & Soft Pill Search */
body:not(.dark-mode) .form-control,
body:not(.dark-mode) .form-select {
  background-color: #F8FAFB !important;
  border: 1px solid var(--pillio-border) !important;
  border-radius: 12px !important;
  color: #111827 !important;
}
body:not(.dark-mode) .form-control:focus,
body:not(.dark-mode) .form-select:focus {
  background-color: #FFFFFF !important;
  border-color: #0E8A72 !important;
  box-shadow: 0 0 0 3px rgba(14, 138, 114, 0.14) !important;
}

/* 8) Pillio Clean Tables & Status Cards */
body:not(.dark-mode) .table thead th {
  background: #F8FAFB !important;
  color: #6B7280 !important;
  border-bottom: 1px solid var(--pillio-border) !important;
}
body:not(.dark-mode) .table tbody td {
  border-bottom: 1px solid #F2F4F6 !important;
}
body:not(.dark-mode) .table tbody tr:hover td {
  background: #F8FBFA !important;
}
body:not(.dark-mode) .rmu-status-pill-card,
body:not(.dark-mode) .rmu-fb-step-card,
body:not(.dark-mode) #pvMapSection {
  background: #FFFFFF !important;
  border: 1px solid var(--pillio-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.025) !important;
}
body:not(.dark-mode) .b-chip.status {
  background: #ECF8F4 !important;
  color: #0B6B53 !important;
  border-color: #D1EFE4 !important;
}
body:not(.dark-mode) .b-chip.fac {
  background: #F3F5F7 !important;
  color: #374151 !important;
  border-color: #E5E7EB !important;
}

/* Mobile bottom nav matches Pillio clean white glass */
body:not(.dark-mode) .mob-nav,
body:not(.dark-mode) .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--pillio-border) !important;
}

/* ==========================================================================
   V21: ORIGINAL EMERALD SIDEBAR + APPLE LIQUID GLASS UI + CLEAN BUTTON GRIDS
   ========================================================================== */

/* Soft ambient gradient canvas so Liquid Glass translucency shines */
body:not(.dark-mode) {
  background:
    radial-gradient(ellipse 80% 55% at 15% 0%, rgba(167, 243, 208, 0.34) 0%, transparent 62%),
    radial-gradient(ellipse 65% 50% at 88% 12%, rgba(153, 246, 228, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(209, 250, 229, 0.24) 0%, transparent 65%),
    #F2F7F5 !important;
  background-attachment: fixed !important;
}
body:not(.dark-mode) .app-main,
body:not(.dark-mode) main {
  background: transparent !important;
}

/* Liquid Glass Surfaces (Light Mode) */
body:not(.dark-mode) .page-banner,
body:not(.dark-mode) .cardx,
body:not(.dark-mode) .kpi,
body:not(.dark-mode) .rmu-status-pill-card,
body:not(.dark-mode) .rmu-fb-step-card,
body:not(.dark-mode) #pvMapSection,
body:not(.dark-mode) .modal-content {
  background: rgba(255, 255, 255, 0.74) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow:
    0 8px 30px rgba(11, 107, 83, 0.065),
    0 1px 2px rgba(15, 41, 34, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}
body:not(.dark-mode) .topbar,
body:not(.dark-mode) .app-topbar {
  background: rgba(255, 255, 255, 0.68) !important;
  backdrop-filter: blur(22px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(190%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 4px 20px rgba(11, 107, 83, 0.045) !important;
}
body:not(.dark-mode) .mob-nav,
body:not(.dark-mode) .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(22px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(190%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.85) !important;
}

/* Liquid Glass Surfaces (Dark Mode) */
body.dark-mode .page-banner,
body.dark-mode .cardx,
body.dark-mode .kpi,
body.dark-mode .rmu-status-pill-card,
body.dark-mode .rmu-fb-step-card,
body.dark-mode #pvMapSection,
body.dark-mode .modal-content {
  background: rgba(14, 34, 28, 0.72) !important;
  backdrop-filter: blur(20px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(165%) !important;
  border: 1px solid rgba(110, 231, 183, 0.16) !important;
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Liquid Glass Pill Buttons & Clean Aligned Button Grids */
.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px;
  vertical-align: middle;
}
.btn-sm {
  min-height: 34px;
  padding: 6px 13px !important;
  font-size: 12.8px !important;
}
.btn-xs {
  min-height: 28px;
  padding: 4px 10px !important;
}
body:not(.dark-mode) .btn-main {
  background: linear-gradient(135deg, #0E8A72 0%, #0B6B53 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #FFFFFF !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(14, 138, 114, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}
body:not(.dark-mode) .btn-main:hover {
  background: linear-gradient(135deg, #0B6B53 0%, #065F46 100%) !important;
  transform: translateY(-1px);
}
body:not(.dark-mode) .btn-soft {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(14, 138, 114, 0.18) !important;
  color: #0F2922 !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 6px rgba(11, 107, 83, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}
body:not(.dark-mode) .btn-soft:hover {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: #0E8A72 !important;
  color: #0B6B53 !important;
}
.dash-export-grp,
.page-banner .d-flex.flex-wrap.gap-2 {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}
.step-card .btn-group {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}
.step-card .btn-group > .btn {
  border-radius: 10px !important;
  margin-left: 0 !important;
  white-space: nowrap;
  padding: 6px 8px !important;
  font-size: 12px !important;
}
@media (max-width: 575.98px) {
  .step-card .btn-group {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Official-logo Share Dock Grid */
.rmu-share-dock {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}
.rmu-share-ico.gmail {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
}

/* ==========================================================================
   V22: ANIMATED FLOWBITE STEPPER, FIXED LETTERS BUTTONS, CRISP WHITE MODALS,
        CLEAN ADMIN GUIDE (LIGHT & DARK) & BRIGHT LIQUID GLASS
   ========================================================================== */

/* 1) Animated breathing pulse & shimmer on Flowbite Student Status Stepper */
@keyframes rmuFbPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(14, 138, 114, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(14, 138, 114, 0);
    transform: scale(1.07);
  }
}
@keyframes rmuFbAlertPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.48);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(225, 29, 72, 0);
    transform: scale(1.07);
  }
}
@keyframes rmuLineFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.rmu-fb-step.is-cur .rmu-fb-circle {
  background: linear-gradient(135deg, #10B981 0%, #0E8A72 100%) !important;
  animation: rmuFbPulse 2s ease-in-out infinite !important;
}
.rmu-fb-step.is-alert .rmu-fb-circle {
  background: linear-gradient(135deg, #FB7185 0%, #E11D48 100%) !important;
  animation: rmuFbAlertPulse 1.9s ease-in-out infinite !important;
}
.rmu-fb-step.is-done:not(:last-child) .rmu-fb-step-row::after {
  background: linear-gradient(90deg, #0B6B53, #10B981, #34D399, #0E8A72, #0B6B53) !important;
  background-size: 200% 100% !important;
  animation: rmuLineFlow 3.6s linear infinite !important;
}

/* 2) Fix Official Letters (.step-card .btn-group) so NO button text ever clips or overflows */
.step-card .btn-group {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  width: 100% !important;
}
.step-card .btn-group > .btn {
  flex: 1 1 auto !important;
  min-width: fit-content !important;
  border-radius: 10px !important;
  margin-left: 0 !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}
.step-card .btn-group > .btn[onclick*="shareDocStep"] {
  flex: 0 0 38px !important;
  min-width: 38px !important;
  padding: 6px 0 !important;
}
.step-card .input-group .btn {
  padding: 5px 10px !important;
  white-space: nowrap !important;
}

/* 3) Pure crisp WHITE Modals (Profile, Dev View, Share, Preview, etc.) — never muddy gray! */
body:not(.dark-mode) .modal-content {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #E3EFEA !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(15, 41, 34, 0.16) !important;
}
body:not(.dark-mode) .modal-header {
  background: #FFFFFF;
  border-bottom: 1px solid #EDF5F1;
}
body:not(.dark-mode) .modal-footer {
  background: #FAFDFC;
  border-top: 1px solid #EDF5F1;
}
body.dark-mode .modal-content {
  background: #10241E !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(110, 231, 183, 0.2) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}
body.dark-mode .modal-header {
  border-bottom-color: rgba(110, 231, 183, 0.14);
}
body.dark-mode .modal-footer {
  background: rgba(11, 27, 22, 0.65);
  border-top-color: rgba(110, 231, 183, 0.14);
}

/* Brighter, cleaner Liquid Glass for page cards (fresh white translucency) */
body:not(.dark-mode) .page-banner,
body:not(.dark-mode) .cardx,
body:not(.dark-mode) .kpi,
body:not(.dark-mode) .rmu-status-pill-card,
body:not(.dark-mode) .rmu-fb-step-card,
body:not(.dark-mode) #pvMapSection {
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(224, 238, 233, 0.92) !important;
}

/* 4) Clean, high-contrast Admin Guide (#page-guide) in BOTH Light & Dark Mode */
body:not(.dark-mode) #page-guide #guideRoadmap .cardx,
body:not(.dark-mode) #page-guide #guideRoadmap .g-flow-node,
body:not(.dark-mode) #page-guide #guideRoadmap .g-card,
body:not(.dark-mode) #page-guide #guideRoadmap .guide-card {
  background: #FFFFFF !important;
  border: 1px solid #E3EFEA !important;
  border-radius: 16px !important;
  color: #0F2922 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap [style*="background:"] {
  background: #F4FAF7 !important;
  color: #0F2922 !important;
  border: 1px solid #E3EFEA !important;
}
body.dark-mode #page-guide #guideRoadmap .cardx,
body.dark-mode #page-guide #guideRoadmap .g-flow-node,
body.dark-mode #page-guide #guideRoadmap .g-card,
body.dark-mode #page-guide #guideRoadmap .guide-card {
  background: #10241E !important;
  border: 1px solid rgba(110, 231, 183, 0.16) !important;
  border-radius: 16px !important;
  color: #E6F5F0 !important;
}
body.dark-mode #page-guide #guideRoadmap [style*="background:"] {
  background: rgba(16, 44, 36, 0.9) !important;
  color: #E6F5F0 !important;
  border: 1px solid rgba(110, 231, 183, 0.18) !important;
}
body.dark-mode #page-guide #guideRoadmap .text-muted,
body.dark-mode #page-guide #guideRoadmap small {
  color: #94B8AC !important;
}
body.dark-mode #page-guide #guideRoadmap .badge,
body.dark-mode #page-guide #guideRoadmap .chip {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6EE7B7 !important;
  border-color: rgba(110, 231, 183, 0.25) !important;
}
body.dark-mode #page-guide #guideRoadmap .btn-soft,
body.dark-mode #page-guide #guideRoadmap .btn-sm {
  background: rgba(16, 44, 36, 0.9) !important;
  color: #6EE7B7 !important;
  border-color: rgba(110, 231, 183, 0.25) !important;
}
body.dark-mode #page-guide #guideRoadmap .guide-cat-btn,
body.dark-mode #page-guide #guideRoadmap button.chip {
  background: #10241E !important;
  color: #CBD5E1 !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
}
body.dark-mode #page-guide #guideRoadmap .guide-cat-btn.active,
body.dark-mode #page-guide #guideRoadmap .guide-cat-btn.on,
body.dark-mode #page-guide #guideRoadmap button.chip.on {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
  border-color: #0E8A72 !important;
}

/* ==========================================================================
   V23: ULTRA-CLEAN GUIDE & CALC FRAMES, PIXEL-CENTERED HAMBURGER ICON,
        AND FULL PRODUCTION-GRADE DARK MODE
   ========================================================================== */

/* 1) Ultra-clean frames on Admin Guide (#page-guide) & Hours Calculator (#page-calc) — NO thick colored side/top stripes */
#page-guide .cardx,
#page-guide .g-card,
#page-guide .guide-card,
#page-guide .g-flow-node,
#page-guide #guideRoadmap > div > div,
#page-guide #guideRoadmap [style*="border-top"],
#page-guide #guideRoadmap [style*="border-left"],
#page-calc .cardx,
#page-calc .calc-kpi,
#page-calc .calc-stat,
#page-calc [style*="border-left"] {
  border: 1px solid #E4EFEA !important;
  border-top: 1px solid #E4EFEA !important;
  border-left: 1px solid #E4EFEA !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.03) !important;
}
body:not(.dark-mode) #page-guide .cardx,
body:not(.dark-mode) #page-calc .cardx,
body:not(.dark-mode) #page-calc .calc-kpi,
body:not(.dark-mode) #page-calc .calc-stat,
body:not(.dark-mode) #page-calc [style*="border-left"] {
  background: #FFFFFF !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .g-tip,
body:not(.dark-mode) #page-guide #guideRoadmap [style*="border-left: 3px"],
body:not(.dark-mode) #page-guide #guideRoadmap [style*="border-left:3px"] {
  background: #F6FBF9 !important;
  border: 1px solid #E4EFEA !important;
  border-radius: 12px !important;
}

/* 2) Pixel-centered Hamburger (☰) & Circular Icon Buttons */
.topbar button,
.app-topbar button,
.sb-head button,
.sb-toggle,
.sb-toggle-btn,
.sb-collapse-btn,
.mob-menu-btn,
.btn-ic,
.icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
.topbar button i.bi,
.app-topbar button i.bi,
.sb-head button i.bi,
.sb-toggle i.bi,
.sb-toggle-btn i.bi,
.sb-collapse-btn i.bi,
.mob-menu-btn i.bi,
.btn-ic i.bi,
.icon-btn i.bi {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateY(0.5px);
}

/* 3) Full Production-Grade Dark Mode (readable contrast across EVERY component) */
body.dark-mode {
  background:
    radial-gradient(ellipse 75% 50% at 15% 0%, rgba(14, 138, 114, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 65% 50% at 85% 15%, rgba(16, 185, 129, 0.10) 0%, transparent 55%),
    #091411 !important;
  color: #E6F4EF !important;
  --ink: #E6F4EF;
  --muted: #94B5AA;
  --line: rgba(110, 231, 183, 0.16);
  --card-bg: #10211C;
  --mint-soft: rgba(16, 185, 129, 0.12);
}
body.dark-mode .app-main,
body.dark-mode main {
  background: transparent !important;
}
body.dark-mode .topbar,
body.dark-mode .app-topbar {
  background: rgba(12, 26, 22, 0.84) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  border-bottom: 1px solid rgba(110, 231, 183, 0.14) !important;
  color: #E6F4EF !important;
}
body.dark-mode .topbar .breadcrumb,
body.dark-mode .topbar .breadcrumb-item,
body.dark-mode .topbar .breadcrumb-item a,
body.dark-mode .topbar span {
  color: #CFE6DE !important;
}
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.dark-mode .fw-bold, body.dark-mode .fw-semibold,
body.dark-mode label, body.dark-mode .form-label {
  color: #ECF7F3 !important;
}
body.dark-mode .text-muted,
body.dark-mode .small.text-muted,
body.dark-mode .kpi .lbl,
body.dark-mode .kpi .kpi-foot,
body.dark-mode .rmu-map-sub,
body.dark-mode .rmu-map-kpi-lbl,
body.dark-mode .rmu-map-hint {
  color: #94B5AA !important;
}
body.dark-mode .kpi .num,
body.dark-mode .rmu-map-kpi-val,
body.dark-mode .rmu-map-title,
body.dark-mode .rmu-glide-name,
body.dark-mode .rmu-glide-num,
body.dark-mode .rmu-status-pill-title {
  color: #F0FAF6 !important;
}
body.dark-mode .kpi .kpi-tag {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #6EE7B7 !important;
}
body.dark-mode .page-banner,
body.dark-mode .cardx,
body.dark-mode .kpi,
body.dark-mode #page-calc .calc-kpi,
body.dark-mode #page-calc .calc-stat,
body.dark-mode #page-calc [style*="border-left"],
body.dark-mode #page-guide .cardx,
body.dark-mode #page-guide [style*="border-top"],
body.dark-mode #page-guide [style*="border-left"] {
  background: rgba(16, 33, 28, 0.88) !important;
  border: 1px solid rgba(110, 231, 183, 0.15) !important;
  color: #E6F4EF !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode textarea {
  background-color: #0B1915 !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  color: #ECF7F3 !important;
}
body.dark-mode .form-control::placeholder {
  color: #6E9186 !important;
}
body.dark-mode .form-select option {
  background-color: #0E1F1A !important;
  color: #ECF7F3 !important;
}
body.dark-mode .input-group-text {
  background-color: #132822 !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  color: #CFE6DE !important;
}
body.dark-mode .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%) !important;
}
body.dark-mode .seg {
  background: rgba(255, 255, 255, 0.06) !important;
}
body.dark-mode .seg button {
  color: #94B5AA !important;
}
body.dark-mode .seg button.on {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
}
body.dark-mode .badge-st,
body.dark-mode .badge-pg {
  background: rgba(16, 44, 36, 0.9) !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  color: #D1FAE5 !important;
}
body.dark-mode .b-chip.status {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6EE7B7 !important;
  border-color: rgba(110, 231, 183, 0.24) !important;
}
body.dark-mode .b-chip.fac,
body.dark-mode .b-chip.date {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #CFE6DE !important;
  border-color: rgba(110, 231, 183, 0.16) !important;
}
body.dark-mode .mob-nav,
body.dark-mode .mobile-bottom-nav {
  background: rgba(12, 26, 22, 0.92) !important;
  border-top: 1px solid rgba(110, 231, 183, 0.15) !important;
}

/* ==========================================================================
   V24: ULTRA-LIGHT MINIMAL ADMIN GUIDE + FULL DARK MODE HOVER & SURFACE AUDIT
   ========================================================================== */

/* 1) Admin Guide (#page-guide): ultra-calm minimal white/neutral (almost no color fill) */
body:not(.dark-mode) #page-guide #guideRoadmap .cardx,
body:not(.dark-mode) #page-guide #guideRoadmap .g-flow-node,
body:not(.dark-mode) #page-guide #guideRoadmap .g-card,
body:not(.dark-mode) #page-guide #guideRoadmap .guide-card,
body:not(.dark-mode) #page-guide #guideRoadmap [style*="background:"] {
  background: #FFFFFF !important;
  border: 1px solid #EAEFEF !important;
  color: #1F2937 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .g-tip,
body:not(.dark-mode) #page-guide #guideRoadmap .alert,
body:not(.dark-mode) #page-guide #guideRoadmap [class*="tip"] {
  background: #FAFCFB !important;
  border: 1px solid #EAEFEF !important;
  color: #4B5563 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .badge,
body:not(.dark-mode) #page-guide #guideRoadmap .chip {
  background: #F6F8F8 !important;
  color: #4B5563 !important;
  border: 1px solid #E5EAE9 !important;
  font-weight: 500 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .bi {
  color: #4B6B62 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .btn-soft,
body:not(.dark-mode) #page-guide #guideRoadmap .btn-sm {
  background: #FFFFFF !important;
  color: #374151 !important;
  border: 1px solid #E2E8E6 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .btn-soft:hover,
body:not(.dark-mode) #page-guide #guideRoadmap .btn-sm:hover {
  background: #F4F7F6 !important;
  border-color: #CBD7D3 !important;
  color: #0B6B53 !important;
}

/* 2) FULL DARK MODE HOVER & SURFACE AUDIT (eliminates ALL white flash bugs!) */
body.dark-mode .table,
body.dark-mode table {
  --bs-table-bg: transparent !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  --bs-table-hover-bg: rgba(16, 185, 129, 0.12) !important;
  --bs-table-hover-color: #F0FAF6 !important;
  --bs-table-active-bg: rgba(16, 185, 129, 0.18) !important;
  --bs-table-active-color: #F0FAF6 !important;
  --bs-table-color: #E6F4EF !important;
  color: #E6F4EF !important;
}
body.dark-mode .table > :not(caption) > * > * {
  background-color: transparent !important;
  color: #E6F4EF !important;
  box-shadow: none !important;
}
body.dark-mode .table-hover > tbody > tr:hover > *,
body.dark-mode .table tbody tr:hover,
body.dark-mode .table tbody tr:hover td,
body.dark-mode .table tbody tr:hover th,
body.dark-mode tbody tr:hover {
  background-color: rgba(16, 185, 129, 0.13) !important;
  color: #F0FAF6 !important;
  --bs-table-accent-bg: rgba(16, 185, 129, 0.13) !important;
  --bs-table-bg-state: rgba(16, 185, 129, 0.13) !important;
}
body.dark-mode .table tbody tr:hover .text-muted,
body.dark-mode .table tbody tr:hover small {
  color: #A7CFC1 !important;
}

/* Dark Mode: Pagination, Dropdowns, List Groups, Code Pills, Cards, Letters, Calendar, SweetAlert */
body.dark-mode .pager button,
body.dark-mode .page-link {
  background: #10241E !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
  color: #CFE6DE !important;
}
body.dark-mode .pager button:hover,
body.dark-mode .page-link:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #FFFFFF !important;
}
body.dark-mode .pager button.on,
body.dark-mode .page-item.active .page-link {
  background: #0E8A72 !important;
  border-color: #0E8A72 !important;
  color: #FFFFFF !important;
}
body.dark-mode .dropdown-menu {
  background: #10241E !important;
  border: 1px solid rgba(110, 231, 183, 0.2) !important;
  color: #E6F4EF !important;
}
body.dark-mode .dropdown-item {
  color: #E6F4EF !important;
}
body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #FFFFFF !important;
}
body.dark-mode .list-group-item {
  background: #10241E !important;
  border-color: rgba(110, 231, 183, 0.14) !important;
  color: #E6F4EF !important;
}
body.dark-mode .list-group-item:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #FFFFFF !important;
}
body.dark-mode .code,
body.dark-mode code {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6EE7B7 !important;
}
body.dark-mode .prov-card:hover,
body.dark-mode .g-item:hover,
body.dark-mode .letter-item:hover,
body.dark-mode .file-row:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(110, 231, 183, 0.3) !important;
}
body.dark-mode .step-card.s1,
body.dark-mode .step-card.s2,
body.dark-mode .step-card.s3 {
  background: rgba(16, 33, 28, 0.92) !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
}
body.dark-mode .step-card .step-upload-box {
  background: rgba(11, 25, 21, 0.85) !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
}
body.dark-mode .swal2-popup {
  background: #10241E !important;
  color: #E6F4EF !important;
  border: 1px solid rgba(110, 231, 183, 0.22) !important;
}
body.dark-mode .swal2-title,
body.dark-mode .swal2-html-container {
  color: #E6F4EF !important;
}
body.dark-mode .bg-white,
body.dark-mode .bg-light {
  background-color: #10241E !important;
  color: #E6F4EF !important;
}

/* ==========================================================================
   V25: SHADCN/UI BADGE WITH INLINE SPINNER (STATUS & PROGRESS BADGES)
   ========================================================================== */
@keyframes rmuUiSpin {
  to { transform: rotate(360deg); }
}
.rmu-ui-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 9999px !important;
  padding: 3px 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
  max-width: 100%;
  transition: background-color 0.16s ease, border-color 0.16s ease !important;
}
.rmu-ui-badge svg {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0 !important;
}
.rmu-ui-badge .rmu-ui-spin {
  animation: rmuUiSpin 0.9s linear infinite !important;
}
/* Variant: success / brand (Completed, Accepted) */
.rmu-ui-badge.v-brand {
  background: #ECF8F4 !important;
  color: #0B6B53 !important;
  border-color: #C5E8DC !important;
}
/* Variant: secondary (In-progress, Waiting — with inline Spinner) */
.rmu-ui-badge.v-secondary {
  background: #F1F5F4 !important;
  color: #1F2937 !important;
  border-color: #DCE5E2 !important;
}
/* Variant: waiting amber-soft (Pending reply — with inline Spinner) */
.rmu-ui-badge.v-pending {
  background: #FFFBEB !important;
  color: #B45309 !important;
  border-color: #FDE68A !important;
}
/* Variant: destructive (Rejected, Returned) */
.rmu-ui-badge.v-destructive {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  border-color: #DC2626 !important;
}
.rmu-ui-badge .b-prefix {
  font-weight: 500;
  opacity: 0.72;
  font-size: 10.8px;
}

/* Dark Mode variants */
body.dark-mode .rmu-ui-badge.v-brand {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6EE7B7 !important;
  border-color: rgba(110, 231, 183, 0.28) !important;
}
body.dark-mode .rmu-ui-badge.v-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #E2F4EE !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
}
body.dark-mode .rmu-ui-badge.v-pending {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #FCD34D !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}
body.dark-mode .rmu-ui-badge.v-destructive {
  background: rgba(220, 38, 38, 0.85) !important;
  color: #FFFFFF !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

/* ==========================================================================
   V26: STUDENT ROLE VISIBILITY FIX (TOUR STEP 4), CLEAN BADGE ALIGNMENT,
        MOBILE LEFT-THUMB ANNOUNCEMENTS, STUDOCS WRAP & NON-OVERLAPPING SEG
   ========================================================================== */

/* #1 Strictly hide admin-only / staff-only controls in Student mode (overrides .d-flex & .btn) */
body.role-student .admin-only,
body.role-student .admin-only.d-flex,
body.role-student .admin-only.btn,
body.role-student .staff-only,
body.role-student .staff-only.d-flex,
body.role-student .staff-only.btn,
body.role-staff .admin-only,
body.role-staff .admin-only.d-flex,
body.role-staff .admin-only.btn {
  display: none !important;
}
/* Fix white-on-white label in Admin studocs toggle pill */
body:not(.dark-mode) .studocs-menu-toggle-pill {
  background: #F4FAF7 !important;
  border: 1px solid #D5E8E2 !important;
  color: #0F2922 !important;
}
body:not(.dark-mode) .studocs-menu-toggle-pill label {
  color: #0F2922 !important;
}

/* #2 Crisp, centered, properly aligned Status Badges on Desktop & Mobile */
.rmu-ui-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  line-height: 1.3 !important;
  vertical-align: middle !important;
  white-space: normal !important;
  word-break: break-word !important;
  text-align: left !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.rmu-ui-badge > span {
  display: inline-block;
  line-height: 1.3;
}
.table td .rmu-ui-badge {
  margin: 2px 2px 2px 0;
}
@media (max-width: 767.98px) {
  .rmu-ui-badge {
    font-size: 10.8px !important;
    padding: 3px 8px !important;
    gap: 4px !important;
  }
  .rmu-ui-badge svg {
    width: 11px !important;
    height: 11px !important;
  }
}

/* #3 Mobile Announcements (#page-announce): keep thumbnail cleanly on the LEFT! */
@media (max-width: 767.98px) {
  .ann-card .ann-flex,
  .ann-card .d-flex.flex-column.flex-md-row,
  #annList .cardx > .d-flex,
  #annList .ann-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .ann-thumb-col {
    flex: 0 0 92px !important;
    width: 92px !important;
    max-width: 92px !important;
    margin: 0 !important;
  }
  .ann-thumb-box {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    margin: 0 !important;
  }
  .ann-thumb-box img,
  .ann-thumb-box canvas {
    width: 100% !important;
    height: auto !important;
    border-radius: 10px !important;
  }
  .ann-card .ann-content,
  .ann-card .flex-grow-1 {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
}

/* #4 Student Docs (#stuDocsList): prevent long filenames from overflowing card box */
#stuDocsList .studoc-row,
#stuDocsList .studoc-item,
#stuDocsList .file-row,
#stuDocsList .cardx > div,
#stuDocsList .d-flex {
  min-width: 0 !important;
  max-width: 100% !important;
}
#stuDocsList .cardx,
#stuDocsList .studoc-item,
#stuDocsList .file-row {
  overflow: hidden !important;
}
#stuDocsList .fw-bold,
#stuDocsList .fw-semibold,
#stuDocsList .studoc-title,
#stuDocsList .text-truncate {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  text-overflow: clip !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
@media (max-width: 767.98px) {
  #stuDocsList .fw-bold,
  #stuDocsList .studoc-title {
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }
}

/* #5 Mobile Provinces (#page-provinces): prevent 3-tab level switcher from overlapping! */
@media (max-width: 767.98px) {
  #page-provinces .seg,
  #segPvLevel {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 14px !important;
  }
  #page-provinces .seg button,
  #segPvLevel button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    border-radius: 10px !important;
  }
  #page-provinces .seg:has(button:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #page-provinces .seg:has(button:nth-child(2):last-child) button {
    flex-direction: row !important;
    font-size: 12px !important;
    padding: 7px 8px !important;
  }
}

/* ==========================================================================
   V27: DESKTOP-STYLE MOBILE ANNOUNCE, GLOWING STEPPER (IMG 1), ALL-GREEN
        ADMIN GUIDE (IMG 2), PASTEL CALC (IMG 3), NEW SHARE SHEET (IMG 4),
        TOGGLE SPACING FIX & TOUR STEP 4 HIDE
   ========================================================================== */

/* #1 Mobile Announcements: exact Desktop horizontal layout (.ann-flex-row) */
@media (max-width: 767.98px) {
  .ann-flex-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .ann-flex-row .ann-thumb-col {
    flex: 0 0 96px !important;
    width: 96px !important;
    max-width: 96px !important;
  }
  .ann-flex-row .ann-thumb-box {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    border-radius: 12px !important;
  }
  .ann-flex-row .ann-content-col {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .ann-flex-row .ann-title-link {
    font-size: 14px !important;
    line-height: 1.38 !important;
  }
}

/* #2 Animated Student Stepper matching Image 1 (crisp circles + spaced connectors + breathing emerald aura) */
@keyframes rmuImg1Aura {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(14, 138, 114, 0.22), 0 0 18px rgba(16, 185, 129, 0.28);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(14, 138, 114, 0.08), 0 0 26px rgba(16, 185, 129, 0.42);
    transform: scale(1.06);
  }
}
.rmu-fb-step-card {
  border-radius: 18px !important;
  padding: 18px 22px 20px !important;
}
.rmu-fb-step-head {
  padding-bottom: 12px !important;
  margin-bottom: 20px !important;
}
.rmu-fb-circle {
  width: 48px !important;
  height: 48px !important;
  border-width: 1.5px !important;
}
.rmu-fb-circle svg {
  width: 21px !important;
  height: 21px !important;
}
.rmu-fb-step:not(:last-child) .rmu-fb-step-row::after {
  left: calc(50% + 30px) !important;
  width: calc(100% - 60px) !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: #D7E1DF !important;
}
.rmu-fb-step.is-done .rmu-fb-circle {
  background: #E3F6F0 !important;
  color: #0B6B53 !important;
  border-color: #BFE8DA !important;
}
.rmu-fb-step.is-cur .rmu-fb-circle {
  background: linear-gradient(135deg, #0E8A72 0%, #095C47 100%) !important;
  color: #FFFFFF !important;
  border-color: #0B6B53 !important;
  animation: rmuImg1Aura 2.2s ease-in-out infinite !important;
}
.rmu-fb-lbl {
  margin-top: 9px !important;
  font-size: 12px !important;
}
@media (max-width: 575.98px) {
  .rmu-fb-circle { width: 34px !important; height: 34px !important; }
  .rmu-fb-circle svg { width: 16px !important; height: 16px !important; }
  .rmu-fb-step:not(:last-child) .rmu-fb-step-row::after {
    left: calc(50% + 21px) !important;
    width: calc(100% - 42px) !important;
    height: 3px !important;
  }
  .rmu-fb-lbl { font-size: 10px !important; }
}

/* #3 Admin Guide (#page-guide) matching Image 2 in 100% pure RMU emerald-mint theme */
body:not(.dark-mode) #page-guide #guideRoadmap .g-flow-node,
body:not(.dark-mode) #page-guide #guideRoadmap .flow-node {
  background: #F4FBF8 !important;
  border: 1px solid #D5ECE3 !important;
  border-radius: 16px !important;
  padding: 14px 15px !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .g-flow-node:hover {
  background: #E8F7F1 !important;
  border-color: #0E8A72 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .cardx,
body:not(.dark-mode) #page-guide #guideRoadmap .g-card {
  background: #FFFFFF !important;
  border: 1px solid #DFEEE8 !important;
  border-radius: 18px !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .g-tip,
body:not(.dark-mode) #page-guide #guideRoadmap [class*="tip"] {
  background: #EDF8F4 !important;
  border: 1px solid #D1EBE1 !important;
  border-radius: 12px !important;
  color: #0B6B53 !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .badge,
body:not(.dark-mode) #page-guide #guideRoadmap .chip {
  background: #E6F6F0 !important;
  color: #0B6B53 !important;
  border: 1px solid #C8E9DD !important;
}
body:not(.dark-mode) #page-guide #guideRoadmap .bi {
  color: #0E8A72 !important;
}

/* #4 Hours Calculator (#page-calc) matching Image 3 with softer rounded 20px pastel cards */
#page-calc .cardx {
  border-radius: 20px !important;
  border: 1px solid #E3EFEA !important;
}
#page-calc .calc-stat-card {
  border-radius: 20px !important;
  padding: 18px 20px !important;
  border: 1px solid transparent !important;
  box-shadow: 0 2px 10px rgba(11, 107, 83, 0.04) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}
#page-calc .calc-stat-card:hover {
  transform: translateY(-2px);
}
body:not(.dark-mode) #page-calc .row > div:nth-child(1) .calc-stat-card {
  background: linear-gradient(135deg, #E8F8F2 0%, #D9F3E9 100%) !important;
  border-color: #C2E9DA !important;
  color: #0B5C47 !important;
}
body:not(.dark-mode) #page-calc .row > div:nth-child(2) .calc-stat-card {
  background: linear-gradient(135deg, #EAF5FF 0%, #DCEEFF 100%) !important;
  border-color: #C5E2FA !important;
  color: #0B4F7A !important;
}
body:not(.dark-mode) #page-calc .row > div:nth-child(3) .calc-stat-card {
  background: linear-gradient(135deg, #FFF7E8 0%, #FDEFD5 100%) !important;
  border-color: #F6DFB8 !important;
  color: #8A4F0B !important;
}
body:not(.dark-mode) #page-calc .row > div:nth-child(4) .calc-stat-card {
  background: linear-gradient(135deg, #EFF5F7 0%, #E3EDF0 100%) !important;
  border-color: #D1E0E5 !important;
  color: #29454E !important;
}
body:not(.dark-mode) #page-calc .calc-stat-card .stat-val {
  color: inherit !important;
  font-weight: 800 !important;
}
body:not(.dark-mode) #page-calc .calc-stat-card .stat-lbl {
  color: inherit !important;
  opacity: 0.78;
}

/* #5 Share Sheet matching Image 4 (4-col brand icon dock + pill chips + URL copy bar) */
.rmu-share-dock-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px 8px !important;
  margin-bottom: 16px !important;
}
.rmu-share-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F6FBF9;
  border: 1px solid #DFECE7;
  border-radius: 12px;
  padding: 5px 6px 5px 12px;
  margin-top: 8px;
}
.rmu-share-url-txt {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmu-share-url-btn {
  flex-shrink: 0;
  border-radius: 9px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: #FFFFFF;
  border: 1px solid #D5E4DF;
  color: #0F2922;
  cursor: pointer;
}
.rmu-share-url-btn:hover {
  background: #EDF6F2;
  border-color: #0E8A72;
  color: #0B6B53;
}
body.dark-mode .rmu-share-url-bar {
  background: rgba(11, 25, 21, 0.85);
  border-color: rgba(110, 231, 183, 0.2);
}
body.dark-mode .rmu-share-url-txt { color: #94B5AA; }
body.dark-mode .rmu-share-url-btn {
  background: #10241E;
  border-color: rgba(110, 231, 183, 0.24);
  color: #E6F4EF;
}
.rmu-share-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #E4F5EE;
  color: #0B6B53;
  font-size: 11.5px;
  font-weight: 600;
}
body.dark-mode .rmu-share-chip {
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
}

/* #6 Clean generous spacing on ALL Toggle Switches (fixes Settings switch hugging text in image_b23374.png!) */
.form-check.form-switch {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding-left: 0 !important;
  margin-bottom: 0;
}
.form-check.form-switch .form-check-input {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  float: none !important;
  flex-shrink: 0 !important;
}
.form-check.form-switch .form-check-label {
  margin: 0 !important;
  line-height: 1.35 !important;
  cursor: pointer;
}

/* #7 Tour Step 4: ALWAYS hide studocs admin toggle pill & upload button during Tour Step 4 */
body.tour-step4-active .studocs-menu-toggle-pill,
body.tour-step4-active #page-studocs .page-banner .admin-only,
body.tour-step4-active #page-studocs .admin-only {
  display: none !important;
}

/* ==========================================================================
   V28: TRUE ALL-GREEN ADMIN GUIDE, MODERN PASTEL CALC & PIXEL-EXACT SHARE SHEET
   ========================================================================== */

/* 1) Admin Guide (#page-guide): 100% RMU Emerald-Mint (targeting REAL classes!) */
#page-guide .guide-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
#page-guide .guide-filter-bar button {
  border-radius: 999px !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  background: #FFFFFF !important;
  color: #374151 !important;
  border: 1px solid #DFECE7 !important;
  box-shadow: 0 1px 2px rgba(11, 107, 83, 0.03) !important;
}
#page-guide .guide-filter-bar button.on,
#page-guide .guide-filter-bar button.active {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
  border-color: #0E8A72 !important;
  font-weight: 600 !important;
}
#page-guide .guide-filter-bar button.on .bi,
#page-guide .guide-filter-bar button.active .bi {
  color: #FFFFFF !important;
}
#page-guide .guide-mod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1199.98px) {
  #page-guide .guide-mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  #page-guide .guide-mod-grid { grid-template-columns: 1fr; }
}
#page-guide .guide-mod-card {
  background: #FFFFFF !important;
  border: 1px solid #DFEEE8 !important;
  border-radius: 18px !important;
  padding: 18px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(11, 107, 83, 0.035) !important;
}
#page-guide .guide-mod-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
#page-guide .guide-mod-ico {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: #E8F6F1 !important;
  color: #0B6B53 !important;
  border: 1px solid #CBE9DF !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  font-size: 1.1rem;
}
#page-guide .guide-mod-ico .bi {
  color: #0B6B53 !important;
}
#page-guide .guide-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#page-guide .guide-sublist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}
#page-guide .guide-sublist li:first-child {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  font-weight: 500;
}
#page-guide .guide-sublist li:first-child b,
#page-guide .guide-sublist li:first-child strong {
  color: #FFFFFF !important;
}
#page-guide .guide-sublist li .num-dot {
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  background: #E8F6F1 !important;
  color: #0B6B53 !important;
  border: 1px solid #C5E8DC !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  margin-top: 1px;
}
#page-guide .guide-sublist li:first-child .num-dot {
  background: #FFFFFF !important;
  color: #0B6B53 !important;
  border-color: #FFFFFF !important;
}
#page-guide .guide-tip-box {
  background: #EDF8F4 !important;
  border: 1px solid #D1EBE1 !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  font-size: 12.2px !important;
  color: #0B5C47 !important;
  line-height: 1.45;
}
#page-guide .guide-tip-box .bi {
  color: #0E8A72 !important;
}
body.dark-mode #page-guide .guide-mod-card {
  background: #10241E !important;
  border-color: rgba(110, 231, 183, 0.16) !important;
}
body.dark-mode #page-guide .guide-sublist li { color: #CFE6DE !important; }
body.dark-mode #page-guide .guide-tip-box {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  color: #A7F3D0 !important;
}

/* 2) Modern Pastel Hours Calculator (#page-calc) matching Gemini_Generated_Image_3z0zvi3z0zvi3z0z.jpg */
#page-calc .calc-ref-card {
  background: #FFFFFF !important;
  border: 1px solid #E1EFEA !important;
  border-radius: 20px !important;
  padding: 18px 20px !important;
  box-shadow: 0 3px 14px rgba(11, 107, 83, 0.04) !important;
}
#page-calc .calc-preset-btn {
  border-radius: 16px !important;
  border: 1px solid #E2EFEA !important;
  background: #F9FCFB !important;
  padding: 12px 15px !important;
  transition: all 0.18s ease !important;
}
#page-calc .calc-preset-btn:hover {
  background: #EFFAF6 !important;
  border-color: #9EE0C9 !important;
  transform: translateY(-1px);
}
#page-calc .calc-preset-btn.active {
  background: linear-gradient(135deg, #E3F7F0 0%, #D5F3E8 100%) !important;
  border: 1.5px solid #0E8A72 !important;
  box-shadow: 0 4px 12px rgba(14, 138, 114, 0.12) !important;
}
#page-calc .calc-preset-hrs {
  border-radius: 999px !important;
  background: #D6F2E7 !important;
  color: #0B6B53 !important;
  font-weight: 700 !important;
  padding: 4px 11px !important;
  font-size: 12px !important;
}
#page-calc .calc-preset-btn.active .calc-preset-hrs {
  background: #0E8A72 !important;
  color: #FFFFFF !important;
}
#page-calc .calc-bi-box {
  background: #F4FBF8 !important;
  border: 1px solid #D7EDE4 !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
}
#page-calc .calc-holiday-badge {
  border-radius: 999px !important;
  background: #E8F7F1 !important;
  color: #0B6B53 !important;
  border: 1px solid #C8E9DD !important;
  padding: 5px 12px !important;
  font-weight: 600 !important;
}
body.dark-mode #page-calc .calc-ref-card,
body.dark-mode #page-calc .calc-preset-btn,
body.dark-mode #page-calc .calc-bi-box {
  background: rgba(16, 36, 30, 0.88) !important;
  border-color: rgba(110, 231, 183, 0.18) !important;
  color: #E6F4EF !important;
}
body.dark-mode #page-calc .calc-preset-btn.active {
  background: rgba(14, 138, 114, 0.28) !important;
  border-color: #34D399 !important;
}

/* 3) Pixel-exact Share Modal matching image_b2a76f.png */
#rmuShareModal .modal-content {
  border-radius: 22px !important;
  border: 1px solid #E3ECE8 !important;
}
#rmuShareModal .rmu-share-tile {
  background: transparent !important;
  border: none !important;
  padding: 6px 4px !important;
}
#rmuShareModal .rmu-share-tile:hover {
  background: #F4FAF7 !important;
  transform: translateY(-2px);
}
#rmuShareModal .rmu-share-ico {
  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;
}
#rmuShareModal .rmu-share-ico svg {
  width: 30px !important;
  height: 30px !important;
}
#rmuShareModal .rmu-share-lbl {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #1F2937 !important;
  margin-top: 2px;
}
body.dark-mode #rmuShareModal .rmu-share-lbl {
  color: #E2F4EE !important;
}

/* ==========================================================================
   V29: CLEAN CALENDAR-ONLY DATE PICKER, SOFT PASTEL ADMIN GUIDE,
        INTERACTIVE ANIMATED CALC HOURS BAR & 100% PIXEL-EXACT SHARE MODAL
   ========================================================================== */

/* #1 Hide stray Thai "ว" text in compact date picker (input.dpk) — ONLY crisp calendar icon */
input[type="date"].dpk {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  flex: 0 0 42px !important;
  padding: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
  text-align: center !important;
  cursor: pointer !important;
  position: relative;
}
input[type="date"].dpk::-webkit-datetime-edit,
input[type="date"].dpk::-webkit-datetime-edit-fields-wrapper,
input[type="date"].dpk::-webkit-datetime-edit-text,
input[type="date"].dpk::-webkit-datetime-edit-month-field,
input[type="date"].dpk::-webkit-datetime-edit-day-field,
input[type="date"].dpk::-webkit-datetime-edit-year-field {
  display: none !important;
}
input[type="date"].dpk::-webkit-calendar-picker-indicator {
  margin: 0 auto !important;
  padding: 6px !important;
  width: 100% !important;
  height: 100% !important;
  background-position: center !important;
  background-size: 16px 16px !important;
  cursor: pointer !important;
  opacity: 0.78;
}
input[type="date"].dpk:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* #2 Admin Guide (#page-guide): ultra-soft pastel accents per card (clean, airy, never loud) */
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+1) {
  background: linear-gradient(180deg, #F5FCF9 0%, #FFFFFF 45%) !important;
  border-color: #D9EFE6 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+2) {
  background: linear-gradient(180deg, #F5FAFF 0%, #FFFFFF 45%) !important;
  border-color: #DCEBF8 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+2) .guide-mod-ico {
  background: #EBF5FE !important; border-color: #D2E8FA !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+2) .guide-mod-ico .bi { color: #0369A1 !important; }

body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+3) {
  background: linear-gradient(180deg, #F6FBF8 0%, #FFFFFF 45%) !important;
  border-color: #D8EDE5 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+4) {
  background: linear-gradient(180deg, #F9F8FE 0%, #FFFFFF 45%) !important;
  border-color: #E6E3F6 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+4) .guide-mod-ico {
  background: #F1EFFB !important; border-color: #DFDBF4 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+4) .guide-mod-ico .bi { color: #6B62A8 !important; }

body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+5) {
  background: linear-gradient(180deg, #FFFBF3 0%, #FFFFFF 45%) !important;
  border-color: #F3E8D2 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+5) .guide-mod-ico {
  background: #FDF4E3 !important; border-color: #F3DFBD !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(5n+5) .guide-mod-ico .bi { color: #B46A0E !important; }

/* #3 Interactive animated motion on Hours Calculator (#page-calc) */
@keyframes rmuCalcPop {
  0% { opacity: 0.4; transform: translateY(6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rmuCalcBarShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
#page-calc .calc-stat-card {
  animation: rmuCalcPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}
#page-calc .calc-stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 26px rgba(11, 107, 83, 0.1) !important;
}
.rmu-calc-prog-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(11, 107, 83, 0.12);
  overflow: hidden;
  margin-top: 10px;
}
.rmu-calc-prog-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B53, #10B981, #34D399, #0E8A72, #0B6B53);
  background-size: 200% 100%;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: rmuCalcBarShimmer 3.2s linear infinite;
}

/* #4 100% Pixel-Exact Share Modal matching image_b2a76f.png */
#rmuShareModal .modal-dialog {
  max-width: 420px !important;
}
#rmuShareModal .modal-content {
  background: #FFFFFF !important;
  border-radius: 24px !important;
  border: 1px solid #E5ECE9 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}
#rmuShareModal .modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid #EEF3F1 !important;
  background: #FFFFFF !important;
}
#rmuShareModal .modal-body {
  padding: 18px 20px 22px !important;
}
#rmuShareModal .rmu-share-preview-card {
  background: #FFFFFF !important;
  border: 1px solid #E2ECE8 !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
  margin-bottom: 18px !important;
}
#rmuShareModal .rmu-share-chip {
  background: #D5F3E6 !important;
  color: #0A684F !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 11px !important;
  border-radius: 999px !important;
}
#rmuShareModal .rmu-share-dock-4 {
  gap: 14px 8px !important;
  margin-bottom: 18px !important;
}
#rmuShareModal .rmu-share-ico {
  width: 56px !important;
  height: 56px !important;
  border-radius: 15px !important;
}
#rmuShareModal .rmu-share-copy-main {
  background: #0E7C66 !important;
  border: none !important;
  color: #FFFFFF !important;
  border-radius: 999px !important;
  padding: 11px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(14, 124, 102, 0.25) !important;
}
#rmuShareModal .rmu-share-copy-main:hover {
  background: #0B6B53 !important;
}
#rmuShareModal .rmu-share-url-bar {
  background: #FFFFFF !important;
  border: 1px solid #DCE7E3 !important;
  border-radius: 12px !important;
  padding: 5px 5px 5px 13px !important;
  margin-top: 10px !important;
}
body.dark-mode #rmuShareModal .modal-content,
body.dark-mode #rmuShareModal .modal-header,
body.dark-mode #rmuShareModal .rmu-share-preview-card,
body.dark-mode #rmuShareModal .rmu-share-url-bar {
  background: #10241E !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
}

/* ==========================================================================
   V30: CRISP UNCLIPPED CALENDAR ICON IN input[type="date"].dpk
   ========================================================================== */
input[type="date"].dpk {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  flex: 0 0 40px !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}
input[type="date"].dpk::-webkit-calendar-picker-indicator {
  width: 18px !important;
  height: 18px !important;
  margin: auto !important;
  padding: 0 !important;
  background-size: 16px 16px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  opacity: 0.85 !important;
  cursor: pointer !important;
}

/* ==========================================================================
   V32: MODERN CHRONOGRAPH TIME-RING & ANIMATED TIME-JOURNEY (#page-calc)
   ========================================================================== */
@keyframes rmuChronoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes rmuChronoArc {
  from { stroke-dashoffset: 188.5; }
  to { stroke-dashoffset: var(--ring-off, 0); }
}
@keyframes rmuTimeTravel {
  0% { left: 4%; opacity: 0.25; transform: translate(-50%, -50%) scale(0.85); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { left: 96%; opacity: 0.25; transform: translate(-50%, -50%) scale(0.85); }
}
@keyframes rmuClockTick {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

/* Chronograph Hours Card Layout */
.rmu-chrono-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rmu-chrono-ring {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rmu-chrono-ring svg {
  width: 68px;
  height: 68px;
  overflow: visible;
}
.rmu-chrono-ticks {
  transform-origin: 36px 36px;
  animation: rmuChronoSpin 32s linear infinite;
}
.rmu-chrono-arc {
  transform: rotate(-90deg);
  transform-origin: 36px 36px;
  stroke-dasharray: 188.5;
  stroke-dashoffset: var(--ring-off, 0);
  animation: rmuChronoArc 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.rmu-chrono-pct {
  position: absolute;
  font-size: 12px;
  font-weight: 800;
  color: #0B6B53;
  font-variant-numeric: tabular-nums;
}
body.dark-mode .rmu-chrono-pct { color: #6EE7B7; }

/* Animated Time-Journey Strip (Start Date -> Traveling Pulse -> End Date) */
.rmu-time-journey {
  background: linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(236,248,244,0.88) 100%);
  border: 1px solid #D5ECE3;
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(11, 107, 83, 0.045);
}
body.dark-mode .rmu-time-journey {
  background: linear-gradient(135deg, rgba(16, 36, 30, 0.92) 0%, rgba(12, 28, 24, 0.94) 100%);
  border-color: rgba(110, 231, 183, 0.18);
}
.rmu-tj-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.rmu-tj-node {
  display: flex;
  align-items: center;
  gap: 9px;
}
.rmu-tj-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #E4F6EF;
  color: #0B6B53;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.rmu-tj-ico.is-end {
  background: #0E8A72;
  color: #FFFFFF;
}
.rmu-tj-k {
  font-size: 10.8px;
  color: #64748B;
  font-weight: 500;
}
.rmu-tj-v {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F2922;
}
body.dark-mode .rmu-tj-v { color: #ECF7F3; }
body.dark-mode .rmu-tj-k { color: #94B5AA; }
body.dark-mode .rmu-tj-ico { background: rgba(16,185,129,0.18); color: #6EE7B7; }

.rmu-tj-rail-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}
.rmu-tj-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #CBE8DD;
  color: #0B6B53;
  font-size: 11.8px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(11, 107, 83, 0.06);
}
.rmu-tj-pill .bi-clock {
  animation: rmuClockTick 2s ease-in-out infinite;
}
body.dark-mode .rmu-tj-pill {
  background: #0E221C;
  border-color: rgba(110, 231, 183, 0.25);
  color: #6EE7B7;
}
.rmu-tj-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #A7F3D0 0%, #10B981 50%, #0B6B53 100%);
  overflow: visible;
}
.rmu-tj-runner {
  position: absolute;
  top: 50%;
  left: 4%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.32), 0 0 12px rgba(16, 185, 129, 0.55);
  animation: rmuTimeTravel 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@media (max-width: 767.98px) {
  .rmu-tj-row { grid-template-columns: 1fr; gap: 10px; }
  .rmu-tj-rail-wrap { order: 3; width: 100%; }
}

/* ==========================================================================
   V33: SLEEK ANIMATED FLOWING SIDE HIGHLIGHT BAR ON #page-calc STAT CARDS
   ========================================================================== */
@keyframes rmuSideGlowFlow {
  0% { background-position: 50% 0%; }
  100% { background-position: 50% 200%; }
}
#page-calc .calc-stat-card {
  position: relative !important;
  overflow: hidden !important;
  padding-left: 22px !important;
}
#page-calc .calc-stat-card::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 4.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0B6B53, #34D399, #10B981, #0E8A72, #0B6B53);
  background-size: 100% 200%;
  animation: rmuSideGlowFlow 2.8s linear infinite;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}
#page-calc .row > div:nth-child(2) .calc-stat-card::before {
  background: linear-gradient(180deg, #0369A1, #38BDF8, #0EA5E9, #0284C7, #0369A1);
  background-size: 100% 200%;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.32);
}
#page-calc .row > div:nth-child(3) .calc-stat-card::before {
  background: linear-gradient(180deg, #B45309, #FBBF24, #F59E0B, #D97706, #B45309);
  background-size: 100% 200%;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.32);
}
#page-calc .row > div:nth-child(4) .calc-stat-card::before {
  background: linear-gradient(180deg, #0F766E, #5EEAD4, #14B8A6, #0D9488, #0F766E);
  background-size: 100% 200%;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.32);
}

/* ==========================================================================
   V34: CLEAN WHITE CALC CARDS + ANIMATED HIGHLIGHT CURVING ALONG LEFT EDGE
   ========================================================================== */
body:not(.dark-mode) #page-calc .row > div:nth-child(n) .calc-stat-card {
  background: #FFFFFF !important;
  border: 1px solid #E4EFEA !important;
  border-radius: 20px !important;
  color: #0F2922 !important;
  padding-left: 20px !important;
}
body.dark-mode #page-calc .row > div:nth-child(n) .calc-stat-card {
  background: #10241E !important;
  border: 1px solid rgba(110, 231, 183, 0.16) !important;
  border-radius: 20px !important;
}
#page-calc .calc-stat-card::before {
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 5px !important;
  border-radius: 20px 0 0 20px !important;
}

/* ==========================================================================
   V35: CLEAN BOOK-PAGE ADMIN GUIDE WITH ANIMATED CURVED LEFT SPINE HIGHLIGHT
   ========================================================================== */
body:not(.dark-mode) #page-guide .guide-mod-card,
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(n) {
  background: #FFFFFF !important;
  border: 1px solid #E4EFEA !important;
  border-radius: 18px !important;
  padding: 20px 20px 18px 24px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 3px 14px rgba(11, 107, 83, 0.04) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
body:not(.dark-mode) #page-guide .guide-mod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11, 107, 83, 0.08) !important;
}
body.dark-mode #page-guide .guide-mod-card {
  background: #10241E !important;
  border: 1px solid rgba(110, 231, 183, 0.16) !important;
  border-radius: 18px !important;
  padding: 20px 20px 18px 24px !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Animated curved book-spine left highlight (matching Hours Calculator cards!) */
#page-guide .guide-mod-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #0B6B53, #34D399, #10B981, #0E8A72, #0B6B53);
  background-size: 100% 200%;
  animation: rmuSideGlowFlow 3.2s linear infinite;
}
#page-guide .guide-mod-card:nth-child(4n+2)::before {
  background: linear-gradient(180deg, #0F766E, #5EEAD4, #14B8A6, #0D9488, #0F766E);
  background-size: 100% 200%;
}
#page-guide .guide-mod-card:nth-child(4n+3)::before {
  background: linear-gradient(180deg, #0369A1, #38BDF8, #0EA5E9, #0284C7, #0369A1);
  background-size: 100% 200%;
}
#page-guide .guide-mod-card:nth-child(4n+4)::before {
  background: linear-gradient(180deg, #047857, #6EE7B7, #10B981, #059669, #047857);
  background-size: 100% 200%;
}

/* Clean uniform book-reading list (remove loud solid green block on 1st item) */
#page-guide .guide-sublist li:first-child {
  background: transparent !important;
  color: #334155 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-weight: 400 !important;
}
#page-guide .guide-sublist li:first-child b,
#page-guide .guide-sublist li:first-child strong {
  color: #0F2922 !important;
}
#page-guide .guide-sublist li:first-child .num-dot {
  background: #E8F6F1 !important;
  color: #0B6B53 !important;
  border: 1px solid #C5E8DC !important;
}
body.dark-mode #page-guide .guide-sublist li:first-child {
  color: #CFE6DE !important;
}
body.dark-mode #page-guide .guide-sublist li:first-child b,
body.dark-mode #page-guide .guide-sublist li:first-child strong {
  color: #ECF7F3 !important;
}
body:not(.dark-mode) #page-guide .guide-tip-box {
  background: #F8FCFA !important;
  border: 1px solid #E4EFEA !important;
  border-radius: 12px !important;
  color: #334155 !important;
}
body:not(.dark-mode) #page-guide .guide-mod-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #EFF5F2;
}
body.dark-mode #page-guide .guide-mod-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(110, 231, 183, 0.12);
}

/* ==========================================================================
   V36: APPLE-STYLE WHITE MINIMAL ICONS (ADMIN GUIDE) + ANIMATED AVATAR RING
   ========================================================================== */

/* 1) Apple-style crisp pure white icons with hairline borders on Admin Guide (#page-guide) */
body:not(.dark-mode) #page-guide .guide-mod-ico,
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(n) .guide-mod-ico {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  color: #1F2937 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}
body:not(.dark-mode) #page-guide .guide-mod-ico .bi,
body:not(.dark-mode) #page-guide .guide-mod-card:nth-child(n) .guide-mod-ico .bi {
  color: #1F2937 !important;
}
body:not(.dark-mode) #page-guide .guide-sublist li .num-dot,
body:not(.dark-mode) #page-guide .guide-sublist li:first-child .num-dot {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
body:not(.dark-mode) #page-guide .badge,
body:not(.dark-mode) #page-guide .chip {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  color: #4B5563 !important;
}
body.dark-mode #page-guide .guide-mod-ico,
body.dark-mode #page-guide .guide-sublist li .num-dot {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #E2F4EE !important;
}
body.dark-mode #page-guide .guide-mod-ico .bi {
  color: #E2F4EE !important;
}

/* 2) Animated flowing gradient ring around Developer/Admin circular profile avatar */
@keyframes rmuAvatarRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.rmu-avatar-flow-ring {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(14, 138, 114, 0.22);
}
.rmu-avatar-flow-ring::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    #0B6B53 0deg,
    #34D399 75deg,
    #5EEAD4 140deg,
    #0E8A72 215deg,
    #10B981 290deg,
    #0B6B53 360deg
  );
  animation: rmuAvatarRingSpin 3.4s linear infinite;
  z-index: 0;
}
.rmu-avatar-flow-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--mint-soft, #EDF8F4);
  border: 2.5px solid #FFFFFF;
  display: grid;
  place-items: center;
}
body.dark-mode .rmu-avatar-flow-inner {
  background: #10241E;
  border-color: #10241E;
}

/* ==========================================================================
   V38: CLEAN FLAT BUTTON SYSTEM (EXACT SPEC) + MOBILE STUDOCS 2-ROW LAYOUT
   ========================================================================== */

/* 1) Clean Flat Button System (height 36px, radius 8px, zero heavy shadows) */
.btn {
  font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  min-height: 36px;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
.btn-sm {
  min-height: 34px !important;
  height: auto !important;
  padding: 5px 13px !important;
  font-size: 13px !important;
}
.btn-xs {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

/* Primary: flat teal #0F766E (hover #115E59), zero shadow */
body:not(.dark-mode) .btn-main,
body:not(.dark-mode) .btn-primary {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body:not(.dark-mode) .btn-main:hover,
body:not(.dark-mode) .btn-primary:hover {
  background: #115E59 !important;
  color: #FFFFFF !important;
  transform: none !important;
}

/* Soft Tinted: #F0FDF4 / #0F766E / #BBF7D0 */
body:not(.dark-mode) .btn-outline-success,
body:not(.dark-mode) .btn-dl-xlsx,
body:not(.dark-mode) .btn-step1-soft {
  background: #F0FDF4 !important;
  color: #0F766E !important;
  border-color: #BBF7D0 !important;
}
body:not(.dark-mode) .btn-outline-success:hover,
body:not(.dark-mode) .btn-dl-xlsx:hover,
body:not(.dark-mode) .btn-step1-soft:hover {
  background: #DCFCE7 !important;
  color: #0F766E !important;
  border-color: #86EFAC !important;
}

/* Clean Outline: #FFFFFF / #334155 / #E2E8F0 */
body:not(.dark-mode) .btn-soft,
body:not(.dark-mode) .btn-outline-secondary {
  background: #FFFFFF !important;
  color: #334155 !important;
  border-color: #E2E8F0 !important;
  border-radius: 8px !important;
}
body:not(.dark-mode) .btn-soft:hover,
body:not(.dark-mode) .btn-outline-secondary:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

/* Muted Danger: #FFFFFF / #DC2626 / #FEE2E2 */
body:not(.dark-mode) .btn-outline-danger {
  background: #FFFFFF !important;
  color: #DC2626 !important;
  border-color: #FEE2E2 !important;
}
body:not(.dark-mode) .btn-outline-danger:hover {
  background: #FEF2F2 !important;
  border-color: #FECACA !important;
  color: #B91C1C !important;
}

/* Filter Pills (32px height, 999px radius) */
.btn.rounded-pill,
.seg button,
#page-guide .guide-filter-bar button {
  border-radius: 999px !important;
  min-height: 32px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}
body:not(.dark-mode) .seg button.on,
body:not(.dark-mode) #page-guide .guide-filter-bar button.on {
  background: #0F766E !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

/* Table & Card Actions: never squish text buttons; icon-only naturally stays ~32px */
.table .btn-xs,
.card-t .btn-xs,
.ann-content-col .btn-xs,
.studoc-card-item .btn-xs {
  width: auto !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 9px !important;
  border-radius: 7px !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1 !important;
}
.btn-icon {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 7px !important;
}

/* Dark Mode Button System Harmony */
body.dark-mode .btn-main,
body.dark-mode .btn-primary {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body.dark-mode .btn-main:hover { background: #14B8A6 !important; color: #06211B !important; }
body.dark-mode .btn-soft {
  background: rgba(16, 36, 30, 0.9) !important;
  color: #E2F4EE !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  border-radius: 8px !important;
}
body.dark-mode .btn-outline-danger {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #FCA5A5 !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
}

/* 2) Mobile Student Docs (#stuDocsList .studoc-card-item): clean 2-row card!
      Row 1: [60px thumb] + [full-width readable filename & meta]
      Row 2: [Download] [Edit] [Toggle] [Delete] neatly aligned across bottom */
@media (max-width: 767.98px) {
  #stuDocsList .studoc-card-item {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px !important;
  }
  #stuDocsList .studoc-card-item > .studoc-preview-thumb {
    flex: 0 0 56px !important;
    width: 56px !important;
    height: 56px !important;
  }
  #stuDocsList .studoc-card-item > .flex-grow-1 {
    flex: 1 1 calc(100% - 76px) !important;
    min-width: 0 !important;
    max-width: calc(100% - 76px) !important;
  }
  #stuDocsList .studoc-card-item > .flex-grow-1 .fw-bold {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
  #stuDocsList .studoc-card-item > :last-child:not(.flex-grow-1) {
    flex: 1 0 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding-top: 10px !important;
    margin-top: 2px !important;
    border-top: 1px solid var(--line, #EDF2F0) !important;
  }
  #stuDocsList .studoc-card-item > :last-child .btn-main {
    margin-right: auto !important;
  }
}

/* Zero horizontal scroll & crisp touch smoothness */
html, body {
  overflow-x: clip;
}

/* ==========================================================================
   V39: MODERN TOP NAVBAR + PROFILE FLOW RING + COMPARE CLEAN CHIPS + STEP 3 1-ROW FIT
   ========================================================================== */

/* 1) Modern Top Navbar (Glassmorphism + Crisp 38px Icon Buttons + Clean Profile Pill)
      Preserves original RMU deep-emerald left sidebar */
.app-topbar {
  height: 64px !important;
  padding: 0 20px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid #E2E8F0 !important;
  box-shadow: none !important;
}
body.dark-mode .app-topbar {
  background: rgba(8, 22, 18, 0.86) !important;
  border-bottom: 1px solid rgba(110, 231, 183, 0.14) !important;
}
.app-topbar .crumb-bar {
  font-size: 13.5px !important;
  gap: 8px !important;
  color: #64748B !important;
}
.app-topbar .crumb-bar .c-cur {
  color: #0F172A !important;
  font-weight: 600 !important;
}
body.dark-mode .app-topbar .crumb-bar {
  color: #94A3B8 !important;
}
body.dark-mode .app-topbar .crumb-bar .c-cur {
  color: #E2F4EE !important;
}
.app-topbar .theme-btn,
.app-topbar .topbar-left > .btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
  color: #64748B !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
.app-topbar .theme-btn:hover,
.app-topbar .topbar-left > .btn:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  transform: none !important;
}
body.dark-mode .app-topbar .theme-btn,
body.dark-mode .app-topbar .topbar-left > .btn {
  background: rgba(16, 36, 30, 0.9) !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
  color: #CBD5E1 !important;
}
body.dark-mode .app-topbar .theme-btn:hover,
body.dark-mode .app-topbar .topbar-left > .btn:hover {
  background: rgba(20, 48, 40, 0.95) !important;
  border-color: rgba(110, 231, 183, 0.38) !important;
  color: #FFFFFF !important;
}
.app-topbar .user-pill {
  height: 40px !important;
  padding: 4px 12px 4px 5px !important;
  border-radius: 999px !important;
  border: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
  box-shadow: none !important;
  gap: 9px !important;
  transition: background-color 0.15s ease, border-color 0.15s ease !important;
}
.app-topbar .user-pill:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  transform: none !important;
}
.app-topbar .user-pill .user-avatar {
  width: 30px !important;
  height: 30px !important;
}
.app-topbar .user-pill .user-info b {
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: #0F172A !important;
}
.app-topbar .user-pill .user-info small {
  font-size: 11px !important;
  color: #64748B !important;
}
body.dark-mode .app-topbar .user-pill {
  background: rgba(16, 36, 30, 0.9) !important;
  border-color: rgba(110, 231, 183, 0.2) !important;
}
body.dark-mode .app-topbar .user-pill:hover {
  background: rgba(20, 48, 40, 0.95) !important;
  border-color: rgba(110, 231, 183, 0.38) !important;
}
body.dark-mode .app-topbar .user-pill .user-info b {
  color: #F1F5F9 !important;
}
body.dark-mode .app-topbar .user-pill .user-info small {
  color: #94A3B8 !important;
}

/* 2) #profileModal Animated Flowing Circular Avatar Ring */
#profileModal .rmu-avatar-flow-ring {
  width: 104px !important;
  height: 104px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 3) Compare Page Filter Panel: Clean Top Alignment + Flat V38 Pill System */
#page-compare .cmp-filter-panel {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
}
body.dark-mode #page-compare .cmp-filter-panel {
  background: rgba(13, 30, 25, 0.72) !important;
  border-color: rgba(110, 231, 183, 0.16) !important;
}
#page-compare .cmp-filter-panel .form-label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1E293B !important;
}
body.dark-mode #page-compare .cmp-filter-panel .form-label {
  color: #E2F4EE !important;
}
#page-compare .cmp-filter-panel .form-select-sm {
  min-height: 36px !important;
  border-radius: 8px !important;
  border-color: #E2E8F0 !important;
  font-size: 13px !important;
}
#page-compare #cmpYearChecks {
  gap: 8px !important;
  margin-top: 6px !important;
}
#page-compare .cmp-check-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 32px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  background: #FFFFFF !important;
  color: #334155 !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
#page-compare .cmp-check-pill:hover {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  transform: none !important;
}
#page-compare .cmp-check-pill.active {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: #0F766E !important;
  box-shadow: none !important;
}
#page-compare .cmp-check-pill.active:hover {
  background: #115E59 !important;
  border-color: #115E59 !important;
}
body.dark-mode #page-compare .cmp-check-pill {
  background: rgba(16, 36, 30, 0.9) !important;
  color: #CBD5E1 !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
}
body.dark-mode #page-compare .cmp-check-pill.active {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: #14B8A6 !important;
}

#page-compare #cmpItemChecks {
  gap: 7px !important;
  margin-top: 6px !important;
}
#page-compare .cmp-item-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 30px !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  font-size: 12.2px !important;
  font-weight: 500 !important;
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  line-height: 1.3 !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
#page-compare .cmp-item-chip:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  transform: none !important;
}
#page-compare .cmp-item-chip.active {
  background: #F0FDF4 !important;
  color: #0F766E !important;
  border-color: #86EFAC !important;
  box-shadow: none !important;
}
body.dark-mode #page-compare .cmp-item-chip {
  background: rgba(16, 36, 30, 0.85) !important;
  color: #94A3B8 !important;
  border-color: rgba(110, 231, 183, 0.18) !important;
}
body.dark-mode #page-compare .cmp-item-chip.active {
  background: rgba(15, 118, 110, 0.26) !important;
  color: #5EEAD4 !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
}

/* 4) Step 1/2/3 Official Letter & Envelope Button Rows: 1 Clean Horizontal Row on Desktop */
.step-card .btn-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
}
.step-card .btn-group > .btn {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 8px !important;
  font-size: 11.8px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  border-radius: 8px !important;
  margin-left: 0 !important;
}
.step-card .btn-group > .btn[onclick*="shareDocStep"] {
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  padding: 0 !important;
}

/* 5) Responsive Spacing & Text Fit on Mobile & Narrow Tablets */
@media (max-width: 767.98px) {
  .app-topbar {
    height: 58px !important;
    padding: 0 12px !important;
  }
  .app-topbar .crumb-bar {
    font-size: 13px !important;
    max-width: 56vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .step-card .btn-group {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .step-card .btn-group > .btn {
    flex: 1 1 calc(50% - 6px) !important;
    font-size: 12px !important;
    padding: 0 8px !important;
  }
  .step-card .btn-group > .btn[onclick*="shareDocStep"] {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
  #page-compare .cmp-filter-panel {
    padding: 14px !important;
  }
  #page-compare .cmp-check-pill {
    font-size: 12px !important;
    padding: 0 10px !important;
    height: 30px !important;
  }
  #page-compare .cmp-item-chip {
    font-size: 11.5px !important;
    padding: 4px 10px !important;
    max-width: 100%;
    white-space: normal !important;
    text-align: left;
  }
}

/* ==========================================================================
   V40: PRECISION BUTTON CENTERING & SNUG FIT + CIRCLE THEME TOGGLE +
        MOBILE COMPARE/PROVINCES/INCOMPLETE/EYE-BUTTON/BADGE POLISH
   ========================================================================== */

/* 1) Circular Dark/Light Mode Toggle Button (38x38px circle, dead-center icon) */
.app-topbar .theme-btn {
  border-radius: 50% !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.app-topbar .theme-btn .theme-icon-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* 2) Snug, Dead-Center Buttons Everywhere (no oversized padding or vertical bloat) */
.btn {
  min-height: 34px !important;
  height: auto !important;
  padding: 6px 13px !important;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 6px !important;
}
.btn > i,
.btn > .bi,
.btn > svg {
  flex-shrink: 0 !important;
  line-height: 1 !important;
}
.btn-sm {
  min-height: 32px !important;
  padding: 5px 12px !important;
  font-size: 12.8px !important;
}
.btn-xs {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

/* 3) Admin Guide Filter Pills: White Icon on Active Pill + Perfect Centering */
#page-guide .guide-filter-bar button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-height: 32px !important;
  height: auto !important;
  padding: 5px 13px !important;
  font-size: 12.5px !important;
  line-height: 1.25 !important;
  border-radius: 999px !important;
}
#page-guide .guide-filter-bar button.on,
#page-guide .guide-filter-bar button.active {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: #0F766E !important;
  box-shadow: none !important;
}
#page-guide .guide-filter-bar button.on i,
#page-guide .guide-filter-bar button.active i,
#page-guide .guide-filter-bar button.on .bi,
#page-guide .guide-filter-bar button.active .bi {
  color: #FFFFFF !important;
}

/* 4) Table Status & Progress Badges (.rmu-ui-badge): Strictly Single-Line, Never Wrap */
.rmu-ui-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  width: max-content !important;
  max-width: none !important;
  line-height: 1.2 !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}
.rmu-ui-badge > span {
  white-space: nowrap !important;
}
.rmu-ui-badge > svg {
  flex-shrink: 0 !important;
}

/* 5) Password Visibility Eye Button & All .input-group Controls:
      Strictly Single Horizontal Row on BOTH Desktop & Mobile (never drops below input!) */
.input-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
}
.input-group > .form-control,
.input-group > .form-select {
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 0 !important;
}
.input-group > .input-group-text {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap !important;
}
.input-group > .btn {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 38px !important;
  height: auto !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  border-radius: 0 8px 8px 0 !important;
}
.input-group > .form-control:not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.input-group > .btn[onclick*="togglePwVis"] {
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-color: #E2E8F0 !important;
  border-left: 0 !important;
}
body.dark-mode .input-group > .btn[onclick*="togglePwVis"] {
  border-color: rgba(110, 231, 183, 0.22) !important;
}

/* 6) Desktop & General Segmented Controls (.seg): Crisp, Snug, Centered */
.seg {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 3px !important;
  border-radius: 999px !important;
}
.seg button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 5px !important;
  min-height: 30px !important;
  height: auto !important;
  padding: 5px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.25 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}
.seg button i,
.seg button .bi {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* 7) Mobile Precision Polish (<= 767.98px):
      Compare, Provinces, Incomplete, Modals & All Capsules Fit Snugly Inside Frame */
@media (max-width: 767.98px) {
  .seg {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    padding: 3px !important;
    border-radius: 14px !important;
    gap: 3px !important;
  }
  .seg button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 6px 6px !important;
    min-height: 34px !important;
    font-size: 11.4px !important;
    line-height: 1.25 !important;
    border-radius: 11px !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }
  #segCmpChartType button {
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
    gap: 3px !important;
  }
  #segPvLevel button {
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
  }

  #page-compare .dash-ctrl-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #page-compare .dash-ctrl-bar > *,
  #page-compare .dash-ctrl-bar .ms-auto {
    width: 100% !important;
    margin-left: 0 !important;
  }
  #page-compare #cmpHistMode {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 12.5px !important;
  }
  #page-compare #cmpVisWrap,
  #page-compare #cmpVisWrap .dropdown,
  #page-compare #cmpVisWrap .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  #page-provinces .dash-ctrl-bar > .ms-auto,
  #page-provinces .d-flex.ms-auto {
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
  }
  #page-provinces #segPvChartLimit {
    flex: 1 1 auto !important;
    width: auto !important;
  }
  #page-provinces #segPvChartLimit button {
    white-space: nowrap !important;
    font-size: 11.5px !important;
    padding: 6px 8px !important;
  }
  #page-provinces #sortBtn_pv {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
  }
  #pvFilterCard input.form-control,
  #pvFilterCard .form-select {
    width: 100% !important;
    max-width: 100% !important;
  }

  #page-incomplete .seg button {
    font-size: 11.3px !important;
    padding: 7px 6px !important;
  }

  .modal .btn,
  .cardx .btn {
    font-size: 12.5px !important;
    padding: 6px 11px !important;
    line-height: 1.3 !important;
  }
}

/* ==========================================================================
   V41: FULL-FRAME STUDENT TABLES (DESKTOP + MOBILE ZERO CLIPPING) +
        FILTER/SEARCH GAP + COMPARE BASELINE ALIGN + '+ เพิ่มคิว' NOWRAP +
        LETTERS STEP 1/2/3 ZERO-OVERFLOW 1-ROW FIT
   ========================================================================== */

/* 1) Short Action Buttons (e.g. '+ เพิ่มคิว'): Never Wrap to 2 Lines */
.btn-xs,
button[onclick*="openCalendarEventModal"] {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* 2) Mobile Filter Toggle & Search Bar Breathing Room */
@media (max-width: 991.98px) {
  .mobile-filter-toggle-btn {
    margin-bottom: 10px !important;
  }
}

/* 3) Compare Filter Panel: Exact Baseline Alignment Between Section 1 & Section 2
      + Clean Visual Divider Above Section 3 */
#page-compare .cmp-filter-panel .col-md-5 > .form-label {
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}
#page-compare .cmp-filter-panel .col-md-7 > .d-flex {
  min-height: 30px !important;
  margin-bottom: 8px !important;
}
#page-compare .cmp-filter-panel #cmpYearChecks {
  margin-top: 0 !important;
}
#page-compare #cmpItemWrap {
  border-top: 1px solid #E2E8F0 !important;
  padding-top: 14px !important;
  margin-top: 14px !important;
}
body.dark-mode #page-compare #cmpItemWrap {
  border-top-color: rgba(110, 231, 183, 0.16) !important;
}

/* 4) Desktop Student Tables (.table-fit-window): Zero Mid-Word Breaks & Zero Badge Clipping */
@media (min-width: 992px) {
  .table-fit-window {
    table-layout: auto !important;
    width: 100% !important;
  }
  .table-fit-window th,
  .table-fit-window td {
    padding: 9px 7px !important;
    vertical-align: middle !important;
  }
  .table-fit-window thead th {
    white-space: nowrap !important;
    font-size: 12px !important;
  }
  /* Keep ID, Gender, Year, Academic Year, Progress & Status cleanly single-line */
  .table-fit-window td:nth-child(1),
  .table-fit-window td:nth-child(2),
  .table-fit-window td:nth-child(4),
  .table-fit-window td:nth-child(6),
  .table-fit-window td:nth-child(7),
  .table-fit-window td:nth-child(10),
  .table-fit-window td:nth-child(11) {
    white-space: nowrap !important;
  }
  .table-fit-window .rmu-ui-badge {
    font-size: 11.2px !important;
    padding: 3px 8px !important;
    gap: 4px !important;
  }
}

/* 5) Mobile Student Tables (#dListCard, #listTableCard):
      Show FULL Status/Progress Badges Inside Card Frame Without Clipping! */
@media (max-width: 991.98px) {
  #dListCard table.tablex,
  #listTableCard table.tablex {
    table-layout: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #dListCard table.tablex th:first-child,
  #dListCard table.tablex td:first-child,
  #listTableCard table.tablex th:first-child,
  #listTableCard table.tablex td:first-child {
    width: 24px !important;
    min-width: 24px !important;
    padding: 8px 4px !important;
    text-align: center !important;
    font-size: 11.5px !important;
  }
  #dListCard table.tablex td:nth-child(2),
  #listTableCard table.tablex td:nth-child(2) {
    padding: 8px 6px !important;
    min-width: 0 !important;
    word-break: break-word !important;
    font-size: 12px !important;
  }
  #dListCard table.tablex th:last-child,
  #dListCard table.tablex td:last-child,
  #listTableCard table.tablex th:last-child,
  #listTableCard table.tablex td:last-child {
    width: 1% !important;
    white-space: nowrap !important;
    padding: 8px 6px 8px 4px !important;
    text-align: right !important;
  }
  #dListCard table.tablex .rmu-ui-badge,
  #listTableCard table.tablex .rmu-ui-badge {
    font-size: 10.4px !important;
    padding: 3px 7px !important;
    gap: 3px !important;
  }
  #dListCard table.tablex .rmu-ui-badge svg,
  #listTableCard table.tablex .rmu-ui-badge svg {
    width: 11px !important;
    height: 11px !important;
  }
}

/* 6) Official Letters Page (#page-letters) Step 1, 2, 3 Cards:
      Compact 1-Row Buttons That NEVER Overflow or Collide Inside Card Border */
.step-card {
  overflow: hidden !important;
}
.step-card .row > [class*="col-"] {
  min-width: 0 !important;
}
.step-card .btn-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: 100% !important;
}
.step-card .btn-group > .btn {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 5px !important;
  font-size: 10.8px !important;
  font-weight: 500 !important;
  gap: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  border-radius: 7px !important;
}
.step-card .btn-group > .btn i,
.step-card .btn-group > .btn .bi {
  font-size: 11px !important;
  margin-right: 1px !important;
}
.step-card .btn-group > .btn[onclick*="shareDocStep"] {
  flex: 0 0 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  padding: 0 !important;
}
/* On narrow laptops / tablets (< 1280px), wrap cleanly into 2-per-row instead of clipping */
@media (max-width: 1279.98px) {
  .step-card .btn-group {
    flex-wrap: wrap !important;
    gap: 5px !important;
  }
  .step-card .btn-group > .btn {
    flex: 1 1 calc(50% - 4px) !important;
    font-size: 11.5px !important;
    padding: 0 8px !important;
  }
  .step-card .btn-group > .btn[onclick*="shareDocStep"] {
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
  }
}

/* ==========================================================================
   V42: PILL HISTORY BADGE + LETTERS STEP 1/2 2-ROW + MOBILE OVERFLOW FIXES
        (CALENDAR, INCOMPLETE, LETTERS, SECURITY MODAL, TPL UPLOAD)
   ========================================================================== */

/* 1) History / Rejected Badge (.badge-grp-hist): Sleek Rounded Pill, Single Line */
.badge-grp-hist {
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
}
.inc-name-link:hover {
  text-decoration: underline !important;
}

/* 2) Official Letters (#page-letters):
      - Step 1 & Step 2 (half-width cards): clean 2-row button layout so ZERO clipping!
      - Long download/save buttons (.d-grid .btn): allow clean wrapping so text never clips! */
#page-letters .col-md-6 > .step-card .btn-group {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  width: 100% !important;
}
#page-letters .col-md-6 > .step-card .btn-group > .btn {
  flex: 1 1 calc(50% - 4px) !important;
  min-width: 0 !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
}
#page-letters .col-md-6 > .step-card .btn-group > .btn[onclick*="shareDocStep"] {
  flex: 0 0 36px !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
}
#page-letters .step-card .d-grid .btn {
  white-space: normal !important;
  height: auto !important;
  min-height: 34px !important;
  padding: 6px 10px !important;
  line-height: 1.3 !important;
  text-align: center !important;
}

/* 3) Security Modal (#securityModal): Crisp Desktop Alignment & Compact Mobile Controls */
#securityModal .row {
  align-items: flex-end;
}
#securityModal .form-label {
  font-size: 12.5px !important;
  margin-bottom: 5px !important;
  line-height: 1.35 !important;
}
#securityModal .input-group > .btn[onclick*="copyLineCallbackUrl"],
#securityModal .input-group > .btn[onclick*="copyTextField"] {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 38px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}
#secLineCard .d-flex.justify-content-end,
#secStaffConfigCard .d-flex.flex-wrap {
  gap: 8px !important;
}

/* 4) Mobile Precision Fixes (<= 991.98px) */
@media (max-width: 991.98px) {
  /* 4a) History badge & status badges fit 100% inside mobile student table */
  #dListCard table.tablex .badge-grp-hist,
  #listTableCard table.tablex .badge-grp-hist {
    font-size: 9.6px !important;
    padding: 2.5px 6px !important;
    gap: 3px !important;
  }

  /* 4b) Incomplete Page (#incTable): clean full-width frame on mobile */
  #page-incomplete .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #incTable {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 12px !important;
  }
  #incTable th,
  #incTable td {
    padding: 8px 6px !important;
    vertical-align: middle !important;
  }
  #incTable .btn-xs {
    padding: 0 9px !important;
    font-size: 11.5px !important;
    height: 30px !important;
  }

  /* 4c) Calendar Page (#page-calendar): keep toolbar, dropdowns & grid strictly inside card */
  #page-calendar .cal-min-toolbar {
    padding: 10px 12px !important;
    overflow: hidden !important;
  }
  #page-calendar .cal-min-toolbar > .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #page-calendar .cal-min-toolbar > .d-flex > div:first-child {
    width: 100% !important;
    justify-content: space-between !important;
  }
  #page-calendar #calMonthTitle {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    font-size: 14px !important;
  }
  #page-calendar .cal-min-toolbar .form-select,
  #page-calendar .cal-min-toolbar select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 12.5px !important;
  }
  #page-calendar .cardx {
    overflow: hidden !important;
  }
  #page-calendar .cal-grid,
  #page-calendar .cal-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  /* 4d) Official Letters (#page-letters) on Mobile: ZERO horizontal overflow */
  #page-letters,
  #page-letters #lgDetailPane,
  #page-letters .step-card {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  #page-letters .step-card .input-group:has(input[type="time"]) {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  #page-letters .step-card .input-group:has(input[type="time"]) > * {
    border-radius: 8px !important;
    max-width: 100% !important;
  }

  /* 4e) Security Modal (#securityModal) on Mobile:
         Compact Copy Link button + tidy Staff กลาง button layout */
  #securityModal .modal-body .btn:not(.btn-close) {
    font-size: 12.2px !important;
  }
  #securityModal .input-group > .btn[onclick*="copyTextField"] {
    padding: 0 9px !important;
    font-size: 11.5px !important;
    min-height: 32px !important;
  }
  #secStaffConfigCard .btn,
  #secLineCard .d-flex.justify-content-end .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  #secStaffConfigCard .input-group > .btn {
    width: auto !important;
  }

  /* 4f) Template Settings Modal (#tplModal) on Mobile: tidy upload buttons */
  #tplBody .cardx > .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #tplBody .cardx > .d-flex > .btn,
  #tplBody .cardx > .d-flex > .d-flex {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: space-between !important;
  }
  #tplBody .cardx > .d-flex > .btn {
    justify-content: center !important;
  }
}

/* ==========================================================================
   V43: STAFF กลาง FULL-WIDTH QUICK LINK BUTTONS + MOBILE STUDENT LIST 100% FIT
   ========================================================================== */

/* 1) Staff กลาง (#secStaffConfigCard): Make 'สร้างลิงก์ด่วน' & 'ยกเลิกลิงก์'
      100% full-width bars matching 'ล้างสิทธิ์และออกจากระบบ' on mobile */
@media (max-width: 767.98px) {
  #secStaffConfigCard .d-flex.flex-wrap > div,
  #secStaffConfigCard .d-flex.flex-wrap > .d-flex,
  #secStaffConfigCard .d-flex.flex-wrap > .btn {
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #secStaffConfigCard .d-flex.flex-wrap > .d-flex {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #secStaffConfigCard .d-flex.flex-wrap > .d-flex > .btn {
    width: 100% !important;
  }
  /* Keep top header badges compact */
  #secStaffConfigCard > .d-flex:first-child > div {
    flex: 0 1 auto !important;
    width: auto !important;
    flex-direction: row !important;
  }
}

/* 2) Mobile Student List (#dListCard, #listTableCard):
      100% Full-Frame Fit — Zero Right-Edge Clipping Even on Longest Status Badges */
@media (max-width: 991.98px) {
  #dListCard table.tablex th:first-child,
  #dListCard table.tablex td:first-child,
  #listTableCard table.tablex th:first-child,
  #listTableCard table.tablex td:first-child {
    width: 22px !important;
    min-width: 22px !important;
    padding: 8px 3px !important;
    font-size: 11px !important;
  }
  #dListCard table.tablex th:nth-child(2),
  #dListCard table.tablex td:nth-child(2),
  #listTableCard table.tablex th:nth-child(2),
  #listTableCard table.tablex td:nth-child(2) {
    padding: 8px 4px !important;
    font-size: 11.5px !important;
  }
  #dListCard table.tablex td:nth-child(2) .code,
  #listTableCard table.tablex td:nth-child(2) .code,
  #dListCard table.tablex td:nth-child(2) code,
  #listTableCard table.tablex td:nth-child(2) code {
    font-size: 10.6px !important;
    padding: 1px 5px !important;
  }
  #dListCard table.tablex th:last-child,
  #dListCard table.tablex td:last-child,
  #listTableCard table.tablex th:last-child,
  #listTableCard table.tablex td:last-child {
    padding: 8px 5px 8px 2px !important;
    font-size: 10.8px !important;
  }
  #dListCard table.tablex .rmu-ui-badge,
  #listTableCard table.tablex .rmu-ui-badge {
    font-size: 9.5px !important;
    padding: 2.5px 6px !important;
    gap: 3px !important;
  }
  #dListCard table.tablex .rmu-ui-badge svg,
  #listTableCard table.tablex .rmu-ui-badge svg {
    width: 10px !important;
    height: 10px !important;
  }
  #dListCard table.tablex .badge-grp-hist,
  #listTableCard table.tablex .badge-grp-hist {
    font-size: 9.1px !important;
    padding: 2px 6px !important;
    gap: 3px !important;
  }
}

/* ==========================================================================
   V44: TRUE OVAL HISTORY BADGES + COHESIVE RMU COMPARE FILTER THEME +
        STAFF กลาง PASSWORD ROW TOP-ALIGNMENT ON DESKTOP
   ========================================================================== */

/* 1) True Oval Capsule for History & Reapplied Badges (Matches .rmu-ui-badge 100%) */
body:not(.dark-mode) span.badge-grp-hist,
body.dark-mode span.badge-grp-hist,
body:not(.dark-mode) span.badge-grp-cur,
body.dark-mode span.badge-grp-cur,
.tablex span.badge-grp-hist,
.tablex span.badge-grp-cur {
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  padding: 3.5px 10px !important;
  font-size: 11.2px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}

/* 2) Staff กลาง & Admin Password Change Card (#secPwChangeCard):
      Align all 3 password columns strictly at top so all 3 inputs share the exact baseline */
#secPwChangeCard .row {
  align-items: flex-start !important;
}

/* 3) Compare Filter Panel (#page-compare .cmp-filter-panel):
      Cohesive RMU Emerald/Teal Pill Theme for Quick-Action Buttons, Year Pills & Sub-Item Chips */
#page-compare .cmp-filter-panel {
  background: #F6FBF9 !important;
  border: 1px solid #DCECE6 !important;
  border-radius: 16px !important;
}
body.dark-mode #page-compare .cmp-filter-panel {
  background: rgba(13, 30, 25, 0.78) !important;
  border-color: rgba(110, 231, 183, 0.18) !important;
}
#page-compare .cmp-filter-panel .btn-soft.btn-xs {
  border-radius: 999px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 11px !important;
  font-size: 11.8px !important;
  font-weight: 500 !important;
  background: #FFFFFF !important;
  color: #0F766E !important;
  border: 1px solid #BFE3D8 !important;
  box-shadow: none !important;
}
#page-compare .cmp-filter-panel .btn-soft.btn-xs:hover {
  background: #E6F7F1 !important;
  border-color: #0F766E !important;
  color: #0B554F !important;
}
body.dark-mode #page-compare .cmp-filter-panel .btn-soft.btn-xs {
  background: rgba(15, 118, 110, 0.16) !important;
  color: #5EEAD4 !important;
  border-color: rgba(94, 234, 212, 0.28) !important;
}
body.dark-mode #page-compare .cmp-filter-panel .btn-soft.btn-xs:hover {
  background: rgba(15, 118, 110, 0.32) !important;
  border-color: #2DD4BF !important;
}
#page-compare .cmp-filter-panel .form-select-sm {
  background-color: #FFFFFF !important;
  border: 1px solid #CBE4DC !important;
  border-radius: 10px !important;
  color: #0F2922 !important;
}
body.dark-mode #page-compare .cmp-filter-panel .form-select-sm {
  background-color: rgba(16, 36, 30, 0.92) !important;
  border-color: rgba(110, 231, 183, 0.22) !important;
  color: #E2F4EE !important;
}
#page-compare .cmp-item-chip {
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1px solid #DCECE6 !important;
  border-radius: 999px !important;
}
#page-compare .cmp-item-chip.active {
  background: #E6F7F1 !important;
  color: #0F766E !important;
  border: 1px solid #8CD5C0 !important;
  font-weight: 500 !important;
}
#page-compare .cmp-item-chip.active:hover {
  background: #D1F2E7 !important;
  border-color: #0F766E !important;
}
body.dark-mode #page-compare .cmp-item-chip.active {
  background: rgba(15, 118, 110, 0.28) !important;
  color: #5EEAD4 !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
}
#page-compare #cmpItemWrap {
  border-top-color: #DCECE6 !important;
}

/* ==========================================================================
   V45: 60FPS JANK-FREE MODALS (MOBILE + DESKTOP) + FLOATING SCROLL TOP/BOTTOM
   ========================================================================== */

/* 1) Eliminate Stacked GPU Blur & Layout Shift on Modals (Zero Stutter/Ghosting) */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.46) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity 0.14s ease !important;
}
.modal-backdrop.show {
  opacity: 1 !important;
}
.modal.fade {
  transition: opacity 0.15s ease !important;
}
.modal.fade .modal-dialog {
  transform: translate3d(0, 10px, 0) scale(0.99) !important;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: transform;
}
.modal.show .modal-dialog {
  transform: translate3d(0, 0, 0) scale(1) !important;
}
body:not(.dark-mode) .modal-content {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: layout style paint;
}
body.dark-mode .modal-content {
  background: #10241E !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: layout style paint;
}
@media (max-width: 991.98px) {
  body.modal-open {
    padding-right: 0 !important;
  }
  /* Pause background blur layers while modal is open so mobile GPU stays 60fps */
  body.modal-open .app-topbar,
  body.modal-open .mobile-bottom-nav,
  body.modal-open .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* 2) Floating Scroll-to-Top & Scroll-to-Bottom Pill (#rmuScrollFab) */
.rmu-scroll-fab {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #D6E7E1;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.14);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.rmu-scroll-fab.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.modal-open .rmu-scroll-fab {
  opacity: 0 !important;
  pointer-events: none !important;
}
.rmu-scroll-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #0F766E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.rmu-scroll-btn:hover,
.rmu-scroll-btn:active {
  background: #0F766E;
  color: #FFFFFF;
}
.rmu-scroll-btn.is-dim {
  opacity: 0.35;
}
.rmu-scroll-div {
  width: 18px;
  height: 1px;
  background: #E2ECE8;
}
body.dark-mode .rmu-scroll-fab {
  background: rgba(16, 38, 32, 0.94);
  border-color: rgba(110, 231, 183, 0.24);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.36);
}
body.dark-mode .rmu-scroll-btn {
  color: #5EEAD4;
}
body.dark-mode .rmu-scroll-btn:hover,
body.dark-mode .rmu-scroll-btn:active {
  background: #0F766E;
  color: #FFFFFF;
}
body.dark-mode .rmu-scroll-div {
  background: rgba(110, 231, 183, 0.18);
}
@media (max-width: 991.98px) {
  .rmu-scroll-fab {
    right: 10px;
    bottom: 76px;
    padding: 3px;
  }
  .rmu-scroll-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

/* ==========================================================================
   V46: 60FPS JANK-FREE SWEETALERT2 (CALENDAR ADD-QUEUE & ALL SWAL POPUPS)
   ========================================================================== */

@keyframes rmuSwalIn {
  0%   { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.985); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes rmuSwalOut {
  0%   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(0, 6px, 0) scale(0.985); }
}

.swal2-container {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background-color 0.14s ease !important;
}
.swal2-container.swal2-backdrop-show {
  background: rgba(15, 23, 42, 0.46) !important;
}
.swal2-popup.swal2-show {
  animation: rmuSwalIn 0.15s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  will-change: transform, opacity;
}
.swal2-popup.swal2-hide {
  animation: rmuSwalOut 0.11s ease-out forwards !important;
}
.swal2-popup.rmu-cal-min-popup {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: layout style paint;
}
body.swal2-shown {
  padding-right: 0 !important;
}
body.swal2-shown #rmuScrollFab {
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 991.98px) {
  body.swal2-shown .app-topbar,
  body.swal2-shown .mobile-bottom-nav,
  body.swal2-shown .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ==========================================================================
   V47: ZERO-FLASH AUTH REFRESH + PROVINCE BAR GLIDE ANIMATION +
        60-120HZ SMOOTH MOBILE SCROLLING
   ========================================================================== */

/* 1) Hide student page immediately on refresh when session token exists */
body.rmu-auth-booting:not(.role-student) #page-student {
  display: none !important;
}

/* 2) Smooth Glide Animation for Province Ranking Bars (#dProv) */
#dProv .pbar > i.pbar-anim {
  transition: width 3.0s cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: width;
}

/* 3) Silky 60-120Hz Mobile Scroll Performance (Zero Composite Stutter) */
.app-topbar,
.mobile-bottom-nav,
.rmu-scroll-fab {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
@media (max-width: 991.98px) {
  .app-topbar {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.dark-mode .app-topbar {
    background: rgba(8, 22, 18, 0.96) !important;
  }
  .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.dark-mode .mobile-bottom-nav {
    background: rgba(8, 22, 18, 0.97) !important;
  }
}

/* ==========================================================================
   V51: SMOOTH MAP MAJOR BARS + ADMIN GUIDE WORKFLOW HEADING FIT + CLEAN SEARCH BAR
   ========================================================================== */

/* 1) Map Major Bars (#pvGlideBars): Smooth 2.6s Glide Matching All Other Charts */
#pvGlideBars .rmu-glide-fill {
  transition: width 2.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: width;
}

/* 2) Admin Guide 5-Stage Workflow Header: Never Overflow Inner Frame */
#page-guide .guide-flow-card,
#page-guide .guide-flow-wrap {
  padding: 16px 18px !important;
  overflow: hidden !important;
}
#page-guide .guide-flow-card h6,
#page-guide .guide-flow-wrap h6 {
  font-size: 15px !important;
  line-height: 1.45 !important;
  padding: 0 2px !important;
  margin-top: 6px !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}
#page-guide .guide-flow-card .badge,
#page-guide .guide-flow-wrap .badge {
  max-width: 100% !important;
  white-space: normal !important;
  text-align: left !important;
  line-height: 1.35 !important;
}

/* 3) Student Hero Search Bar (.ag-search): Remove Redundant Inner Border */
.ag-search input,
.ag-search input.form-control {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 8px !important;
  font-size: 13.5px !important;
  min-width: 0 !important;
}
@media (max-width: 767.98px) {
  .ag-search input,
  .ag-search input.form-control {
    font-size: 12.8px !important;
    padding: 0 6px !important;
  }
}

/* ==========================================================================
   V52: MESSENGER & FACEBOOK SHARE ICONS + GUIDE BANNER CLEAN INNER BOX +
        NO FOCUS RING ON SEARCH & LOGIN + BORDERED GOOGLE LOGIN BUTTON
   ========================================================================== */

/* 1) Messenger & Facebook Share Tile Icons */
.rmu-share-ico.messenger {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #0084FF !important;
}
.rmu-share-ico.messenger svg {
  width: 30px !important;
  height: 30px !important;
}
.rmu-share-ico.facebook {
  background: #1877F2 !important;
  color: #FFFFFF !important;
}
.rmu-share-ico.facebook svg {
  width: 26px !important;
  height: 26px !important;
}

/* 2) Admin Guide 5-Stage Workflow Banner: Eliminate Stray Inner Box Overflow */
#page-guide .guide-flow-banner {
  padding: 18px 20px !important;
  overflow: hidden !important;
}
#page-guide .guide-flow-banner > .d-flex,
#page-guide .guide-flow-banner > .d-flex > div {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
}
#page-guide .guide-flow-banner > .d-flex > div > h6 {
  margin: 8px 0 0 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

/* 3) Student Hero Search Input (#sQ): Zero Focus Box / Border on Tap */
.ag-search input,
.ag-search input:focus,
.ag-search input:focus-visible,
#sQ,
#sQ:focus,
#sQ:focus-visible {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
@media (max-width: 767.98px) {
  #sQ {
    font-size: 12.2px !important;
    padding: 0 4px !important;
  }
}

/* 4) Login Modal Inputs: No Focus Ring/Border When Tapping Username or Password */
#loginModal .form-control:focus,
#loginModal .form-control:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: #E2E8F0 !important;
}
body.dark-mode #loginModal .form-control:focus,
body.dark-mode #loginModal .form-control:focus-visible {
  border-color: rgba(110, 231, 183, 0.22) !important;
}

/* 5) Google Sign-In Button (#btnCustomGoogleLogin): Crisp Outline Border */
#btnCustomGoogleLogin,
.btn.btn-google {
  border: 1px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  border-radius: 10px !important;
  min-height: 40px !important;
  font-weight: 500 !important;
}
#btnCustomGoogleLogin:hover,
.btn.btn-google:hover {
  background: #F8FAFC !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}
body.dark-mode #btnCustomGoogleLogin,
body.dark-mode .btn.btn-google {
  background: rgba(16, 36, 30, 0.92) !important;
  border-color: rgba(110, 231, 183, 0.3) !important;
  color: #E2F4EE !important;
}
body.dark-mode #btnCustomGoogleLogin:hover,
body.dark-mode .btn.btn-google:hover {
  background: rgba(20, 48, 40, 0.96) !important;
  border-color: rgba(110, 231, 183, 0.5) !important;
}

/* ==========================================================================
   V53: PIXEL-EXACT REAL APP SHARE ICONS + CONCENTRIC OVAL PILL 'ค้นหา' BUTTON
   ========================================================================== */

/* 1) Concentric Oval Pill 'ค้นหา' Button Inside Student Search Bar */
.ag-search {
  border-radius: 999px !important;
  padding: 5px 5px 5px 14px !important;
}
.ag-search .ag-btn,
.ag-search .btn-main {
  border-radius: 999px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 20px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
}

/* 2) Real App-Icon Proportions for All 7 Share Tiles */
.rmu-share-ico {
  width: 56px !important;
  height: 56px !important;
  border-radius: 15px !important;
  overflow: hidden !important;
}
.rmu-share-ico.line {
  background: #06C755 !important;
}
.rmu-share-ico.line svg {
  width: 40px !important;
  height: 40px !important;
}
.rmu-share-ico.messenger {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
}
.rmu-share-ico.messenger svg {
  width: 40px !important;
  height: 40px !important;
}
.rmu-share-ico.facebook {
  background: #1877F2 !important;
  align-items: flex-end !important;
}
.rmu-share-ico.facebook svg {
  width: 44px !important;
  height: 44px !important;
  display: block !important;
}
.rmu-share-ico.gmail {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
}
.rmu-share-ico.gmail svg {
  width: 36px !important;
  height: 36px !important;
}
.rmu-share-ico.ig svg {
  width: 36px !important;
  height: 36px !important;
}
.rmu-share-ico.tiktok {
  background: #000000 !important;
}
.rmu-share-ico.tiktok svg {
  width: 34px !important;
  height: 34px !important;
}
.rmu-share-ico.more svg {
  width: 28px !important;
  height: 28px !important;
}

/* ==========================================================================
   V54: TRUE OVAL PILL 'ค้นหา' BUTTON (BEATS V38 SPECIFICITY) +
        REAL OFFICIAL BRAND APP ICON TILES
   ========================================================================== */

body:not(.dark-mode) #tourSearch button.btn-main.ag-btn,
body.dark-mode #tourSearch button.btn-main.ag-btn,
#tourSearch .ag-btn {
  border-radius: 999px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 20px !important;
}

.rmu-share-ico.rmu-share-img {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12) !important;
  overflow: hidden !important;
}
.rmu-share-ico.rmu-share-img-bd {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
}
.rmu-share-ico.rmu-share-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ==========================================================================
   V55: MINIMALIST 'MORE' SHARE ICON + CLEAN THEME TOASTS (DESKTOP & MOBILE)
   ========================================================================== */

/* 1) Minimalist 'More' Share Tile (.rmu-share-ico.native): Matches Real App Icon Grid */
.rmu-share-ico.native {
  background: #FFFFFF !important;
  color: #0F766E !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease !important;
}
.rmu-share-ico.native:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}
.rmu-share-ico.native svg {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 1.9 !important;
}
body.dark-mode .rmu-share-ico.native {
  background: rgba(16, 36, 30, 0.94) !important;
  color: #5EEAD4 !important;
  border-color: rgba(110, 231, 183, 0.25) !important;
}

/* 2) Clean Minimalist RMU Toast Notifications (#rmuToastHost & .rmu-toast-item) */
.rmu-toast-host {
  top: 76px !important;
  right: 20px !important;
  left: auto !important;
  transform: none !important;
  align-items: flex-end !important;
}
.rmu-toast-item {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0F2922 !important;
  border: 1px solid #D6E7E1 !important;
  border-left: 1px solid #D6E7E1 !important;
  border-radius: 999px !important;
  padding: 8px 16px 8px 10px !important;
  font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  max-width: min(90vw, 380px) !important;
}
.rmu-toast-item.t-error {
  border-color: #FECACA !important;
  border-left-color: #FECACA !important;
  color: #991B1B !important;
}
.rmu-toast-item.t-warn {
  border-color: #FDE68A !important;
  border-left-color: #FDE68A !important;
  color: #92400E !important;
}
.rmu-toast-item .rmu-toast-ic {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #ECFDF5 !important;
  color: #0F766E !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 13px !important;
}
.rmu-toast-item.t-error .rmu-toast-ic {
  background: #FEF2F2 !important;
  color: #DC2626 !important;
}
.rmu-toast-item.t-warn .rmu-toast-ic {
  background: #FFFBEB !important;
  color: #D97706 !important;
}
body.dark-mode .rmu-toast-item {
  background: rgba(16, 36, 30, 0.96) !important;
  color: #E6F5F0 !important;
  border-color: rgba(110, 231, 183, 0.28) !important;
  border-left-color: rgba(110, 231, 183, 0.28) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42) !important;
}
body.dark-mode .rmu-toast-item .rmu-toast-ic {
  background: rgba(15, 118, 110, 0.28) !important;
  color: #5EEAD4 !important;
}
@media (max-width: 991.98px) {
  .rmu-toast-host {
    top: 68px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    align-items: center !important;
  }
}

/* ==========================================================================
   V56: PILL 'สำหรับผู้ดูแล' LOGIN BUTTON + FULL MOBILE FOOTER CLEARANCE
   ========================================================================== */

/* 1) Modern Pill-Shaped '#btnLogin' ('สำหรับผู้ดูแล') Matching 38px Topbar Controls */
.app-topbar #btnLogin,
body:not(.dark-mode) .app-topbar #btnLogin {
  border-radius: 999px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: #0F766E !important;
  color: #FFFFFF !important;
  border: 1px solid #0F766E !important;
  box-shadow: none !important;
  gap: 6px !important;
}
.app-topbar #btnLogin:hover {
  background: #115E59 !important;
  border-color: #115E59 !important;
}
body.dark-mode .app-topbar #btnLogin {
  background: rgba(15, 118, 110, 0.9) !important;
  border-color: rgba(94, 234, 212, 0.35) !important;
  color: #FFFFFF !important;
}

/* 2) Mobile Bottom Clearance: Ensure Entire Footer Scrolls Cleanly Above Bottom Nav */
@media (max-width: 991.98px) {
  .main,
  .app-shell .main {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .app-footer {
    margin-bottom: 12px !important;
  }
  .app-topbar #btnLogin {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 13px !important;
    font-size: 12.5px !important;
  }
}

/* ==========================================================================
   V57: MOBILE FOOTER CLEARANCE (footer.footer#tourFooter OUTSIDE <main>)
   ========================================================================== */
@media (max-width: 991.98px) {
  .main,
  .app-shell .main {
    padding-bottom: 16px !important;
  }
  footer.footer,
  #tourFooter {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ==========================================================================
   SCROLL-DRIVEN 60FPS CANVAS BACKGROUND & GLASSMORPHISM MODERN THEME
   ========================================================================== */

/* 1. Fixed Background Canvas & Contrast Overlay */
.bg-scroll-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  background-color: #050a0d;
}

.bg-contrast-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 25%, rgba(10, 18, 22, 0.50) 0%, rgba(4, 9, 12, 0.88) 100%);
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
}

body {
  background-color: transparent !important;
  color: #F3F4F6 !important;
  overflow-x: hidden;
}

.app-shell {
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  width: 100% !important;
}

.app-sidebar {
  display: none !important;
}

.app-main {
  background: transparent !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  margin-left: 0 !important;
}

.main {
  background: transparent !important;
}

/* Ensure Page has ample smooth scroll length for 895 frames scrubbing */
#page-student,
.page-student {
  min-height: 280vh !important;
}

/* 2. Sticky Glassmorphism Top Navigation Bar */
.app-topbar {
  height: 74px !important;
  background: rgba(10, 18, 22, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
  padding: 0 24px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1040 !important;
  display: flex !important;
  align-items: center !important;
}

.topbar-inner-wrap {
  max-width: 1400px;
  margin: 0 auto;
}

.topbar-logo-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-logo-img {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 2px 8px rgba(0, 212, 159, 0.35));
}

.topbar-brand-title b {
  font-size: 15px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #FFFFFF 30%, #A7F3D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-brand-title small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65) !important;
}

.t-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.t-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.t-nav-item.active {
  background: rgba(0, 212, 159, 0.16);
  color: #6EE7B7 !important;
  border-color: rgba(0, 212, 159, 0.45);
  box-shadow: 0 0 16px rgba(0, 212, 159, 0.2);
}

.btn-glass-ctrl {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #FFFFFF !important;
  border-radius: 9999px !important;
  padding: 7px 12px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-glass-ctrl:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #FFFFFF !important;
}

.btn-glass-login {
  background: rgba(0, 212, 159, 0.15) !important;
  border: 1px solid rgba(0, 212, 159, 0.4) !important;
  color: #A7F3D0 !important;
  border-radius: 9999px !important;
  padding: 7px 16px !important;
  font-weight: 500 !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.btn-glass-login:hover {
  background: rgba(0, 212, 159, 0.28) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 18px rgba(0, 212, 159, 0.4);
}

.btn-glass-user {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 9999px !important;
  padding: 5px 14px 5px 6px !important;
  color: #FFFFFF !important;
  backdrop-filter: blur(12px);
}

.glass-dropdown-menu {
  background: rgba(14, 24, 28, 0.95) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

.glass-dropdown-menu .dropdown-item {
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  padding: 8px 14px;
}

.glass-dropdown-menu .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.mobile-nav-drawer {
  position: absolute;
  top: 74px;
  left: 0;
  right: 0;
  background: rgba(10, 18, 22, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 1045;
}

.m-nav-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 4px;
}

.m-nav-item:hover, .m-nav-item.active {
  background: rgba(0, 212, 159, 0.15);
  color: #6EE7B7;
}

/* 3. Search Box Glassmorphism (Blended into dynamic background) */
.hero {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.hero .search-bar-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hero .search-bar-pill:focus-within {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: #00D49F !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 212, 159, 0.4) !important;
  transform: translateY(-2px);
}

.search-segment-input {
  background: transparent !important;
  color: #FFFFFF !important;
  border: none !important;
  outline: none !important;
}

.search-segment-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

.search-orb {
  background: linear-gradient(135deg, #00D49F 0%, #009E76 100%) !important;
  color: #061A14 !important;
  box-shadow: 0 4px 18px rgba(0, 212, 159, 0.45) !important;
  transition: all 0.25s ease !important;
}

.search-orb:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(0, 212, 159, 0.65) !important;
}

/* 4. Bento Guide Cards Glassmorphism */
.student-bento-tour {
  max-width: 1200px;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.bento-card-glass {
  background: rgba(14, 24, 28, 0.62) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex;
  flex-direction: column;
}

.bento-card-glass:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 159, 0.4) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 159, 0.18) !important;
}

.bento-step-num {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6EE7B7;
  margin-bottom: 4px;
}

.bento-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.bento-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-emerald-glow {
  background: rgba(0, 212, 159, 0.14);
  border: 1px solid rgba(0, 212, 159, 0.3);
}

.bg-blue-glow {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.bg-warning-glow {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.bg-purple-glow {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.bento-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0, 212, 159, 0.15);
  color: #6EE7B7;
  border: 1px solid rgba(0, 212, 159, 0.35);
}

.bento-highlight-pulse {
  animation: bentoPulse 1.4s ease;
}

@keyframes bentoPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 35px rgba(0, 212, 159, 0.4); }
  100% { transform: scale(1); }
}

.btn-outline-emerald {
  border: 1px solid rgba(0, 212, 159, 0.4) !important;
  color: #6EE7B7 !important;
  background: rgba(0, 212, 159, 0.08) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
}

.btn-outline-emerald:hover {
  background: rgba(0, 212, 159, 0.22) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 14px rgba(0, 212, 159, 0.3);
}

.btn-outline-warning {
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #FCD34D !important;
  background: rgba(245, 158, 11, 0.08) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
}

.btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.border-white-10 {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 5. General Glassmorphism on Cards and Results */
.cardx {
  background: rgba(14, 24, 28, 0.68) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  color: #F3F4F6 !important;
}

.cardx:hover {
  border-color: rgba(0, 212, 159, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

.search-result-bar {
  background: rgba(14, 24, 28, 0.6) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #D1D5DB !important;
}

.page-banner {
  background: rgba(14, 24, 28, 0.65) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

.page-banner h4, .page-banner h3 {
  color: #FFFFFF !important;
}

.page-banner .text-muted {
  color: #CBD5E1 !important;
}

.modal-content {
  background: rgba(14, 24, 28, 0.95) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7) !important;
  color: #F3F4F6 !important;
}

.modal-header, .modal-footer {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.modal-body {
  background: transparent !important;
  color: #F3F4F6 !important;
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.form-control, .form-select {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
}

.form-control:focus, .form-select:focus {
  background-color: rgba(255, 255, 255, 0.14) !important;
  border-color: #00D49F !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 10px rgba(0, 212, 159, 0.3) !important;
}

.form-select option {
  background-color: #0E181C !important;
  color: #FFFFFF !important;
}

.table {
  color: #F3F4F6 !important;
}
