/* ==========================================================================
   e-Room Theme v2 — Premium Blue & White (top-nav enterprise layout)
   Loaded in <head> and again at the end of footer.php so it always wins
   over pages that re-link adminlte.min.css. Presentation only.
   Naming: erm-* = e-Room components; AdminLTE/Bootstrap classes overridden.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --primary: #0B5ED7;
  --primary-dark: #084298;
  --primary-light: #EAF3FF;
  --navy: #0F2747;
  --blue-soft: #F4F8FD;
  --surface: #FFFFFF;
  --background: #F6F9FC;
  --text: #172033;
  --text-muted: #6B7280;
  --border: #DCE6F2;
  --success: #198754;
  --warning: #E6A700;
  --danger: #DC3545;

  --navy-deep: #0A1C35;
  --border-strong: #C5D5E8;
  --line: #EDF2F8;
  --success-soft: #E8F5EE;
  --warning-soft: #FFF6DE;
  --warning-text: #8A5A00;
  --danger-soft: #FDECEE;
  --danger-text: #A61E2C;
  --orange-soft: #FFEFD9;
  --orange-border: #F3B462;
  --orange-text: #8A4B00;
  --red-soft: #FDE8EA;
  --red-border: #F1A7AF;

  --on-navy: #FFFFFF;
  --on-navy-2: rgba(255, 255, 255, 0.74);
  --on-navy-3: rgba(255, 255, 255, 0.52);
  --navy-tint: rgba(255, 255, 255, 0.08);
  --navy-tint-2: rgba(255, 255, 255, 0.14);
  --navy-line: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(15, 39, 71, 0.04), 0 8px 24px rgba(15, 39, 71, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 39, 71, 0.05), 0 16px 36px rgba(15, 39, 71, 0.12);
  --shadow-pop: 0 24px 60px rgba(10, 28, 53, 0.22);
  --focus-ring: 0 0 0 3px rgba(11, 94, 215, 0.3);

  --font: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shell: 1360px;
  --gutter: 32px;
  --appbar-h: 68px;
}

/* 2. Base ------------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }

body,
.main-header,
.content-wrapper,
.main-footer,
.modal,
.tooltip,
.popover,
.dropdown-menu { font-family: var(--font); }

body {
  background: var(--background);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); text-decoration: none; }
b, strong { font-weight: 600; }
::selection { background: var(--primary-light); color: var(--navy); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.text-muted { color: var(--text-muted) !important; }
.text-dark { color: var(--text) !important; }
.text-primary { color: var(--primary) !important; }

/* 3. Shell & layout -------------------------------------------------------- */
.erm-shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.erm-app .wrapper,
.erm-app .content-wrapper { background: var(--background); }

.erm-app.layout-top-nav .content-wrapper {
  min-height: calc(100vh - var(--appbar-h));
  margin-left: 0 !important;
  padding-bottom: 48px;
}

.erm-app .content { position: relative; z-index: 2; padding: 0; }

.erm-app .content > .container-fluid,
.erm-app .content > .container {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.erm-hero ~ .content,
.erm-hero ~ section.content { margin-top: -64px; }

.erm-app .content-header { display: none; }

/* 4. App bar --------------------------------------------------------------- */
.erm-appbar.main-header {
  position: sticky;
  top: 0;
  z-index: 1035;
  margin: 0 !important;
  padding: 0;
  min-height: var(--appbar-h);
  background: var(--navy);
  border-bottom: 1px solid var(--navy-line);
  box-shadow: none;
}

.erm-appbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  min-height: var(--appbar-h);
}

.erm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 8px;
  color: var(--on-navy);
}

.erm-brand:hover { color: var(--on-navy); }

.erm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 16px rgba(11, 94, 215, 0.45);
}

.erm-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.erm-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; color: var(--on-navy); }
.erm-brand-org { font-size: 11.5px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--on-navy-3); }

.erm-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-navy);
  font-size: 18px;
}

.erm-nav-collapse { flex: 1; align-items: center; }

.erm-nav { display: flex; align-items: center; gap: 2px; }

.erm-appbar .erm-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px !important;
  border-radius: var(--radius);
  color: var(--on-navy-2);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}

.erm-appbar .erm-nav .nav-link i { font-size: 14px; color: var(--on-navy-3); transition: color .15s ease; }

.erm-appbar .erm-nav .nav-link:hover,
.erm-appbar .erm-nav .show > .nav-link {
  background: var(--navy-tint);
  color: var(--on-navy);
}

.erm-appbar .erm-nav .nav-link:hover i { color: var(--on-navy); }

.erm-appbar .erm-nav .nav-link.active {
  background: var(--navy-tint-2);
  color: var(--on-navy);
  box-shadow: inset 0 0 0 1px var(--navy-line);
}

.erm-appbar .erm-nav .nav-link.active i { color: #8EC0FF; }

.erm-appbar .dropdown-toggle::after {
  margin-left: 2px;
  border: 0;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
  opacity: .7;
}

.erm-appbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.erm-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  color: var(--on-navy-2);
  font-size: 14px;
  font-weight: 500;
}

.erm-ghost-btn:hover { background: var(--navy-tint); color: var(--on-navy); }
.erm-ghost-btn.is-active { background: var(--on-navy); border-color: var(--on-navy); color: var(--navy); }

.erm-user {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  color: var(--on-navy);
}

.erm-user:hover, .show > .erm-user { background: var(--navy-tint); color: var(--on-navy); }

.erm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3D8BFF, var(--primary));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.erm-avatar.is-lg { width: 44px; height: 44px; font-size: 17px; box-shadow: none; }

.erm-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.erm-user-name { max-width: 190px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erm-user-role { font-size: 12px; color: var(--on-navy-3); }
.erm-caret { font-size: 11px; color: var(--on-navy-3); }

.erm-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--on-navy);
  color: var(--navy);
  font-weight: 600;
}

.erm-login-btn:hover { background: var(--primary-light); color: var(--navy); }

/* Dropdown panels */
.erm-dropdown.dropdown-menu {
  min-width: 260px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.erm-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}

.erm-dropdown .dropdown-item:hover,
.erm-dropdown .dropdown-item:focus { background: var(--blue-soft); color: var(--primary-dark); }

.erm-dropdown .dropdown-item.active,
.erm-dropdown .dropdown-item:active { background: var(--primary-light); color: var(--primary-dark); }

.erm-dd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--primary);
  font-size: 13px;
}

.erm-dropdown .dropdown-item.active .erm-dd-icon { background: var(--primary); color: #fff; }
.erm-dropdown .dropdown-item.is-danger { color: var(--danger-text); }
.erm-dropdown .dropdown-item.is-danger .erm-dd-icon { background: var(--danger-soft); color: var(--danger); }
.erm-dropdown .dropdown-item.is-danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.erm-dropdown .dropdown-divider { margin: 6px 4px; border-color: var(--line); }

.erm-dd-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; }
.erm-dd-head strong { display: block; font-size: 15px; color: var(--text); }
.erm-dd-head small { display: block; font-size: 12.5px; color: var(--text-muted); }

/* 5. Hero band -------------------------------------------------------------- */
.erm-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 0 100px;
  background-color: var(--navy);
  color: var(--on-navy);
  isolation: isolate;
}

.erm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
  mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
}

.erm-hero::after {
  content: "";
  position: absolute;
  top: -220px;
  right: -120px;
  z-index: -1;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 94, 215, 0.55) 0%, rgba(11, 94, 215, 0) 68%);
}

.erm-hero.is-home { padding-bottom: 76px; }

.erm-hero { padding: 22px 0 70px; }
.erm-hero ~ .content,
.erm-hero ~ section.content { margin-top: -46px; }

.erm-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}

.erm-hero-head .erm-hero-title { font-size: 26px; line-height: 1.3; }

.erm-hero-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.erm-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  background: var(--navy-tint);
  color: var(--on-navy-2);
  font-size: 13.5px;
  white-space: nowrap;
}

.erm-hero-meta-item i { font-size: 12px; color: #8EC0FF; }

.erm-hero-row { align-items: center; }
.erm-hero .erm-types { margin-top: 18px; }
.erm-hero-cta { height: 42px; padding: 0 18px; font-size: 15px; }

.erm-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}

.erm-hero-text { min-width: 0; }

.erm-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--on-navy-3);
}

.erm-breadcrumb a { color: var(--on-navy-3); }
.erm-breadcrumb a:hover { color: var(--on-navy); }
.erm-breadcrumb li + li::before { content: "›"; margin-right: 6px; color: rgba(255, 255, 255, 0.3); }
.erm-breadcrumb li[aria-current] { color: var(--on-navy-2); }

.erm-hero-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--on-navy);
  letter-spacing: -0.3px;
}

.erm-hero-sub { margin: 6px 0 0; font-size: 16px; color: var(--on-navy-2); }

.erm-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  background: var(--on-navy);
  color: var(--navy);
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}

.erm-hero-cta i { color: var(--primary); }
.erm-hero-cta:hover { color: var(--navy); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3); }

.erm-types {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.erm-types::-webkit-scrollbar { display: none; }

.erm-type {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  background: var(--navy-tint);
  color: var(--on-navy-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.erm-type:hover { background: var(--navy-tint-2); color: var(--on-navy); }

.erm-type.is-active {
  border-color: var(--on-navy);
  background: var(--on-navy);
  color: var(--navy);
  font-weight: 700;
}

.erm-type.is-closed::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFC94D;
}

/* 6. Section heads & dashboard ------------------------------------------------ */
.erm-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.erm-section-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--navy); }
.erm-section-meta { font-size: 14px; color: var(--text-muted); }

.erm-hero ~ .content .container-fluid > .erm-section-head:first-child { margin-top: 0; }
.erm-hero ~ .content .container-fluid > .erm-section-head:first-child .erm-section-title { color: var(--on-navy); font-size: 17px; }
.erm-hero ~ .content .container-fluid > .erm-section-head:first-child .erm-section-meta { color: var(--on-navy-3); }

.erm-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.erm-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 176px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.erm-type-card:hover { color: var(--text); border-color: #BFD5F2; box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.erm-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 18px;
}

.erm-type-name { font-size: 16.5px; font-weight: 700; line-height: 1.35; color: var(--navy); }
.erm-type-count { font-size: 14px; color: var(--text-muted); }
.erm-type-count strong { font-size: 15px; font-weight: 700; color: var(--text); }

.erm-type-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.erm-type-foot i { transition: transform .18s ease; }
.erm-type-card:hover .erm-type-foot i { transform: translateX(3px); }

.erm-type-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.14), var(--shadow-card); }
.erm-type-card.is-current .erm-type-icon { background: var(--primary); color: #fff; }

.erm-type-card.is-current::after {
  content: "กำลังใช้งาน";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.erm-type-card.is-closed { background: #FFFDF7; border-color: #F2E3B6; }
.erm-type-card.is-closed .erm-type-icon { background: var(--warning-soft); color: var(--warning-text); }
.erm-type-card.is-closed .erm-type-foot { color: var(--warning-text); }

.erm-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.erm-inline-form .form-control { width: auto; min-width: 170px; }

/* 7. Cards ----------------------------------------------------------------- */
.card {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header::after { display: none; }
.card-header > .card-tools { margin-left: auto; float: none; }

.card-title,
.card-header h3.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  float: none;
}

.card-title > i,
.card-title > .fas,
.card-title > .far,
.card-title > .fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
}

.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; background: var(--blue-soft); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important; }

.card-primary:not(.card-outline) > .card-header,
.card-info:not(.card-outline) > .card-header,
.card-warning:not(.card-outline) > .card-header,
.card-success:not(.card-outline) > .card-header {
  background: transparent;
  border-bottom-color: var(--line);
}

.card-primary:not(.card-outline) > .card-header .card-title,
.card-info:not(.card-outline) > .card-header .card-title,
.card-warning:not(.card-outline) > .card-header .card-title,
.card-success:not(.card-outline) > .card-header .card-title { color: var(--navy); }

.card-primary:not(.card-outline) > .card-header .btn-tool,
.card-warning:not(.card-outline) > .card-header .btn-tool { color: var(--text-muted); }

.card-danger:not(.card-outline) > .card-header { background: var(--danger-soft); border-bottom-color: var(--red-border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-danger:not(.card-outline) > .card-header .card-title { color: var(--danger-text); }
.card-danger:not(.card-outline) > .card-header .card-title > i { background: var(--surface); color: var(--danger); }

.card-outline.card-primary { border-top: 3px solid var(--primary); }

.btn-tool { min-height: 32px !important; width: 32px; padding: 0 !important; color: var(--text-muted); border-radius: var(--radius-sm); }
.btn-tool:hover { color: var(--primary); background: var(--blue-soft); }

.small-box {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-card);
}

.small-box > .inner { flex: 1; padding: 20px; }
.small-box h3 { margin: 0 0 4px; font-size: 32px; font-weight: 700; color: var(--primary) !important; }
.small-box p, .small-box h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--navy) !important; }
.small-box .icon { display: none; }
.small-box .small-box-footer { padding: 10px 20px; border-top: 1px solid var(--line); background: var(--blue-soft) !important; color: var(--primary) !important; font-weight: 600; text-align: left; }

/* 8. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.btn:focus, .btn.focus { box-shadow: var(--focus-ring) !important; }
.btn:active { transform: translateY(1px); }
.btn.disabled, .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-sm, .btn-group-sm > .btn { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg, .btn-group-lg > .btn { min-height: 48px; padding: 10px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:not(:disabled):not(.disabled):active { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-info { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary-dark); }
.btn-info:hover, .btn-info:not(:disabled):not(.disabled):active { background: #D6E7FF; border-color: #D6E7FF; color: var(--primary-dark); }

.btn-default,
.btn-secondary,
.btn-outline-primary { background: var(--surface); border-color: var(--border-strong); color: var(--primary-dark); }

.btn-default:hover, .btn-secondary:hover, .btn-outline-primary:hover,
.btn-secondary:not(:disabled):not(.disabled):active { background: var(--blue-soft); border-color: var(--primary); color: var(--primary); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover, .btn-success:not(:disabled):not(.disabled):active { background: #146C43; border-color: #146C43; color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover, .btn-danger:not(:disabled):not(.disabled):active { background: #B02A37; border-color: #B02A37; color: #fff; }

.btn-warning { background: var(--warning-soft); border-color: #F4D98B; color: var(--warning-text); }
.btn-warning:hover, .btn-warning:not(:disabled):not(.disabled):active { background: #FCEBB8; border-color: var(--warning); color: var(--warning-text); }

.btn-outline-success { border-color: var(--success); color: var(--success); background: var(--surface); }
.btn-outline-success:hover { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.btn-outline-danger { border-color: var(--red-border); color: var(--danger-text); background: var(--surface); }
.btn-outline-danger:hover { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger); }

/* 9. Forms ----------------------------------------------------------------- */
label, .control-label, .col-form-label { margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.form-group { margin-bottom: 18px; }

.form-control,
.custom-select,
select.form-control {
  height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.form-control { height: auto; min-height: 100px; line-height: 1.6; }
.form-control:hover, .custom-select:hover { border-color: #A9C2E0; }
.form-control:focus, .custom-select:focus { border-color: var(--primary); box-shadow: var(--focus-ring); outline: 0; }
.form-control::placeholder { color: #9AA4B2; }
.form-control:disabled, .form-control[readonly] { background: var(--blue-soft); border-color: var(--border); color: var(--text-muted); }
.form-control-lg, .input-lg { height: 48px; font-size: 16px; }

.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); background-image: none; padding-right: 14px; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 53, 69, .2); }
.form-control.is-valid, .was-validated .form-control:valid { border-color: var(--success); background-image: none; padding-right: 14px; }
.invalid-feedback { font-size: 13px; color: var(--danger-text); }
.valid-feedback { font-size: 13px; color: var(--success); }
.form-text, small.form-text { font-size: 13px; color: var(--text-muted); }

.input-group-text { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--blue-soft); color: var(--text-muted); }
.custom-control-input:checked ~ .custom-control-label::before { border-color: var(--primary); background-color: var(--primary); }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: var(--focus-ring); }

.content input[type="month"],
.content input[type="date"]:not(.form-control),
.content input[type="text"]:not(.form-control):not([type="submit"]) {
  height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap4 .select2-selection { min-height: 44px; border: 1px solid var(--border-strong) !important; border-radius: var(--radius) !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; padding-left: 14px; color: var(--text); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--primary) !important; box-shadow: var(--focus-ring); }
.select2-dropdown { border-color: var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); overflow: hidden; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--primary); }

/* 10. Tables --------------------------------------------------------------- */
.table { margin-bottom: 0; color: var(--text); font-size: 14.5px; }

.table thead th,
.table > thead > tr > th {
  padding: 13px 14px;
  border-top: 0;
  border-bottom: 1px solid var(--border) !important;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  vertical-align: middle;
  white-space: nowrap;
}

.table td, .table th { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: #E6EDF5; }
.table-striped tbody tr:nth-of-type(odd), .dataTable tbody tr:nth-of-type(odd) { background-color: #FAFCFE; }
.table-hover tbody tr:hover, .dataTable tbody tr:hover { background-color: var(--primary-light); }

.dataTables_wrapper { font-size: 14px; color: var(--text-muted); }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input { height: 40px; margin: 0 6px; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); }
.dataTables_wrapper .dataTables_filter input { min-width: 240px; }
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--primary); box-shadow: var(--focus-ring); outline: 0; }
table.dataTable { margin-top: 14px !important; margin-bottom: 14px !important; border-collapse: collapse !important; }
.dataTables_info { padding-top: 10px !important; color: var(--text-muted); }

.pagination { gap: 4px; }
.page-item .page-link { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm) !important; background: var(--surface); color: var(--text); font-size: 14px; }
.page-item .page-link:hover { border-color: var(--primary); background: var(--blue-soft); color: var(--primary); }
.page-item .page-link:focus { box-shadow: var(--focus-ring); }
.page-item.active .page-link { border-color: var(--primary); background: var(--primary); color: #fff; }
.page-item.disabled .page-link { border-color: var(--border); background: var(--surface); color: #B6BFCC; }

/* 11. Modals --------------------------------------------------------------- */
.modal-backdrop.show { opacity: .42; background: var(--navy-deep); }
.modal-content { overflow: hidden; border: 0; border-radius: 18px; box-shadow: var(--shadow-pop); }
.modal-header { align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.modal-title { font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.modal-header .close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: -4px -6px -4px auto; padding: 0; border-radius: 10px; color: var(--text-muted); font-size: 24px; font-weight: 400; opacity: 1; text-shadow: none; }
.modal-header .close:hover { background: var(--blue-soft); color: var(--text); }
.modal-body { padding: 24px; color: var(--text); }
.modal-body p { margin-bottom: 10px; }
.modal-footer { gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--blue-soft); }
.modal-footer > * { margin: 0; }

/* 12. Badges & alerts -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; line-height: 1.3; vertical-align: middle; }
.badge-primary, .badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-soft); color: #146C43; }
.badge-secondary { background: var(--orange-soft); color: var(--orange-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger { background: var(--red-soft); color: var(--danger-text); }
.badge-dark { background: #E4EAF3; color: var(--navy); }
.badge-light { background: var(--blue-soft); color: var(--text-muted); border: 1px solid var(--border); }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 14.5px; }
.alert-primary, .alert-info { background: var(--primary-light); border-color: #C9DDFB; color: var(--primary-dark); }
.alert-success { background: var(--success-soft); border-color: #B7E0C8; color: #0F5132; }
.alert-warning { background: var(--warning-soft); border-color: #F4D98B; color: var(--warning-text); }
.alert-danger { background: var(--danger-soft); border-color: var(--red-border); color: var(--danger-text); }
.alert .close { color: inherit; opacity: .6; text-shadow: none; }

.erm-notice { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--red-border); border-radius: var(--radius-pill); background: var(--danger-soft); color: var(--danger-text); font-size: 14px; font-weight: 600; }

.swal2-popup { border-radius: 18px !important; font-family: var(--font) !important; }
.swal2-styled.swal2-confirm { border-radius: var(--radius) !important; }
.swal2-styled.swal2-confirm:not([style*="background-color"]) { background: var(--primary) !important; }
#toast-container > div { border-radius: var(--radius-md); box-shadow: var(--shadow-hover); opacity: 1; }

/* 13. Footer & cookie bar ---------------------------------------------------- */
.erm-app .main-footer.erm-footer {
  margin-left: 0 !important;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}

.erm-footer .erm-shell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.erm-footer strong { font-weight: 600; color: var(--navy); }

#pjAcceptCookieBar { left: 16px !important; right: 16px !important; bottom: 16px !important; width: auto !important; max-width: 760px; margin: 0 auto; padding: 0 !important; border: 1px solid var(--border) !important; border-radius: 16px !important; background: var(--surface) !important; box-shadow: var(--shadow-pop) !important; color: var(--text) !important; font-family: var(--font) !important; }
#pjAcceptCookieBar .pjAcceptCookieBarShell { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 18px !important; color: var(--text) !important; font-size: 14px !important; line-height: 1.6 !important; text-align: left !important; }
#pjAcceptCookieBar p { flex: 1 1 320px; margin: 0 !important; color: var(--text) !important; font-family: var(--font) !important; font-size: 14px !important; font-weight: 400 !important; line-height: 1.6 !important; }
#pjAcceptCookieBar a, #pjAcceptCookieBar a:link, #pjAcceptCookieBar a:visited, #pjAcceptCookieBar a:hover, #pjAcceptCookieBar a:active { color: var(--primary) !important; font-weight: 600; }
#pjAcceptCookieBar .pjAcceptCookieBarActions { margin: 0 0 0 auto !important; }
#pjAcceptCookieBar .pjAcceptCookieBarBtn { min-height: 40px; padding: 0 18px !important; border: 0 !important; border-radius: var(--radius) !important; background: var(--primary) !important; color: #fff !important; font-family: var(--font) !important; font-size: 14px !important; font-weight: 600 !important; }

/* 14. Schedule board (book_table.php) ---------------------------------------- */
.erm-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.erm-toolbar form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0; }
.erm-toolbar .form-group { margin: 0; }

.erm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13.5px; color: var(--text-muted); }
.erm-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.erm-legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); }
.erm-legend-swatch.is-approved { background: var(--navy); border-color: var(--navy); }
.erm-legend-swatch.is-mine { background: var(--primary); border-color: var(--primary); }
.erm-legend-swatch.is-pending { background: var(--orange-soft); border-color: var(--orange-border); }
.erm-legend-swatch.is-cancelled { background: var(--red-soft); border-color: var(--red-border); }

.erm-schedule-wrap { position: relative; max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.erm-schedule { width: max-content; min-width: 100%; margin: 0; border-collapse: separate !important; border-spacing: 0; font-family: var(--font); font-size: 13px; }

.erm-schedule th, .erm-schedule td {
  min-width: 92px;
  height: 66px;
  padding: 4px !important;
  border: 0 !important;
  border-right: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

.erm-schedule thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: auto;
  padding: 10px 6px !important;
  background: var(--blue-soft) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.erm-schedule .erm-time-end { display: block; font-weight: 400; color: var(--text-muted); }

.erm-schedule th:first-child, .erm-schedule td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 0;
  padding: 8px 12px !important;
  background: var(--surface) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 6px 0 10px -8px rgba(15, 39, 71, 0.22);
}

.erm-schedule thead th:first-child { z-index: 4; background: var(--blue-soft) !important; text-align: left; }
.erm-schedule tbody tr:hover td:first-child { background: var(--blue-soft) !important; }
.erm-schedule td.erm-slot-free { transition: background-color .12s ease; }
.erm-schedule td.erm-slot-free:hover { background: var(--primary-light); box-shadow: inset 0 0 0 1px #C9DDFB; }

.erm-schedule td:first-child .btn {
  display: flex;
  width: 168px;
  max-width: 168px;
  min-height: 46px;
  margin: 2px 0;
  padding: 6px 12px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.erm-schedule td:first-child .btn-primary { background: var(--surface); border-color: var(--border); color: var(--navy); }
.erm-schedule td:first-child .btn-primary::after { content: "+ จอง"; margin-left: auto; padding-left: 8px; font-size: 12px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.erm-schedule td:first-child .btn-primary:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.erm-schedule td:first-child .btn-secondary { background: var(--blue-soft); border-color: var(--border); color: var(--text-muted); font-weight: 500; }
.erm-schedule td:first-child .btn-warning { background: var(--warning-soft); border-color: #F4D98B; color: var(--warning-text); }

.erm-schedule td.erm-slot-booked { padding: 4px !important; }

.erm-booking { display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 100%; min-height: 56px; margin: 0; padding: 6px 10px 6px 12px; overflow: hidden; border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.erm-booking:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.erm-booking:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.erm-booking-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.erm-booking-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.2; }
.erm-booking-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.erm-booking.is-approved { background: var(--navy); border-color: var(--navy); color: #fff; }
.erm-booking.is-approved .erm-booking-meta { color: rgba(255, 255, 255, 0.75); }
.erm-booking.is-mine { background: var(--primary); border-color: var(--primary); color: #fff; }
.erm-booking.is-mine .erm-booking-meta { color: rgba(255, 255, 255, 0.85); }
.erm-booking.is-pending { background: var(--orange-soft); border-color: var(--orange-border); color: var(--orange-text); }
.erm-booking.is-pending .erm-booking-dot { box-shadow: 0 0 0 1.5px var(--surface); }
.erm-booking.is-cancelled { background: var(--red-soft); border-color: var(--red-border); color: var(--danger-text); text-decoration: line-through; }
.erm-booking .badge { display: none; }

.erm-detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; }
.erm-detail-list dt { font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.erm-detail-list dd { margin: 0; font-size: 15px; color: var(--text); word-break: break-word; }

.erm-rules { font-size: 15px; line-height: 1.85; color: var(--text); }
.erm-rules p { margin: 0; }
.erm-rules font[color="red"], .erm-rules font[color="red"] b, .erm-rules font[color="red"] u { color: var(--danger-text); }

/* 14b. Neutralise legacy page-level <style> blocks (table_month, table_room_month) */
.content-wrapper table { font-family: var(--font); }
.content-wrapper td, .content-wrapper th { border-color: #E6EDF5; }
.content-wrapper thead tr:nth-child(1) th { background: var(--blue-soft); color: var(--navy); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.content-wrapper .table-responsive th:first-child, .content-wrapper .table-responsive td:first-child { z-index: 2; }
.content-wrapper .table-responsive tbody td:first-child { background-color: var(--surface); color: var(--text); font-weight: 600; box-shadow: 6px 0 10px -8px rgba(15, 39, 71, 0.22); }
.content-wrapper .table-responsive { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.content-wrapper td[bgcolor] { font-size: 12.5px; font-weight: 500; }

/* 15. Third-party calendars --------------------------------------------------- */
.fc { font-family: var(--font); }
.fc-toolbar h2 { font-size: 20px !important; font-weight: 700; color: var(--navy); }
.fc .btn-primary, .fc-button-primary { background: var(--surface) !important; border-color: var(--border-strong) !important; color: var(--primary-dark) !important; border-radius: var(--radius-sm) !important; min-height: 36px; text-transform: none; }
.fc .btn-primary.active, .fc-button-primary:not(:disabled).fc-button-active, .fc-button-primary:not(:disabled):active { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.fc-unthemed th, .fc-unthemed td, .fc-unthemed thead, .fc-unthemed tbody, .fc-unthemed .fc-divider, .fc-unthemed .fc-row, .fc-unthemed .fc-content, .fc-unthemed .fc-popover, .fc-unthemed .fc-list-view, .fc-unthemed .fc-list-heading td, .fc-bootstrap .table-bordered td, .fc-bootstrap .table-bordered th { border-color: #E6EDF5; }
.fc-unthemed td.fc-today, .fc-day-today, .fc-bootstrap .fc-today { background: var(--primary-light) !important; }
.fc-day-header { padding: 8px 0 !important; background: var(--blue-soft); color: var(--navy); font-weight: 700; }
.fc-event { border-radius: 6px; padding: 1px 4px; font-size: 12px; }

/* 16. Responsive -------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .erm-user-text { display: none; }
  .erm-ghost-btn span { display: none; }
  .erm-appbar .erm-nav .nav-link { padding: 0 10px !important; }
}

@media (max-width: 991.98px) {
  :root { --gutter: 20px; }
  .erm-nav-toggle { display: inline-flex; }
  .erm-nav-collapse { flex-basis: 100%; }
  .erm-nav-collapse.show, .erm-nav-collapse.collapsing { padding: 8px 0 16px; border-top: 1px solid var(--navy-line); }
  .erm-nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .erm-appbar .erm-nav .nav-link { width: 100%; height: 44px; padding: 0 12px !important; }
  .erm-appbar .erm-dropdown.dropdown-menu { margin: 4px 0 8px; box-shadow: none; border-color: transparent; background: var(--navy-tint); }
  .erm-appbar .erm-nav .erm-dropdown .dropdown-item { color: var(--on-navy-2); white-space: normal; }
  .erm-appbar .erm-nav .erm-dropdown .dropdown-item:hover, .erm-appbar .erm-nav .erm-dropdown .dropdown-item.active { background: var(--navy-tint-2); color: var(--on-navy); }
  .erm-appbar .erm-nav .erm-dd-icon { background: var(--navy-tint); color: #8EC0FF; }
  .erm-appbar-right { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--navy-line); }
  .erm-user-text { display: flex; }
  .erm-hero { padding: 18px 0 62px; }
  .erm-hero-head .erm-hero-title { font-size: 22px; }
}

@media (max-width: 767.98px) {
  .erm-brand-org { display: none; }
  .erm-hero-title { font-size: 24px; }
  .erm-hero-sub { font-size: 14.5px; }
  .erm-hero-cta { width: 100%; justify-content: center; }
  .erm-types { margin-top: 18px; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
  .erm-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .erm-type-card { min-height: 150px; padding: 16px; }
  .erm-type-card.is-current::after { display: none; }
  .erm-type-name { font-size: 15px; }
  .card-header, .card-body { padding: 16px; }
  .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; margin: 6px 0 0; }
  .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { text-align: left !important; }
  .modal-dialog { margin: 12px; }
  .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  .modal-footer > .btn { width: 100%; }
  .erm-schedule th:first-child, .erm-schedule td:first-child { padding: 6px 8px !important; }
  .erm-schedule td:first-child .btn { width: 112px; max-width: 112px; font-size: 13px; }
  .erm-schedule td:first-child .btn-primary::after { content: "+"; font-size: 16px; }
  .erm-schedule th, .erm-schedule td { min-width: 84px; }
  .erm-detail-list { grid-template-columns: 1fr; gap: 2px; }
  .erm-detail-list dd { margin-bottom: 10px; }
  .erm-footer .erm-shell { justify-content: center; text-align: center; }
  #pjAcceptCookieBar .pjAcceptCookieBarActions { margin-left: 0 !important; width: 100%; }
  #pjAcceptCookieBar .pjAcceptCookieBarBtn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .erm-appbar, .erm-hero, .main-footer, #pjAcceptCookieBar { display: none !important; }
  .erm-hero ~ .content { margin-top: 0; }
  .content-wrapper { background: #fff; }
  .card { box-shadow: none; }
}

/* 17. Quick-booking pop-up + waitlist ------------------------------------------ */
.erm-schedule td.erm-slot-free.is-bookable { cursor: pointer; position: relative; }
.erm-schedule td.erm-slot-free.is-bookable:hover::after,
.erm-schedule td.erm-slot-free.is-bookable:focus-visible::after {
  content: "+ จอง";
  position: absolute;
  top: 8px; right: 6px; bottom: 8px; left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #9CC2F5;
  border-radius: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.erm-schedule td.erm-slot-free.is-bookable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.erm-queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
}
.erm-booking.is-pending .erm-queue-badge { background: #FFE0B8; }

.erm-book-modal .modal-content { border-radius: 20px; }
.erm-book-modal .modal-header { align-items: flex-start; padding: 20px 24px 16px; }
.erm-book-head { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.erm-book-modal .modal-title { font-size: 21px; }

.erm-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-muted); }
.erm-steps li { display: inline-flex; align-items: center; gap: 8px; }
.erm-steps li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); font-size: 12px; font-weight: 700;
}
.erm-steps li.is-active { color: var(--primary-dark); font-weight: 600; }
.erm-steps li.is-active span { border-color: var(--primary); background: var(--primary); color: #fff; }
.erm-steps li.is-done span { border-color: var(--success); background: var(--success); color: #fff; }

.erm-book-modal .modal-body { padding: 22px 24px; }
.erm-book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.erm-span-2 { grid-column: 1 / -1; }

.erm-range-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: -6px 0 18px; }
.erm-range-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.erm-range-chip {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500;
}
.erm-range-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--blue-soft); }
.erm-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; }
.erm-check input { width: 18px; height: 18px; accent-color: var(--primary); }

.erm-subject-picker { display: flex; flex-direction: column; gap: 8px; }
.erm-search { position: relative; }
.erm-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9AA4B2; font-size: 14px; }
.erm-search .form-control { padding-left: 38px; }
.erm-subject-picker select[size] { height: auto; min-height: 168px; padding: 6px; }
.erm-subject-picker select[size] option { padding: 6px 8px; border-radius: 6px; }
.erm-subject-picker select[size] optgroup { font-weight: 700; color: var(--navy); }

.erm-book-hint { display: flex; gap: 8px; align-items: baseline; margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }

.erm-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.erm-result-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.erm-result-sub { font-size: 14px; color: var(--text-muted); }
.erm-result-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.erm-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 700; }
.erm-pill.is-free { background: var(--success-soft); color: #146C43; }
.erm-pill.is-conflict { background: var(--red-soft); color: var(--danger-text); }
.erm-pill.is-skipped { background: #EEF2F7; color: var(--text-muted); }

.erm-conflict-note {
  display: flex; gap: 12px; margin-bottom: 14px; padding: 12px 14px;
  border: 1px solid #F4D98B; border-radius: var(--radius-md);
  background: var(--warning-soft); color: var(--warning-text); font-size: 14px; line-height: 1.55;
}
.erm-conflict-note i { margin-top: 3px; }
.erm-conflict-note strong { display: block; }

.erm-day-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.erm-day {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.erm-day.is-conflict { border-color: var(--red-border); background: #FFFBFB; }
.erm-day.is-skipped { background: var(--blue-soft); color: var(--text-muted); }
.erm-day-date { font-size: 15px; }
.erm-day-state { display: flex; align-items: center; gap: 12px; }
.erm-day-clashes, .erm-day .erm-seg { grid-column: 1 / -1; }
.erm-clash { font-size: 13.5px; color: var(--text); }
.erm-clash-time { display: inline-block; min-width: 104px; font-weight: 700; color: var(--danger-text); }
.erm-clash-who { color: var(--text-muted); }

.erm-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.erm-tag.is-free { background: var(--success-soft); color: #146C43; }
.erm-tag.is-conflict { background: var(--red-soft); color: var(--danger-text); }
.erm-tag.is-muted { background: #EEF2F7; color: var(--text-muted); }

.erm-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; cursor: pointer; }
.erm-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }

.erm-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.erm-seg button {
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
}
.erm-seg button:hover { border-color: var(--primary); color: var(--primary); }
.erm-seg button.is-on { border-color: var(--primary); background: var(--primary); color: #fff; }

.erm-done { padding: 12px 0 4px; text-align: center; }
.erm-done-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%;
  background: var(--success-soft); color: var(--success); font-size: 28px;
  animation: erm-pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
.erm-done-icon.is-wait { background: var(--primary-light); color: var(--primary); }
.erm-done h3 { margin: 0 0 6px; font-size: 21px; color: var(--navy); }
.erm-done p { color: var(--text-muted); }
.erm-done-list { display: inline-flex; flex-direction: column; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; text-align: left; }
.erm-done-list li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.erm-done-list li span { color: var(--text-muted); }
.erm-done-list li.is-ok i { color: var(--success); }
.erm-done-list li.is-wait i { color: var(--primary); }
.erm-done-list li.is-fail i { color: var(--danger); }

@keyframes erm-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.erm-book-modal .modal-footer { justify-content: space-between; flex-wrap: wrap; }
.erm-footer-left, .erm-footer-right { display: flex; flex-wrap: wrap; gap: 8px; }
.erm-footer-right { margin-left: auto; }

.erm-cancel-form { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.erm-cancel-form label { color: var(--danger-text); }
.erm-cancel-form .btn { margin-top: 10px; }

@media (max-width: 767.98px) {
  .erm-book-grid { grid-template-columns: 1fr; }
  .erm-book-modal .modal-dialog { margin: 0; max-width: none; min-height: 100%; }
  .erm-book-modal .modal-content { min-height: 100vh; border-radius: 0; }
  .erm-day { grid-template-columns: 1fr; }
  .erm-seg { display: grid; grid-template-columns: 1fr; }
  .erm-footer-left, .erm-footer-right { width: 100%; }
  .erm-footer-right .btn, .erm-footer-left .btn { flex: 1; }
}

/* 18. Home assistant "น้องฟัน" ----------------------------------------------------- */
.erm-ai {
  position: fixed;
  right: 24px;
  bottom: 18px;
  z-index: 1040;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.erm-ai[hidden] { display: none; }
.erm-ai > * { pointer-events: auto; }

.erm-ai-buddy {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateX(calc(100% + 60px));
  filter: drop-shadow(0 10px 18px rgba(15, 39, 71, 0.18));
}
.erm-ai-buddy:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 16px; }

.erm-ai-bubble {
  position: relative;
  width: min(380px, calc(100vw - 150px));
  margin-bottom: 64px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 18px 18px 6px 18px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, 1.2, .4, 1), visibility .3s;
}
.erm-ai-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 18px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transform: rotate(-45deg);
}

.erm-ai-bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--navy); }
.erm-ai-avatar { position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #EAF2FF; box-shadow: inset 0 0 0 1px #D6E4F7; }
.erm-ai-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.erm-ai-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px #fff; }
.erm-ai-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}
.erm-ai-close:hover { background: var(--blue-soft); color: var(--text); }

.erm-ai-text { min-height: 44px; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.erm-ai-text b { color: var(--navy); }
.erm-ai-text i { color: var(--primary); margin-right: 4px; }
.erm-ai-text a { font-weight: 600; }

.erm-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.erm-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.erm-ai-chip:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.erm-ai-chip.is-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.erm-ai-chip.is-primary:hover { background: var(--primary-dark); color: #fff; }

.erm-ai-typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.erm-ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9CB6D8; animation: erm-ai-dots 1s infinite ease-in-out; }
.erm-ai-typing i:nth-child(2) { animation-delay: .15s; }
.erm-ai-typing i:nth-child(3) { animation-delay: .3s; }

.erm-ai-recall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}
.erm-ai-recall:hover { background: var(--primary); }
.erm-ai-recall[hidden] { display: none; }

/* walking in */
.erm-ai.is-walking .erm-ai-buddy { animation: erm-ai-walk-in 1.7s cubic-bezier(.25, .8, .3, 1) forwards; }

/* arrived: idle float, bubble in */
.erm-ai.is-arrived .erm-ai-buddy { transform: none; animation: erm-ai-float 3.2s infinite ease-in-out; }
.erm-ai.is-arrived .erm-ai-bubble { opacity: 1; visibility: visible; transform: none; }
.erm-ai.is-wiggle .erm-ai-buddy { animation: erm-ai-wiggle .5s ease-in-out; }

/* leaving */
.erm-ai.is-gone .erm-ai-bubble { opacity: 0; visibility: hidden; transform: translateY(12px) scale(.96); }
.erm-ai.is-gone .erm-ai-buddy { transform: translateX(calc(100% + 60px)); transition: transform .45s ease-in; animation: none; }

@keyframes erm-ai-walk-in { from { transform: translateX(calc(100% + 60px)); } to { transform: translateX(0); } }
@keyframes erm-ai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes erm-ai-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes erm-ai-dots { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 767.98px) {
  .erm-ai { right: 10px; bottom: 10px; gap: 4px; }
  .erm-ai-bubble { width: calc(100vw - 124px); margin-bottom: 44px; padding: 12px 14px; }
  .erm-ai-text { font-size: 14px; }
}

@media print { .erm-ai { display: none !important; } }

/* 18b. น้องฟัน artwork (raster) --------------------------------------------------- */
.erm-ai-figure { position: relative; display: block; width: 150px; }
.erm-ai-figure img { position: relative; z-index: 1; display: block; width: 150px; height: auto; user-select: none; -webkit-user-drag: none; transform-origin: 50% 90%; }
.erm-ai-figure .erm-ai-shadow { position: absolute; left: 22%; right: 22%; bottom: -2px; height: 10px; border-radius: 50%; background: rgba(15, 39, 71, 0.16); filter: blur(2px); }
.erm-ai-buddy { filter: drop-shadow(0 8px 14px rgba(15, 39, 71, 0.14)); }
.erm-ai.is-walking .erm-ai-figure img { animation: erm-ai-waddle .36s infinite ease-in-out; }
.erm-ai.is-waving .erm-ai-figure img { animation: erm-ai-hello .9s 2 ease-in-out; }
.erm-ai.is-arrived .erm-ai-figure .erm-ai-shadow { animation: erm-ai-shadow 3.2s infinite ease-in-out; }
.erm-ai-buddy:hover .erm-ai-figure img { transform: rotate(-4deg) scale(1.03); transition: transform .2s ease; }
@keyframes erm-ai-waddle { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes erm-ai-hello { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-14px) rotate(-6deg); } 40% { transform: translateY(0) rotate(0); } 60% { transform: translateY(-7px) rotate(5deg); } 80% { transform: translateY(0) rotate(0); } }
@keyframes erm-ai-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .7; } }
@media (max-width: 575.98px) {
  .erm-ai-figure, .erm-ai-figure img { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .erm-ai .erm-ai-figure img, .erm-ai .erm-ai-figure .erm-ai-shadow { animation: none !important; }
}

/* 19. Booking edit + cancellation requests ---------------------------------------- */
.erm-edit-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.erm-edit-room { font-weight: 700; color: var(--navy); }
.erm-edit-note { display: block; font-size: 14px; }
.erm-cancel-pending p, .erm-edit .alert-danger { display: block; }
.erm-edit-items { margin: 8px 0 12px; padding: 14px 16px 4px; border: 1px solid var(--border); border-radius: 12px; }
.erm-edit-items legend { width: auto; margin: 0; padding: 0 6px; font-size: 14px; font-weight: 700; color: var(--navy); }
.erm-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.erm-edit-btn { margin-top: 10px; }
.erm-cancel-hint { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
.erm-cancel-pending { margin-top: 12px; padding: 14px; border-radius: 12px; background: #FFF7E6; border: 1px solid #F6D58E; }
.erm-cancel-pending strong { color: #8A5A00; }
.erm-cancel-pending p { margin: 6px 0 10px; font-size: 14px; }
.erm-requests { border: 1px solid #F6D58E; }
.erm-requests .card-header { background: #FFF7E6; }
.erm-requests-intro { margin: 0 0 14px; font-size: 14px; color: var(--text-muted); }
.erm-requests-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.erm-request { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.erm-request header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 6px; color: var(--navy); }
.erm-request header span { font-size: 13px; color: var(--text-muted); }
.erm-request-meta { margin: 0 0 10px; font-size: 14px; }
.erm-decision-reason { margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; background: #F4F8FD; }
.erm-decision-reason p { margin: 2px 0 0; }
.erm-decision-reason small { color: var(--text-muted); }
.erm-decision-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.erm-decision-label span { font-weight: 400; }
.erm-decision-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 13px; font-weight: 400; }
.erm-decision-check input { margin-top: 3px; }
.erm-decision-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 575.98px) { .erm-requests-list { grid-template-columns: 1fr; } }

/* 20. Master-data CRUD pages (manage_*.php) ------------------------------------- */
.erm-crud-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.erm-crud-head::after { display: none; }
.erm-crud-head .card-title { float: none; margin: 0; }
.erm-crud-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.erm-crud-tools .form-control-sm { width: auto; min-width: 150px; height: 34px; }
.erm-crud-tools .btn-sm { height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.erm-crud-table td { vertical-align: middle; }
.erm-crud-ops .btn { width: 32px; height: 32px; padding: 0; }
.erm-crud-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 4px; border: 1px solid rgba(15, 39, 71, .18); vertical-align: -1px; }
.erm-crud-thumb { width: 64px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.erm-crud-preview { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.erm-crud-preview img { max-width: 140px; max-height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.erm-crud-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 14px; }
.erm-crud-perm { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.erm-swal-detail { max-height: 220px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: #F4F8FD; color: #334155; font-size: 13px; text-align: left; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; }
div.dataTables_wrapper div.dataTables_processing { border-radius: 10px; box-shadow: var(--shadow-card); }
@media (max-width: 575.98px) {
  .erm-crud-tools, .erm-crud-tools .form-control-sm, .erm-crud-tools .btn-sm { width: 100%; }
}

/* 21. Quick-booking pop-up: equipment / extra items ------------------------------ */
.erm-items { display: grid; gap: 12px; margin-bottom: 12px; }
.erm-item-group { margin: 0; padding: 12px 14px 4px; border: 1px solid var(--border); border-radius: 12px; background: #FBFDFF; }
.erm-item-group legend { width: auto; margin: 0; padding: 0 6px; font-size: 14px; font-weight: 700; color: var(--navy); }
.erm-item-group legend i { color: var(--primary); margin-right: 4px; }
.erm-item-group legend small { font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.erm-item-group[data-level="3"] { border-color: #BFD6F6; background: #F4F8FD; }
.erm-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.erm-item label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #334155; }
.erm-item .form-control-sm { height: 34px; }
.erm-item-tick { display: flex !important; align-items: center; gap: 8px; min-height: 34px; margin: 0 !important; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; }
.erm-item-tick input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.erm-item-tick.is-on { border-color: var(--primary); background: #EAF2FF; color: var(--navy); }
.erm-item-check { align-self: end; }
.erm-stats-scope { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #EAF2FF; color: var(--navy); font-weight: 600; font-size: 13.5px; }
@media (max-width: 575.98px) { .erm-item-grid { grid-template-columns: 1fr 1fr; } }
.erm-items-intro { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #F4F8FD; color: #334155; font-size: 14px; }
.erm-items-intro i { color: var(--primary); margin-top: 3px; }
@media (max-width: 575.98px) { .erm-steps li { font-size: 12px; } }
@media (max-width: 575.98px) {
  .erm-steps { flex-wrap: nowrap; }
  .erm-steps li:not(.is-active) { font-size: 0; gap: 0; }
  .erm-steps li:not(.is-active) span { font-size: 12px; }
}

/* 22. การจองของฉัน (book_list_user.php) ------------------------------------------- */
.erm-mb { max-width: 980px; }

/* next booking hero */
.erm-mb-next {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(170px, 0.8fr) 1.4fr auto; gap: 20px; align-items: center;
  margin: 4px 0 18px; padding: 22px 150px 22px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(125deg, #0F2747 0%, #123a6e 55%, #0B5ED7 120%);
  box-shadow: 0 18px 40px -18px rgba(11, 94, 215, .55);
  animation: erm-mb-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
.erm-mb-next[hidden] { display: none; }
.erm-mb-next-glow { position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(123, 182, 255, .35), transparent 70%); pointer-events: none; }
.erm-mb-next-when { display: flex; flex-direction: column; gap: 2px; }
.erm-mb-next-kicker { font-size: 12px; letter-spacing: .04em; color: #9FC3F5; }
.erm-mb-next-when strong { font-size: 34px; line-height: 1.1; font-weight: 700; }
.erm-mb-next-when span:last-child { color: #C9DAF2; font-size: 14px; }
.erm-mb-next-time { font-size: 15px; color: #DCE8F8; }
.erm-mb-next-room { font-size: 22px; font-weight: 700; margin: 2px 0; }
.erm-mb-next-subject { color: #C9DAF2; font-size: 14px; margin-bottom: 8px; }
.erm-mb-next-actions { display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.erm-mb-next-actions .btn { white-space: nowrap; border-radius: 10px; font-weight: 600; }
.erm-mb-next-buddy { position: absolute; right: 8px; bottom: -14px; width: 118px; height: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25)); animation: erm-mb-peek 3.6s ease-in-out infinite; pointer-events: none; }

/* toolbar */
.erm-mb-bar { position: sticky; top: var(--appbar-h, 64px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -4px 14px; padding: 10px 4px; background: linear-gradient(var(--background) 80%, transparent); }
.erm-mb-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.erm-mb-tabs::-webkit-scrollbar { display: none; }
.erm-mb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: #334155; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.erm-mb-tab b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #EEF3FA; color: #475569; font-size: 12px; line-height: 20px; text-align: center; }
.erm-mb-tab b:empty { display: none; }
.erm-mb-tab:hover { border-color: #9CC2F5; }
.erm-mb-tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.erm-mb-tab.is-active b { background: rgba(255, 255, 255, .18); color: #fff; }
.erm-mb-tools { display: flex; gap: 8px; align-items: center; }
.erm-mb-search { position: relative; margin: 0; }
.erm-mb-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94A3B8; font-size: 13px; }
.erm-mb-search input { width: 240px; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; background: #fff; }
.erm-mb-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 94, 215, .12); }
.erm-mb-ics-all { height: 36px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; white-space: nowrap; }

/* day headings + cards */
.erm-mb-day { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px 8px; font-size: 15px; font-weight: 700; color: var(--navy); }
.erm-mb-day em { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #E8F1FE; color: var(--primary); }
.erm-mb-card {
  position: relative; display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: start;
  margin-bottom: 10px; padding: 16px 16px 16px 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 39, 71, .04); transition: transform .15s ease, box-shadow .15s ease;
  animation: erm-mb-rise .35s ease both;
}
.erm-mb-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mb-color, var(--primary)); }
.erm-mb-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(15, 39, 71, .35); }
.erm-mb-card.is-flash { animation: erm-mb-flash 1.6s ease; }
.erm-mb-card.is-rejected { opacity: .72; }
.erm-mb-time { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: #F4F8FD; }
.erm-mb-time strong { font-size: 20px; line-height: 1.1; color: var(--navy); }
.erm-mb-time span { font-size: 12px; color: #64748B; }
.erm-mb-time span:empty { display: none; }
.erm-mb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.erm-mb-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.erm-mb-pill.is-approved { background: #DCFCE7; color: #166534; }
.erm-mb-pill.is-pending { background: #FEF3C7; color: #92400E; }
.erm-mb-pill.is-waitlist { background: #E0F2FE; color: #075985; }
.erm-mb-pill.is-cancelreq { background: #FFE4E6; color: #9F1239; }
.erm-mb-pill.is-rejected { background: #F1F5F9; color: #475569; }
.erm-mb-next .erm-mb-pill { background: rgba(255, 255, 255, .16); color: #fff; }
.erm-mb-type { font-size: 12px; color: #64748B; }
.erm-mb-id { margin-left: auto; font-size: 12px; color: #94A3B8; }
.erm-mb-room { margin: 0; font-size: 18px; font-weight: 700; color: #0F172A; }
.erm-mb-subject { margin: 2px 0 0; color: #334155; font-size: 14px; }
.erm-mb-subject small { color: #64748B; }
.erm-mb-detail { margin: 6px 0 0; color: #64748B; font-size: 13px; }
.erm-mb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.erm-mb-chip { padding: 2px 9px; border-radius: 8px; background: #F1F5F9; color: #334155; font-size: 12px; }
.erm-mb-edoc, .erm-mb-zoom { display: inline-flex; gap: 6px; align-items: center; margin: 8px 12px 0 0; font-size: 13px; }
.erm-mb-note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #FFF1F2; color: #9F1239; font-size: 13px; }
.erm-mb-note span { display: block; color: #475569; margin-top: 2px; }
.erm-mb-note.is-info { background: #F0F9FF; color: #075985; }
.erm-mb-actions { display: flex; flex-direction: column; gap: 4px; min-width: 116px; }
.erm-mb-act { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .12s ease; }
.erm-mb-act i { width: 14px; text-align: center; }
.erm-mb-act:hover { background: #EEF4FD; text-decoration: none; }
.erm-mb-act.is-danger { color: #B91C1C; }
.erm-mb-act.is-danger:hover { background: #FEF2F2; }
.erm-mb-more { display: flex; justify-content: center; margin: 12px 0 30px; }

/* empty + loading */
.erm-mb-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: #64748B; }
.erm-mb-empty img { width: 120px; height: auto; margin-bottom: 6px; animation: erm-mb-peek 3.6s ease-in-out infinite; }
.erm-mb-empty h3 { margin: 0; font-size: 18px; color: var(--navy); }
.erm-mb-empty p { margin: 0 0 10px; }
.erm-mb-skeleton { display: grid; gap: 10px; }
.erm-mb-skeleton span { height: 96px; border-radius: 16px; background: linear-gradient(90deg, #EEF3FA 25%, #F7FAFD 50%, #EEF3FA 75%); background-size: 200% 100%; animation: erm-mb-shimmer 1.2s linear infinite; }
.erm-swal-lead { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.erm-swal-sub { font-size: 14px; color: #64748B; }

@keyframes erm-mb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes erm-mb-peek { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes erm-mb-flash { 0%, 100% { box-shadow: 0 1px 2px rgba(15, 39, 71, .04); } 30% { box-shadow: 0 0 0 4px rgba(11, 94, 215, .35); } }
@keyframes erm-mb-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .erm-mb-next, .erm-mb-card, .erm-mb-next-buddy, .erm-mb-empty img, .erm-mb-skeleton span { animation: none !important; }
}

@media (max-width: 767.98px) {
  .erm-mb-next { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .erm-mb-next-when strong { font-size: 28px; }
  .erm-mb-next-actions { flex-direction: row; flex-wrap: wrap; }
  .erm-mb-next-buddy { width: 84px; right: 6px; top: 12px; bottom: auto; }
  .erm-mb-tools { width: 100%; }
  .erm-mb-search { flex: 1; }
  .erm-mb-search input { width: 100%; }
  .erm-mb-card { grid-template-columns: 62px 1fr; gap: 12px; padding: 14px 14px 12px 18px; }
  .erm-mb-time strong { font-size: 17px; }
  .erm-mb-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; padding-top: 8px; border-top: 1px dashed var(--border); }
  .erm-mb-act { height: 34px; background: #F4F8FD; }
  .erm-mb-act.is-danger { background: #FEF2F2; }
}

/* 23. Sign-in dialog (PSU SSO + legacy PSU Passport) -------------------------------- */
.erm-login-modal .modal-content { position: relative; border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(15, 39, 71, .45); }
.erm-login-modal .modal-body { padding: 28px 28px 24px; }
.erm-login-close { position: absolute; top: 12px; right: 16px; z-index: 2; }
.erm-login-hero { margin: -28px -28px 20px; padding: 26px 24px 20px; text-align: center; color: #fff; background: linear-gradient(135deg, #0F2747 0%, #123a6e 60%, #0B5ED7 130%); }
.erm-login-hero img { width: 96px; height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); animation: erm-mb-peek 3.6s ease-in-out infinite; }
.erm-login-hero h4 { margin: 8px 0 4px; font-size: 22px; font-weight: 700; color: #fff; }
.modal-open .erm-ai { display: none; }
.erm-login-hero p { margin: 0; color: #C9DAF2; font-size: 14px; }
.erm-login-modal .erm-login-close { color: #fff; opacity: .8; text-shadow: none; }
.erm-sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 20px -12px rgba(11, 94, 215, .8); }
.erm-sso-hint { margin: 10px 2px 0; font-size: 13px; color: #64748B; text-align: center; }
.erm-legacy-login { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.erm-legacy-login summary { cursor: pointer; font-size: 14px; color: #475569; text-align: center; list-style: none; }
.erm-legacy-login summary::-webkit-details-marker { display: none; }
.erm-legacy-login summary::after { content: " \25BE"; }
.erm-legacy-login[open] summary { margin-bottom: 12px; }
.erm-login-form .form-control-lg { border-radius: 10px; font-size: 16px; }
.erm-login-form .btn-lg { border-radius: 10px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .erm-login-hero img { animation: none; } }

/* 24. สถิติการใช้ห้อง (dashboard_admin.php) + staff booking modal ------------------ */
.erm-stats.is-loading .erm-kpis, .erm-stats.is-loading .erm-stats-grid { opacity: .55; transition: opacity .2s; }
.erm-stats-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.erm-stats-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--navy); }
.erm-stats-title i { color: var(--primary); margin-right: 6px; }
.erm-stats-sub { margin: 2px 0 0; color: #64748B; }
.erm-stats-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.erm-stats-filter label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #475569; font-weight: 600; }
.erm-stats-filter .form-control-sm { height: 34px; width: auto; }
.erm-stats-quick { display: inline-flex; gap: 4px; }
.erm-stats-quick .btn { border: 1px solid var(--border); background: #fff; }
.erm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.erm-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15, 39, 71, .04); animation: erm-mb-rise .35s ease both; }
.erm-kpi i { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 18px; }
.erm-kpi b { display: block; font-size: 24px; line-height: 1.1; color: #0F172A; }
.erm-kpi span { font-size: 13px; color: #64748B; }
.erm-kpi.is-blue i { background: #E8F1FE; color: #0B5ED7; }
.erm-kpi.is-green i { background: #DCFCE7; color: #16A34A; }
.erm-kpi.is-amber i { background: #FEF3C7; color: #B45309; }
.erm-kpi.is-cyan i { background: #E0F2FE; color: #0891B2; }
.erm-kpi.is-pink i { background: #FCE7F3; color: #DB2777; }
.erm-kpi.is-navy i { background: #E2E8F0; color: #0F2747; }
.erm-kpi.is-violet i { background: #EDE9FE; color: #7C3AED; }
.erm-kpi.is-slate i { background: #F1F5F9; color: #475569; }
.erm-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.erm-stats-grid .erm-span-2 { grid-column: 1 / -1; }
.erm-stats-card { margin: 0; }
.erm-stats-card .card-body { position: relative; min-height: 240px; }
.erm-rank { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.erm-rank li { display: grid; grid-template-columns: 22px minmax(0, 1.4fr) 1fr 44px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #EEF2F7; font-size: 14px; }
.erm-rank li::before { counter-increment: r; content: counter(r); font-weight: 700; color: #94A3B8; }
.erm-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erm-rank-bar { height: 8px; border-radius: 99px; background: #EEF3FA; overflow: hidden; }
.erm-rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0B5ED7, #60A5FA); }
.erm-rank b { text-align: right; color: var(--navy); }
.erm-bk-summary { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: #F4F8FD; font-size: 14px; }
.erm-bk-summary strong { color: var(--navy); }
.erm-zoom-link { margin-bottom: 12px; }
@media (max-width: 991.98px) { .erm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .erm-stats-grid { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) { .erm-kpi b { font-size: 20px; } .erm-rank li { grid-template-columns: 22px 1fr 40px; } .erm-rank-bar { display: none; } }

/* 25. Satisfaction survey (น้องฟัน pop-up, manage_survey.php) + advance-booking note ----------- */
.erm-advance-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 4px; padding: 8px 12px; border-radius: 10px; background: #FFF8EB; border: 1px solid #FAD99B; color: #7C4A03; font-size: 13.5px; }
.erm-survey .modal-content { overflow: hidden; border: 0; border-radius: 20px; }
.erm-survey-hero { display: flex; align-items: flex-end; gap: 16px; padding: 22px 26px 16px; background: linear-gradient(135deg, #EAF2FF 0%, #F7FAFF 55%, #FFF7E8 100%); border-bottom: 1px solid var(--border); }
.erm-survey-mascot { width: 104px; height: auto; flex: none; animation: erm-bob 2.6s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(15,39,71,.18)); }
.erm-survey-bubble { position: relative; flex: 1; padding: 14px 18px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card, 0 6px 18px rgba(15,39,71,.08)); }
.erm-survey-bubble::before { content: ''; position: absolute; left: -9px; bottom: 22px; width: 16px; height: 16px; background: #fff; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.erm-survey-bubble small { color: var(--primary); font-weight: 700; }
.erm-survey-bubble h4 { margin: 2px 0 4px; font-size: 19px; font-weight: 700; color: var(--navy); }
.erm-survey-bubble p { margin: 0; color: var(--text-muted); font-size: 14px; }
.erm-sv-type { padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 14px; background: #FBFDFF; }
.erm-sv-type:last-child { margin-bottom: 0; }
.erm-sv-type header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.erm-sv-type h5 { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); }
.erm-sv-type h5 i { color: var(--primary); }
.erm-sv-type header span { color: var(--text-muted); font-size: 13px; }
.erm-sv-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 9px 0; border-top: 1px dashed var(--border); }
.erm-sv-question { flex: 1 1 280px; font-size: 14.5px; color: #1E293B; }
.erm-sv-rate { display: inline-flex; align-items: center; gap: 2px; }
.erm-sv-star { margin: 0; padding: 2px 3px; cursor: pointer; font-size: 26px; line-height: 1; color: #D6DEE9; transition: transform .12s ease, color .12s ease; }
.erm-sv-star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.erm-sv-star.is-on { color: #F5B301; }
.erm-sv-star.is-hover { color: #FFC83D; transform: scale(1.15); }
.erm-sv-star:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.erm-sv-word { min-width: 72px; margin-left: 8px; font-size: 13px; font-weight: 600; color: #B45309; }
.erm-survey .modal-footer { flex-wrap: wrap; }
.erm-survey-error { flex: 1 1 100%; margin: 0; color: var(--danger, #DC2626); font-size: 13.5px; }
.erm-survey-error:empty { display: none; }
@keyframes erm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 575.98px) { .erm-survey-mascot { width: 72px; } .erm-survey-hero { padding: 16px; } .erm-sv-star { font-size: 30px; } }

.erm-sv-tabs { margin-bottom: 16px; gap: 6px; }
.erm-sv-help { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.erm-sv-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.erm-sv-stars-mini { color: #F5B301; letter-spacing: -1px; font-size: 12px; }
.erm-sv-range { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.erm-sv-range label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.erm-sv-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.erm-sv-kpi { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.erm-sv-kpi small { display: block; color: var(--text-muted); }
.erm-sv-kpi b { font-size: 28px; font-weight: 800; color: var(--navy); margin-right: 6px; }
.erm-sv-kpi-main { background: linear-gradient(135deg, #FFF8E1, #FFFFFF); border-color: #F7DC8C; }
.erm-sv-dist div { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 6px; font-size: 12.5px; }
.erm-sv-dist i { height: 7px; border-radius: 9px; background: #EEF2F7; overflow: hidden; }
.erm-sv-dist em { display: block; height: 100%; background: #F5B301; }
.erm-sv-stars { position: relative; display: inline-block; color: #D6DEE9; letter-spacing: 1px; font-size: 16px; line-height: 1; }
.erm-sv-stars span { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #F5B301; }
.erm-sv-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 991.98px) { .erm-sv-grid { grid-template-columns: 1fr; } }
.erm-sv-q { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line, #EEF2F7); }
.erm-sv-q:last-child { border-bottom: 0; }
.erm-sv-q-text { flex: 1 1 260px; }
.erm-sv-comments { max-height: 460px; overflow: auto; }
.erm-sv-comments blockquote { margin: 0 0 10px; padding: 10px 12px; border-left: 3px solid #F5B301; background: #FFFCF3; border-radius: 0 10px 10px 0; }
.erm-sv-comments blockquote p { margin: 0 0 4px; white-space: pre-line; }
.erm-sv-comments footer { color: var(--text-muted); font-size: 12.5px; }

/* 26. Room set to งดใช้: no bookings from its row */
.erm-schedule tr.erm-room-closed td.erm-slot-free { background: repeating-linear-gradient(135deg, #F4F6FA 0 8px, #ECEFF5 8px 16px) !important; cursor: not-allowed; }
.erm-schedule tr.erm-room-closed td:first-child .btn::after { content: ' · งดใช้'; font-size: 11px; font-weight: 600; }

/* 27. E-mail opt-in (user_edit.php) */
.erm-notify-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid #CFE0F7; border-radius: 14px; background: linear-gradient(135deg, #F4F8FD, #FFFFFF); }
.erm-notify-icon { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #EAF2FF; color: var(--primary); font-size: 20px; }
.erm-notify-body { display: flex; flex-direction: column; gap: 8px; }
.erm-notify-body > strong { color: var(--navy); font-size: 15.5px; }
.erm-switch { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.erm-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.erm-switch-track { position: relative; flex: none; width: 44px; height: 24px; border-radius: 99px; background: #CBD5E1; transition: background .15s ease; }
.erm-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.erm-switch input:checked + .erm-switch-track { background: var(--primary); }
.erm-switch input:checked + .erm-switch-track::after { transform: translateX(20px); }
.erm-switch input:focus-visible + .erm-switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.erm-switch input:disabled + .erm-switch-track { opacity: .6; }

.erm-mb-pill.is-cancelled { background: #F1F5F9; color: #475569; text-decoration: line-through; }
.erm-mb-pill.is-cancelled { background: #F1F5F9; color: #475569; }
.erm-mb-card.is-cancelled { opacity: .85; }
.erm-mb-card.is-cancelled .erm-mb-room { text-decoration: line-through; text-decoration-color: #94A3B8; }
.erm-mb-note.is-cancelled { background: #F1F5F9; border-color: #CBD5E1; color: #334155; }
.erm-request-when { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
