@charset "UTF-8";
/* ── Google Fonts ──────────────────────────────────────── */
/* @import ของ Google Fonts ถูกเอาออก — เครือข่ายของ Siamtaco ไม่ให้ยิงออกนอก
   ฟอนต์ย้ายไปโหลดจากเครื่องเราที่ public/assets/css/stc-fonts.css แทน
   (จาก 6 ตระกูลที่ต้นฉบับ import มา ใช้จริงแค่ Sarabun ตัวเดียว) */

:root {
  --font: "Sarabun", sans-serif;
  --bg-app: #070a16;
  --bg-dock: #05070e;
  --bg-nav: #0b0e1c;
  --bg-topbar: rgba(7, 10, 22, 0.9);
  --bg-card: #101424;
  --bg-input: #151928;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(99, 102, 241, 0.14);
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-soft: rgba(99, 102, 241, 0.12);
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.12);
  --pink: #ec4899;
  --pink-soft: rgba(236, 72, 153, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.12);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.12);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --text-1: #eef0ff;
  --text-2: #8389b0;
  --text-3: #454867;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.035);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --dock-w: 68px;
  --nav-w: 240px;
  --topbar-h: 58px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --slate-soft: rgba(148, 163, 184, 0.12);
  --gray-soft: rgba(148, 163, 184, 0.12);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-dock: #ffffff;
  --bg-nav: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.95);
  --bg-card: #ffffff;
  --bg-input: #f8faff;
  --bg-hover: rgba(99, 102, 241, 0.05);
  --bg-active: rgba(99, 102, 241, 0.1);
  --text-1: #0e1124;
  --text-2: #525879;
  --text-3: #9198b8;
  --border: rgba(0, 0, 0, 0.07);
  --border-2: rgba(0, 0, 0, 0.035);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  font-weight: 300;
  background-color: var(--bg-app);
  background-image:
    radial-gradient(
      ellipse 65% 55% at 0% 0%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 55% 45% at 100% 5%,
      rgba(139, 92, 246, 0.07) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 40% 35% at 50% 100%,
      rgba(20, 184, 166, 0.04) 0%,
      transparent 50%
    );
  color: var(--text-1);
  overflow: hidden;
  height: 100vh;
  transition:
    background-color 0.3s,
    color 0.3s;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(
      ellipse 65% 55% at 0% 0%,
      rgba(99, 102, 241, 0.055) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 55% 45% at 100% 0%,
      rgba(139, 92, 246, 0.04) 0%,
      transparent 50%
    );
}

.container-fluid {
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0px 0px 28px rgba(0, 0, 0, 0.05);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

::-webkit-scrollbar {
  width: 3px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: 99px;
}

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}

/* LOADER */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b0d17;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  transition:
    opacity 0.5s,
    visibility 0.5s;
}

#loader.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.l-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 28px var(--accent-glow);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.l-brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-2);
  text-transform: uppercase;
}

.l-brand span {
  color: var(--accent);
}

/* SHELL */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* DOCK */
.dock {
  width: var(--dock-w);
  height: 100vh;
  background: var(--bg-dock);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  z-index: 200;
  flex-shrink: 0;
  position: relative;
}

.dock::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    transparent
  );
  pointer-events: none;
}

.dock-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform 0.2s var(--spring);
}

.dock-logo:hover {
  transform: scale(1.08) rotate(-4deg);
}

.dock-hr {
  width: 26px;
  height: 1px;
  background: var(--border);
  margin: 6px 0;
  flex-shrink: 0;
}

.dock-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s var(--spring);
}

.dock-btn:hover {
  transform: scale(1.12) translateX(2px);
}

.dock-btn.active {
  transform: scale(1.04);
}

.dock-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease);
  overflow: hidden;
}

.dock-icon .ms {
  font-size: 20px;
}

.dock-btn.active .dock-icon {
  background: var(--app-color, var(--accent-soft));
  border-color: var(--app-color-border, var(--accent));
  color: var(--app-color-text, var(--accent));
  box-shadow:
    0 0 0 2px var(--app-color-border, var(--accent)),
    0 0 16px var(--app-glow, var(--accent-glow));
}

.dock-btn:hover .dock-icon {
  background: var(--app-color, var(--bg-hover));
  border-color: var(--app-color-border, var(--border));
  color: var(--app-color-text, var(--text-1));
}

.dock-btn.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--app-color-text, var(--accent));
  box-shadow: 0 0 10px var(--app-glow, var(--accent-glow));
  animation: sideIn 0.3s var(--spring) forwards;
}

@keyframes sideIn {
  from {
    transform: translateY(-50%) scaleY(0);
  }

  to {
    transform: translateY(-50%) scaleY(1);
  }
}

.dock-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--rose);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  box-shadow:
    0 0 0 0 rgba(244, 63, 94, 0.7),
    0 0 0 0 rgba(244, 63, 94, 0.4);
  animation: dock-pulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* Color Variations for Glow */
.dock-badge.am {
  background: var(--amber);
  box-shadow:
    0 0 0 0 rgba(245, 158, 11, 0.7),
    0 0 0 0 rgba(245, 158, 11, 0.4);
  animation: dock-pulse-am 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes dock-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(244, 63, 94, 0.7),
      0 0 0 0 rgba(244, 63, 94, 0.4);
  }

  70% {
    box-shadow:
      0 0 0 10px rgba(244, 63, 94, 0),
      0 0 0 20px rgba(244, 63, 94, 0);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(244, 63, 94, 0),
      0 0 0 0 rgba(244, 63, 94, 0);
  }
}

@keyframes dock-pulse-am {
  0% {
    box-shadow:
      0 0 0 0 rgba(245, 158, 11, 0.7),
      0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  70% {
    box-shadow:
      0 0 0 10px rgba(245, 158, 11, 0),
      0 0 0 20px rgba(245, 158, 11, 0);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(245, 158, 11, 0),
      0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.dock-tip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px) scale(0.93);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow-md);
  transition: all 0.16s var(--ease);
  z-index: 9999;
}

.dock-tip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--bg-card);
}

.dock-btn:hover .dock-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}

.dock-spacer {
  flex: 1;
}

.dock-add {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px dashed var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 18px;
  transition: all 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.dock-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(90deg) scale(1.05);
}

/* SIDE NAV */
.side-nav {
  width: var(--nav-w);
  height: 100vh;
  background: var(--bg-nav);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition:
    width 0.38s var(--ease),
    opacity 0.3s var(--ease),
    transform 0.38s var(--ease);
  z-index: 190;
  position: relative;
}

/* Subtle ambient glow on the right edge */
.side-nav::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 5%,
    var(--nav-accent, var(--accent)) 50%,
    transparent 95%
  );
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s;
}

.side-nav.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

.side-nav.collapsed::before {
  opacity: 0;
}

.nav-head {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.03) 0%,
    transparent 100%
  );
}

.nav-head::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--nav-accent, var(--accent)),
    transparent
  );
  opacity: 0.45;
  transition: opacity 0.3s;
}

.side-nav:hover .nav-head::after {
  opacity: 0.7;
}

.nav-head-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease);
}

.nav-head-icon .ms {
  font-size: 18px;
}

.nav-head-title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: all 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-head-pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.3s;
}

.nav-ws {
  margin: 10px 12px 4px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.nav-ws:hover {
  border-color: var(--accent);
}

.ws-dot {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ws-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding-top: 4px;
}

/* Panel animation */
.nav-panel {
  position: absolute;
  inset: 0;
  padding: 0 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.nav-panel.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
  position: relative;
}

.nav-panel.exit-left {
  opacity: 0;
  transform: translateX(-16px);
  transition:
    opacity 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.nav-sect {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 13px 8px 5px;
  white-space: nowrap;
}

.ni {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 1rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  margin-bottom: 2px;
}

.ni:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  transform: translateX(4px);
}

.ni.active {
  background: var(--bg-active);
  color: var(--text-1);
  font-weight: 600;
}

.ni.active .ni-ico {
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--nav-accent, var(--accent)),
    var(--accent-2)
  );
  box-shadow: 0 3px 10px var(--nav-accent-glow, var(--accent-glow));
}

.ni.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 55%;
  border-radius: 0 3px 3px 0;
  background: var(--nav-accent, var(--accent));
  box-shadow: 0 0 10px var(--nav-accent-glow, var(--accent-glow));
  animation: navIndicator 0.3s var(--spring) forwards;
}

@keyframes navIndicator {
  from {
    transform: translateY(-50%) scaleY(0);
  }
  to {
    transform: translateY(-50%) scaleY(1);
  }
}

.ni-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: var(--bg-input);
  border: 1px solid var(--border-2);
  flex-shrink: 0;
  transition: all 0.22s var(--ease);
}

.ni-ico .ms {
  font-size: 18px;
}

.ni:hover .ni-ico {
  color: var(--nav-accent, var(--accent));
  border-color: var(--nav-accent, var(--accent));
  transform: scale(1.08);
}

.ni.active .ni-ico {
  border-color: transparent;
}

.ni-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.5;
  flex-shrink: 0;
}

.ni-badge.a {
  background: var(--accent);
  color: #fff;
}

.ni-badge.w {
  background: var(--amber);
  color: #0d0f1a;
}

.ni-badge.i {
  background: var(--sky);
  color: #0d0f1a;
}

.ni-badge.s {
  background: var(--emerald);
  color: #fff;
}

.ni-badge.d {
  background: var(--rose);
  color: #fff;
}

.ni-badge.new {
  background: var(--emerald);
  color: #fff;
}

.ni-arrow {
  font-size: 14px;
  color: var(--text-3);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ni[aria-expanded="true"] .ni-arrow {
  transform: rotate(90deg);
}

.ni-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s var(--ease);
}

.ni-sub.open {
  max-height: 500px;
}

.ni-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 40px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.13s;
  text-decoration: none;
  margin-bottom: 1px;
}

.ni-sub-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  transition:
    background 0.13s,
    transform 0.13s;
}

.ni-sub-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.ni-sub-item:hover::before {
  background: var(--nav-accent, var(--accent));
  transform: scale(1.5);
}

.ni-sub-item.active {
  color: var(--nav-accent, var(--accent));
  font-weight: 500;
}

.ni-sub-item.active::before {
  background: var(--nav-accent, var(--accent));
  transform: scale(1.5);
}

.status-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--emerald);
}

.nav-foot {
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.14s;
  text-decoration: none;
}

.nav-user:hover {
  background: var(--bg-hover);
}

.nu-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.nu-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-1);
}

.nu-role {
  font-size: 0.65rem;
  color: var(--text-3);
}

.nu-more {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-3);
}

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0;
  left: calc(var(--dock-w) + var(--nav-w));
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 10px;
  z-index: 150;
  transition:
    left 0.32s var(--ease),
    box-shadow 0.3s;
}

.topbar.nav-closed {
  left: var(--dock-w);
}

.tb-tog {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  cursor: pointer;
}

.tb-tog:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tb-tog:active {
  transform: scale(0.95);
}

.tb-tog .ms {
  font-size: 22px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-tog:hover .ms {
  transform: rotate(-10deg);
}

.topbar:not(.nav-closed) .tb-tog .ms {
  transform: rotate(180deg);
}

.tb-bc {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-3);
}

.tb-bc a {
  color: var(--accent);
  font-weight: 500;
}

.tb-bc .sep {
  font-size: 10px;
}

.tb-bc .cur {
  color: var(--text-1);
  font-weight: 600;
}

.tb-spacer {
  flex: 1;
}

.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 34px;
  width: 210px;
  cursor: text;
  transition: all 0.2s;
  color: var(--text-3);
  font-size: 0.9rem;
}

.tb-search:hover {
  border-color: var(--accent);
}

.tb-search .ms {
  font-size: 16px;
}

.tb-hint {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--text-3);
}

.tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

.tb-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tb-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: all 0.14s;
}

.tb-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.tb-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 14px;
  height: 14px;
  background: var(--rose);
  color: #fff;
  font-size: 0.54rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-topbar);
}

.tb-theme {
  width: 46px;
  height: 24px;
  border-radius: 99px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
}

[data-theme="dark"] .tb-theme {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
}

.tb-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  position: absolute;
  top: 50%;
  left: 1.1px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--amber);
  transition:
    transform 0.3s var(--spring),
    background 0.3s;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .tb-thumb {
  transform: translateY(-50%) translateX(22px);
  background: var(--accent);
  color: #fff;
}

.tb-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s;
}

.tb-profile:hover {
  border-color: var(--accent);
}

.tb-profile img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.tb-pname {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

/* DROPDOWNS */
.dd-wrap {
  position: relative;
}

.dd {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 270px;
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.18s var(--ease);
  transform-origin: top right;
}

.dd.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.dd-h {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dd-h h6 {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
}

.dd-h a {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
}

.dd-f {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.dd-f a {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dd-scroll {
  max-height: 290px;
  overflow-y: auto;
}

.ni2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  transition: background 0.12s;
}

.ni2:hover {
  background: var(--bg-hover);
}

.ni2.unread {
  background: rgba(99, 102, 241, 0.04);
}

.ni2-ico {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.ni2-ico.s {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.ni2-ico.w {
  background: var(--amber-soft);
  color: var(--amber);
}

.ni2-ico.d {
  background: var(--rose-soft);
  color: var(--rose);
}

.ni2-ico.i {
  background: var(--sky-soft);
  color: var(--sky);
}

.ni2-ico.p {
  background: var(--accent-soft);
  color: var(--accent);
}

.ni2-body {
  flex: 1;
  overflow: hidden;
}

.ni2-title {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni2-msg {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni2-t {
  font-size: 0.63rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.mi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}

.mi:hover {
  background: var(--bg-hover);
}

.mi-ava {
  position: relative;
  flex-shrink: 0;
}

.mi-ava img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.mi-online {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.mi-info {
  flex: 1;
  overflow: hidden;
}

.mi-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-1);
}

.mi-pre {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-t {
  font-size: 0.63rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.pd-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-head img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.pd-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
}

.pd-email {
  font-size: 0.8rem;
  color: var(--text-3);
}

.pdi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: all 0.12s;
  text-decoration: none;
}

.pdi:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.pdi .ms {
  font-size: 16px;
  color: var(--text-3);
}

.pdi:hover .ms {
  color: var(--accent);
}

.pdi.danger {
  color: var(--rose);
}

.pdi.danger .ms {
  color: var(--rose);
}

.pdi.danger:hover {
  background: var(--rose-soft);
}

.pd-div {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* SEARCH */
.search-ov {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.search-ov.open {
  opacity: 1;
  visibility: visible;
}

.search-box {
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--shadow-lg),
    0 0 60px var(--accent-glow);
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s var(--spring);
}

.search-ov.open .search-box {
  transform: scale(1) translateY(0);
}

.sb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.sb-top .ms {
  color: var(--accent);
  font-size: 20px;
}

.sb-top input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-1);
  outline: none;
  font-family: var(--font);
}

.sb-top input::placeholder {
  color: var(--text-3);
}

.sb-esc {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-3);
  background: var(--bg-input);
  cursor: pointer;
}

.sb-body {
  padding: 14px;
  max-height: 380px;
  overflow-y: auto;
}

.sb-sect {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  margin-top: 14px;
}

.sb-sect:first-child {
  margin-top: 0;
}

.sb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 7px;
}

.sb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 10px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.14s;
  text-align: center;
  text-decoration: none;
  color: var(--text-2);
}

.sb-card:hover,
.sb-card.sel {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-1);
  transform: translateY(-2px);
}

.sb-ci {
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 7px;
}

.sb-cn {
  font-size: 0.8rem;
  font-weight: 500;
}

.sb-foot {
  display: flex;
  gap: 14px;
  padding: 9px 18px;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
  font-size: 0.66rem;
  color: var(--text-3);
}

.sb-foot kbd {
  background: #000000;
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font);
  margin-right: 3px;
}

/* MAIN */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-body {
  flex: 1;
  padding: calc(var(--topbar-h) + 10px) 24px 5px;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 52px;
  text-align: center;
  width: 100%;
  height: 100%;
  animation: fadeUp 0.55s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wc-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 30px;
  color: #fff;
  box-shadow: 0 8px 28px var(--accent-glow);
}

/* Mobile */
.mob-ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 170;
  backdrop-filter: blur(2px);
}

@media (max-width: 900px) {
  .side-nav {
    position: fixed;
    left: var(--dock-w);
    top: 0;
    bottom: 0;
    z-index: 180;
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease);
    width: var(--nav-w) !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .side-nav.mobile-open {
    transform: translateX(0);
  }

  .topbar {
    left: var(--dock-w) !important;
  }

  .mob-ov {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .mob-ov.show {
    opacity: 1;
    pointer-events: all;
  }

  .tb-pname {
    display: none;
  }

  .tb-search {
    width: 150px;
  }
}

/* ═══ FOOTER ═══ */
.site-footer {
  margin-top: auto;
  background: var(--bg-nav);
  overflow: hidden;
  flex-shrink: 0;
}

@keyframes ft-shimmer {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 300% 0;
  }
}

/* Bottom bar */
.ft-bottom {
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ft-copy {
  font-size: 0.75rem;
  color: var(--text-3);
}

.ft-copy a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@keyframes ft-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.ft-bottom-links {
  display: flex;
  gap: 4px;
}

.ft-bottom-links a {
  font-size: 0.75rem;
  color: var(--text-3);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.14s;
}

.ft-bottom-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 768px) {
  .ft-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 12px 16px;
  }
}

.check-val {
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  width: fit-content;
}

.chk-ok {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.chk-close {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.msr {
  font-family: "Material Symbols Rounded";
  font-variation-settings:
    "FILL" 1,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.ms-16 {
  font-size: 16px;
}

.ms-20 {
  font-size: 20px;
}

.ms-28 {
  font-size: 28px;
}

.ms-40 {
  font-size: 40px;
}

/* ════════════════════════════════════════════════
   BOOTSTRAP CARD — Premium Web App Override
   ════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 4px 18px rgba(0, 0, 0, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  color: var(--text-1);
  overflow: hidden;
  transition:
    box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

[data-theme="light"] .card {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.07),
    0 4px 18px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

[data-theme="light"] .card-header {
  background: rgba(0, 0, 0, 0.02);
}

.card-body {
  padding: 1.5rem;
  color: var(--text-1);
}

.card-footer {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-2);
}

[data-theme="light"] .card-footer {
  background: rgba(0, 0, 0, 0.015);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.35rem;
  letter-spacing: -0.015em;
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 400;
  margin-top: 0;
}

.card-text {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── START CSS: Select2 ── */
/* =========================================
           SHOWCASE CARD SYSTEM
           ========================================= */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.ui-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.05);
  border: 1px solid #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease;
}

.ui-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Card Header */
.ui-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.ui-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #1e293b;
}

/* Copy Button */
.btn-icon-action {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-action:hover {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #4f46e5;
}

/* Card Body & Tabs */
.ui-card-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.ui-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 24px;
  width: fit-content;
}

.ui-tab-link {
  background: none;
  border: none;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s;
}

.ui-tab-link.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- REDESIGNED CODE WINDOW --- */
.code-window {
  background: #1e293b;
  /* Slate 800 */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #334155;
  display: none;
  /* Hidden by default */
}

.code-window.active {
  display: block;
}

.window-header {
  background: #0f172a;
  /* Slate 900 */
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: #ef4444;
}

.dot.yellow {
  background: #f59e0b;
}

.dot.green {
  background: #10b981;
}

.window-lang {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: monospace;
}

.code-content {
  padding: 20px;
  margin: 0;
  color: #e2e8f0;
  font-family: monospace;
  /* Fallback monospace */
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Syntax Highlighting Simulation */
.tag-name {
  color: #f472b6;
}

/* Pink */
.attr-name {
  color: #38bdf8;
}

/* Blue */
.attr-val {
  color: #a3e635;
}

/* Green */
.angle {
  color: #94a3b8;
}

/* Gray */

/* Preview Area */
.preview-view {
  display: none;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-view.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
           SELECT2 PREMIUM CSS OVERRIDES
========================================= */

/* 1. Main Container */
.select2-container {
  width: 100% !important;
}

.select2-container .select2-selection--single {
  min-height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background-color: #ffffff;
  /* select2-bootstrap-5-theme draws its own native-look chevron as a
     background-image here; we draw our own via .select2-selection__arrow
     below, so switch the theme's off to avoid a double arrow. */
  background-image: none;
  /* The theme also pads this box itself (~10.5px/31.5px) to leave room for
     that same chevron, mimicking Bootstrap's .form-select. We lay out
     __rendered/__arrow as flex children with their own padding/margin
     instead, so zero this out — otherwise both paddings stack and the box
     ends up with a big dead gap on both sides. */
  padding: 0;
  display: flex;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  /* Without this, a long selected label overflows past the box instead of
     shrinking to it — flex items default to min-width:auto (content size). */
  min-width: 0;
}

/* Focus State */
.select2-container--open .select2-selection--single {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Text Styling — a long selected label truncates with an ellipsis instead
   of overflowing the box or breaking the table layout it sits in.
   .select2-selection--single is display:flex (for vertical centering), so
   __rendered and __arrow lay out as normal flex siblings, not as the
   absolutely-positioned overlay select2's default theme assumes — __rendered
   flex-grows to fill the row and __arrow stays a fixed-size item at the end,
   instead of each reserving dead space for the other. */
.select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 14px;
  padding-right: 4px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  line-height: 38px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
  color: #64748b;
}

/* Arrow Icon */
.select2-container .select2-selection--single .select2-selection__arrow {
  flex: 0 0 auto;
  height: 38px;
  width: 24px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
  display: none;
}

/* 2. Dropdown Panel */
.select2-dropdown {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  margin-top: 8px;
  overflow: hidden;
  z-index: 9999;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3. Search Box */
.select2-search--dropdown {
  padding: 10px;
}

.select2-search__field {
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 10px 12px 10px 40px !important;
  font-size: 14px;
  background-color: #f8fafc;
  outline: none !important;
  /* Search Icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 20px;
}

.select2-search__field:focus {
  border-color: #4f46e5 !important;
  background-color: #ffffff;
}

/* 4. Options List */
.select2-results__option {
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #1e293b;
  transition: 0.1s;
}

.select2-container--default
  .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap-5
  .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

.select2-container--default .select2-results__option--selected,
.select2-container--bootstrap-5 .select2-results__option--selected {
  background-color: #f1f5f9;
  font-weight: 600;
  position: relative;
}

.select2-container--default .select2-results__option--selected::after,
.select2-container--bootstrap-5 .select2-results__option--selected::after {
  float: right;
  color: #4f46e5;
  font-weight: bold;
}

/* --- Helper Classes for Custom Templates --- */
.s2-flex-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* The label span (icon templates render icon + text as siblings) —
   truncate just the text so a long department/option name doesn't
   push the icon out or overflow the select box. */
.s2-flex-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.s2-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.s2-icon-main {
  font-size: 22px;
  color: #64748b;
}

.s2-flag-img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

/* 5. Multi-Select (Tags & Taggable Select) */
.select2-container .select2-selection--multiple {
  min-height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background-color: #ffffff;
  padding: 3px 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.select2-container--open .select2-selection--multiple {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.select2-container .select2-selection--multiple .select2-selection__choice {
  margin: 0;
  padding: 3px 8px 3px 10px;
  border: none;
  border-radius: 20px;
  background-color: #eef2ff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.select2-container
  .select2-selection--multiple
  .select2-selection__choice__remove {
  border: none;
  color: #818cf8;
  font-weight: 700;
  margin: 0;
  order: 2;
}

.select2-container
  .select2-selection--multiple
  .select2-selection__choice__remove:hover {
  color: #4f46e5;
  background: transparent;
}

.select2-container .select2-selection--multiple .select2-search__field {
  border: none !important;
  background: none !important;
  padding: 6px 4px !important;
  min-height: 30px;
}

/* Toast */
.toast-box {
  position: fixed;
  top: 30px;
  right: 30px;
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-100px);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-box.show {
  transform: translateY(0);
}

/* END CSS: SELECT2 */

/* START CSS: BUTTONS */

/* Base Reset */
.btn {
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-size: 14px;
}

.btn:active {
  transform: scale(0.96);
}

/* 1. Solid Buttons */
.btn-primary-saas {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-primary-saas:hover {
  background: #4338ca;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(79, 70, 229, 0.4);
}

.btn-secondary-saas {
  background: #334155;
  color: #fff;
  box-shadow: 0 4px 10px rgba(51, 65, 85, 0.3);
}

.btn-secondary-saas:hover {
  background: #1e293b;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(51, 65, 85, 0.4);
}

.btn-success-saas {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-success-saas:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(16, 185, 129, 0.4);
}

.btn-danger-saas {
  background: #f43f5e;
  color: #fff;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3);
}

.btn-danger-saas:hover {
  background: #e11d48;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(244, 63, 94, 0.4);
}

.btn-warning-saas {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.btn-warning-saas:hover {
  background: #d97706;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(245, 158, 11, 0.4);
}

.btn-info-saas {
  background: #06b6d4;
  color: #fff;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}

.btn-info-saas:hover {
  background: #0891b2;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

.btn-dark-saas {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.btn-dark-saas:hover {
  background: #000000;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(15, 23, 42, 0.4);
}

/* 2. Soft Buttons (Tinted) */
.btn-soft-primary {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid transparent;
}

.btn-soft-primary:hover {
  background: #4f46e5;
  color: #fff;
}

.btn-soft-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
}

.btn-soft-secondary:hover {
  background: #475569;
  color: #fff;
}

.btn-soft-success {
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid transparent;
}

.btn-soft-success:hover {
  background: #10b981;
  color: #fff;
}

.btn-soft-danger {
  background: #fff1f2;
  color: #f43f5e;
  border: 1px solid transparent;
}

.btn-soft-danger:hover {
  background: #f43f5e;
  color: #fff;
}

.btn-soft-warning {
  background: #fffbeb;
  color: #f59e0b;
  border: 1px solid transparent;
}

.btn-soft-warning:hover {
  background: #f59e0b;
  color: #fff;
}

.btn-soft-info {
  background: #ecfeff;
  color: #06b6d4;
  border: 1px solid transparent;
}

.btn-soft-info:hover {
  background: #06b6d4;
  color: #fff;
}

/* 3. Gradient Buttons */
.btn-gradient-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.btn-gradient-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.45);
}

.btn-gradient-dark {
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

.btn-gradient-dark:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.4);
}

/* 4. Outline Buttons */
.btn-outline-primary {
  background: #fff;
  border: 1px solid #4f46e5;
  color: #4f46e5;
}

.btn-outline-primary:hover {
  background: #eef2ff;
  color: #000000 !important;
}

.btn-outline-saas {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.btn-outline-saas:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #334155;
}

.btn-outline-success {
  background: #fff;
  border: 1px solid #10b981;
  color: #10b981;
}

.btn-outline-success:hover {
  background: #ecfdf5;
}

.btn-outline-danger {
  background: #fff;
  border: 1px solid #f43f5e;
  color: #f43f5e;
}

.btn-outline-danger:hover {
  background: #fbdde2;
  color: #000000 !important;
}

.btn-outline-info {
  background: #fff;
  border: 1px solid #06b6d4;
  color: #06b6d4;
}

.btn-outline-info:hover {
  background: #ecfeff;
}

.btn-outline-secondary {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.btn-outline-secondary:hover {
  background: #f8fafc;
  color: #000000 !important;
}

.btn-outline-warning {
  background: #fff;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.btn-outline-warning:hover {
  background: #fff7ed;
}

.btn-outline-dark {
  background: #fff;
  border: 1px solid #1e293b;
  color: #1e293b;
}

.btn-outline-dark:hover {
  background: #f1f5f9;
}

/* 5. Rounded Pill */
.btn-pill {
  border-radius: 50px;
}

/* Icon Helper */
.btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: "wght" 500;
}

/* END CSS: BUTTONS */

/* START CSS: Dropdown */

/* Menu Container */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  padding: 8px;
  margin-top: 10px !important;
  font-size: 14px;
  min-width: 180px;
  animation: dropdownSlide 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1050;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    margin-top: 0px !important;
  }
  to {
    opacity: 1;
    margin-top: 10px !important;
  }
}

/* Dropdown Items */
.dropdown-item {
  border-radius: 8px;
  padding: 8px 16px;
  color: #475569;
  font-weight: 500;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #f1f5f9;
  color: #4f46e5;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: #4f46e5;
  color: #fff;
}

/* Icons inside Dropdown */
.dropdown-item .material-symbols-rounded {
  font-size: 18px;
  color: #94a3b8;
}
.dropdown-item:hover .material-symbols-rounded {
  color: inherit;
}

/* Split Button Group Hover Fix */
.btn-group {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-group:hover,
.btn-group:focus-within {
  transform: translateY(-2px);
}
.btn-group .btn:hover,
.btn-group .btn:focus,
.btn-group .btn:active {
  transform: none !important;
}

/* Split Button Divider Fix */
.btn-group > .dropdown-toggle-split {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
/* For Outline/Light split buttons */
.btn-outline-saas + .dropdown-toggle-split,
.btn-soft-secondary + .dropdown-toggle-split {
  border-left: 1px solid #e2e8f0;
}

/* Dropdown Link Style */
.dropdown-toggle-link {
  background: none;
  border: none;
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dropdown-toggle-link:hover {
  color: #4338ca;
}

/* END CSS: Dropdown */

/* START CSS: Basic Table */

/* --- Card Container & Toolbar --- */
.elite-table-module {
  background: var(--bg-topbar);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  border: 1px solid #eef1f6;
  padding: 18px;
}

.elite-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 16px;
}

.e-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.e-title-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
}

.e-title-icon .material-symbols-rounded {
  font-size: 26px;
}

.elite-toolbar-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.e-toolbar-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 1px;
}

.elite-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.elite-search-box {
  position: relative;
}

.elite-search-box .material-symbols-rounded {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 20px;
}

.elite-search-input {
  padding: 10px 16px 10px 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
  width: 260px;
}

.elite-search-input:focus {
  background-color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.elite-btn-filter {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.elite-btn-filter:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* --- Table Structure (flat rows, hairline dividers) --- */
.elite-table-module .table-responsive {
  max-height: calc(100vh - 280px); /* Reduced subtraction to use more space */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.elite-table-module .table-responsive::-webkit-scrollbar {
  width: 6px;
}

.elite-table-module .table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.elite-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

/* A quiet label row, but with its own tinted (opaque, not the card's
   near-white .95-alpha) background so it actually reads as a distinct
   header cap instead of blending into the white rows beneath it — same
   slate tint the pagination footer strip uses, so the card is visually
   "capped" top and bottom around the plain white row area. */
.elite-table thead th {
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 20px;
  border: none;
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 10;
  background-clip: padding-box;
}

.elite-table thead th:first-child {
  border-top-left-radius: 10px;
}

.elite-table thead th:last-child {
  border-top-right-radius: 10px;
}

/* Row styling — flat rows with a hairline divider, no per-row shadow/pill */
.elite-table tbody tr {
  transition: background-color 0.15s ease;
}

.elite-table tbody td {
  padding: 14px 20px;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 400;
  vertical-align: top;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f1f5f9;
}

.elite-table tbody tr:last-child td {
  border-bottom: none;
}

.elite-table tbody tr:hover td {
  background-color: #f8fafc;
}
/* --- Data Styling --- */
.e-id {
  font-family: monospace;
  color: #94a3b8;
  font-weight: 600;
  font-size: 13px;
}

/* Product Info */
.e-product {
  display: flex;
  gap: 16px;
}

.e-img-box {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  padding: 2px;
  /* กรอบขาวรอบรูป */
}

.e-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.e-prod-title {
  display: block;
  font-weight: 700;
  color: #0f172a;
  font-size: 15px;
  margin-bottom: 2px;
}

.e-prod-date {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* Numbers */
.e-price {
  font-weight: 600;
  color: #1e293b;
}

.e-amount {
  font-weight: 700;
  color: var(--text-1);
}

.e-stock-out {
  color: #f43f5e;
  font-weight: 700;
  background: #fff1f2;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
}

/* Rating with Star */
.e-rating-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.e-star {
  color: #f59e0b;
  font-size: 18px !important;
}

.e-rate-num {
  font-weight: 700;
  color: #1e293b;
}

.e-rate-rev {
  color: #94a3b8;
  font-size: 13px;
}

/* Dot Indicator Badges */
.e-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

.e-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.e-badge.pub {
  background-color: #f1f5f9;
  color: #4f46e5;
}

.e-badge.pub .e-dot {
  background-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.e-badge.draft {
  background-color: #f1f5f9;
  color: #64748b;
}

.e-badge.draft .e-dot {
  background-color: #94a3b8;
}

.e-badge.active {
  background-color: #ecfdf5;
  color: #10b981;
}

.e-badge.active .e-dot {
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.e-badge.inactive {
  background-color: #f1f5f9;
  color: #64748b;
}

.e-badge.inactive .e-dot {
  background-color: #94a3b8;
}

/* Glassy Action Buttons */
.e-actions {
  display: flex;
  gap: 4px;
}

.e-btn-act {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.e-btn-act:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  transform: scale(1.05);
}

.e-btn-act.danger:hover {
  background-color: #fff1f2;
  color: #f43f5e;
}

.e-btn-act .material-symbols-rounded {
  font-size: 20px;
}

/* --- Pagination --- */
.elite-pagination {
  display: flex;
  justify-content: start;
  align-items: center;
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--bg-topbar);
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 500;
  gap: 16px;
}

/* Inside a table card, pagination reads better as an attached footer strip
   than a separate floating box — bleed it out to the card's own edges
   (negative margin cancels .elite-table-module's 18px padding) and round
   only the bottom corners to match the card's own radius. */
.elite-table-module .elite-pagination {
  justify-content: space-between;
  margin: 10px -18px -18px;
  padding: 12px 20px;
  background: #f8fafc;
  border: none;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 16px 16px;
}

.e-pagination-rows {
  display: flex;
  align-items: center;
  gap: 12px;
}

.e-page-select {
  padding: 6px 28px 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: var(--bg-topbar);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.e-page-select:hover {
  border-color: #cbd5e1;
  background-color: #fafafa;
}

.e-pagination-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.e-page-info {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.e-page-info strong {
  color: var(--text-1);
  font-weight: 800;
}

.e-page-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.e-page-numbers {
  display: flex;
  gap: 4px;
  background: rgba(226, 232, 240, 0.5);
  padding: 3px;
  border-radius: 10px;
  margin: 0 4px;
}

.e-page-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: var(--bg-topbar);
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.e-page-btn .material-symbols-rounded {
  font-size: 18px;
}

.e-page-btn:hover {
  background: #ffffff;
  color: #4f46e5;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -5px rgba(79, 70, 229, 0.3);
}

.e-page-btn.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 8px 15px -3px rgba(79, 70, 229, 0.4);
}

.e-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.e-page-btn .material-symbols-rounded {
  font-size: 22px;
}

.e-page-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: #94a3b8;
  font-weight: 800;
  font-size: 14px;
}

/* END CSS: Basic Table */

/* START CSS: Overall Search (quick search + filter dropdown) */
/* Shared by any page header that needs a quick-search box plus a
   dropdown filter panel — e.g. new_index_pr.php, index_user_management.php. */

.req {
  color: #f43f5e;
}

.header-quick-search {
  display: flex;
  align-items: center;
  width: 320px;
  max-width: 100%;
  height: 42px;
  padding-left: 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  overflow: hidden;
  transition: all .15s;
}

.header-quick-search:focus-within {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.header-quick-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: #1e293b;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.header-quick-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}

.header-quick-search-btn:hover,
.header-quick-search-btn:focus-visible {
  background: #4338ca;
}

.header-quick-search-btn .material-symbols-rounded {
  font-size: 18px;
}

.btn-search-toggle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.btn-search-toggle:hover,
.btn-search-toggle[aria-expanded="true"] {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.btn-search-toggle .material-symbols-rounded {
  font-size: 21px;
}

.os-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px -8px rgba(15, 23, 42, .18);
}

.os-field {
  margin-bottom: 12px;
}

.os-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.os-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #eef1f6;
}

/* END CSS: Overall Search */

/* START CSS: Elite Modal */
/* Shared modal chrome (rounded card, icon-square title, bordered footer) —
   add class "elite-modal" alongside "modal fade". Used by templateModal
   (new_form_add_pr.php) and umFormModal (index_user_management.php). */

.elite-modal .modal-content {
  border-radius: 18px;
  border: none;
}

.elite-modal .modal-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 22px;
}

.elite-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
}

.elite-modal-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.elite-modal-ico.blue {
  background: #eef2ff;
  color: #4f46e5;
}

.elite-modal-ico.teal {
  background: #ecfeff;
  color: #0891b2;
}

.elite-modal-ico.amber {
  background: #fffbeb;
  color: #d97706;
}

.elite-modal-ico.indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.elite-modal .modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 16px 22px;
}

/* END CSS: Elite Modal */

/* START CSS: ELITE PAGE HEADER & BREADCRUMBS */

.elite-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 0 10px 0; /* เว้นระยะด้านล่างก่อนถึงเนื้อหาถัดไป */
}

/* Page Title */
.elite-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a; /* Slate 900 */
  margin: 0;
  letter-spacing: -0.5px;
}

/* Breadcrumb Container */
.elite-breadcrumb {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* Breadcrumb List Item */
.elite-breadcrumb-item {
  display: flex;
  align-items: center;
}

/* Breadcrumb Links */
.elite-breadcrumb-item a {
  text-decoration: none;
  color: #475569; /* Slate 600 */
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.elite-breadcrumb-item a:hover {
  color: #4f46e5; /* Indigo 600 */
}

/* Home Icon specifically */
.elite-breadcrumb-item a .home-icon {
  color: #4f46e5; /* สีน้ำเงินโดดเด่นตามภาพต้นฉบับ */
  font-size: 20px;
}

/* Separator Icon (Chevron Right) */
.elite-breadcrumb-item + .elite-breadcrumb-item::before {
  content: "\e5cc"; /* รหัส Icon chevron_right ของ Material Symbols */
  font-family: "Material Symbols Rounded";
  font-size: 18px;
  color: #94a3b8; /* Slate 400 */
  margin: 0 8px;
}

/* Active/Current Page Text */
.elite-breadcrumb-item.active {
  color: #94a3b8; /* Slate 400 (สีอ่อนลงเพื่อบอกว่าเป็นหน้าปัจจุบัน) */
  pointer-events: none; /* ปิดการคลิกที่หน้าปัจจุบัน */
}

/* ── PREMIUM SOFT BADGES ── */
.badge-soft-primary,
.badge-soft-success,
.badge-soft-warning,
.badge-soft-danger,
.badge-soft-info,
.badge-soft-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1;
  transition: all 0.2s var(--ease);
  letter-spacing: 0.01em;
  cursor: default;
  user-select: none;
}

.badge-soft-primary {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-soft-primary:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.badge-soft-success {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.badge-soft-success:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.badge-soft-warning {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge-soft-warning:hover {
  background: rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

.badge-soft-danger {
  background: var(--rose-soft);
  color: var(--rose);
}
.badge-soft-danger:hover {
  background: rgba(244, 63, 94, 0.2);
  transform: translateY(-1px);
}

.badge-soft-info {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge-soft-info:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.badge-soft-secondary {
  background: var(--slate-soft);
  color: var(--slate);
}
.badge-soft-secondary:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

/* END CSS: ELITE PAGE HEADER & BREADCRUMBS */

/* START CSS: Datepickers */

/* =========================================
   ELITE DATEPICKER UI
   ========================================= */

/* 1. Datepicker Wrapper & Icons */
.dp-wrapper {
  position: relative;
  width: 100%;
}

.dp-wrapper .material-symbols-rounded {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 20px;
  transition: color 0.2s;
}

.dp-icon-left .material-symbols-rounded {
  left: 16px;
}

.dp-icon-right .material-symbols-rounded {
  right: 16px;
}

/* 2. Base Input Style */
.dp-input {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.dp-icon-left .dp-input {
  padding: 10px 16px 10px 46px;
}

.dp-icon-right .dp-input {
  padding: 10px 46px 10px 16px;
}

.dp-input::placeholder {
  color: #94a3b8;
}

/* Focus State */
.dp-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.dp-wrapper:focus-within .material-symbols-rounded {
  color: #4f46e5;
}

/* 3. Soft / Tinted Variant */
.dp-input-soft {
  background-color: #f8fafc;
  border-color: transparent;
}

.dp-input-soft:focus {
  background-color: #ffffff;
  border-color: #4f46e5;
}

/* 4. Rounded Pill Variant */
.dp-input-pill {
  border-radius: 50px;
}

/* 5. Date Range (Start - End) */
.dp-range-wrapper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px 16px;
  transition: all 0.2s;
  width: fit-content;
}

.dp-range-wrapper:focus-within {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.dp-range-wrapper .material-symbols-rounded {
  color: #94a3b8;
  font-size: 20px;
}

.dp-input-bare {
  border: none;
  background: transparent;
  height: 40px;
  outline: none;
  color: #1e293b;
  font-size: 14px;
  width: 110px;
  text-align: center;
}

.dp-input-bare::placeholder {
  color: #94a3b8;
}

.dp-range-separator {
  color: #cbd5e1;
  margin: 0 8px;
  font-weight: 500;
}

/* 6. Floating Label Datepicker */
.dp-floating {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.dp-floating .dp-input {
  padding: 20px 46px 6px 16px;
  /* Space for icon and label */
  height: 56px;
}

.dp-floating label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  pointer-events: none;
}

/* Float the label on focus or when input has value (using placeholder-shown trick) */
.dp-floating .dp-input:focus + label,
.dp-floating .dp-input:not(:placeholder-shown) + label {
  top: 16px;
  font-size: 11px;
  color: #4f46e5;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dp-floating .material-symbols-rounded {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.dp-floating .dp-input:focus ~ .material-symbols-rounded {
  color: #4f46e5;
}

/* END CSS: Datepickers */

/* =========================================
   ELITE SPACIOUS INPUT (LARGE SIZE)
   ========================================= */

/* ปรับ Label ให้ดูพรีเมียมและอ่านง่ายขึ้น */
.elite-label-lg {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1, #334155);
  margin-bottom: 10px;
  display: inline-block;
  letter-spacing: 0.2px;
}

/* กล่องคลุม Input ขนาดใหญ่ */
.elite-search-box-lg {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  height: 48px;
  padding: 0 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: text;
}

/* 🌟 เอฟเฟกต์ตอนคลิกพิมพ์ (Focus) - ลอยขึ้นและเรืองแสง */
.elite-search-box-lg:focus-within {
  background-color: #ffffff;
  border-color: #4f46e5;
  box-shadow:
    0 0 0 4px rgba(79, 70, 229, 0.1),
    0 10px 25px -5px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
  /* ลอยขึ้นมานิดนึงให้ดูมีมิติ */
}

/* ไอคอนขนาดใหญ่ขึ้น */
.elite-search-box-lg .material-symbols-rounded {
  color: var(--text-3, #94a3b8);
  font-size: 24px;
  margin-right: 16px;
  transition: color 0.3s ease;
}

/* เปลี่ยนสีไอคอนเมื่อคลิก */
.elite-search-box-lg:focus-within .material-symbols-rounded {
  color: #4f46e5;
}

/* ตัวช่องกรอกข้อความ */
.elite-input-lg {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-1, #0f172a);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  height: 100%;
  padding: 0;
  width: 100%;
}

.elite-input-lg::placeholder {
  color: var(--text-3, #94a3b8);
  font-weight: 400;
}

/* START CSS: Basic Elements (Forms) */

/* This page is built on Bootstrap 5's own .form-control / .form-select /
   .input-group / .form-check / .row-col grid — everything below is just
   brand polish (radius, border, focus ring) layered on top of them.
   Rules that touch shared Bootstrap classes (.form-control, .form-select,
   .form-label, .input-group-text, .form-check-input) stay scoped under
   .ez-page because those classes are already used in 40+ other screens
   (login, product forms, modals) — an unscoped override there would
   silently restyle all of them. Rules for custom-named classes we invented
   ourselves (.ez-aa, .form-control-underline, .ez-search-circle*) are left
   unscoped below since nothing else in the app uses those names, so they
   can be reused on any page without needing an .ez-page wrapper. */

.ez-page .form-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
}

.ez-page .form-control,
.ez-page .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
}

.ez-page .form-control {
  padding: 0.65rem 0.9rem;
}

.ez-page .form-control:focus,
.ez-page .form-select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Icon-prefixed fields use Bootstrap's own .input-group + .input-group-text */
.ez-page .input-group-text {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: #94a3b8;
}

.ez-page .input-group:focus-within .input-group-text {
  border-color: #4f46e5;
  color: #4f46e5;
}

.ez-page .input-group .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  font-size: 19px;
  line-height: 1;
}

.ez-page .input-group.align-items-start .input-group-text {
  padding-top: 0.7rem;
}

.ez-aa {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 14px;
  font-style: italic;
}

/* Underline-only input variant ("Custom Styles" card) — still a .form-control */
.form-control-underline {
  border: none;
  border-bottom: 1.5px solid #e2e8f0;
  border-radius: 0;
  padding-left: 2px;
  padding-right: 2px;
}

.form-control-underline:focus {
  border-color: #4f46e5;
  box-shadow: none;
}

/* Checkbox accent to match brand */
.ez-page .form-check-input:checked {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

.ez-page .form-check-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Floating circular search button (one variant has no native Bootstrap
   input-group equivalent, so it needs a positioning rule of its own) */
.ez-search-circle {
  position: relative;
}

.ez-search-circle .form-control {
  border-radius: 999px;
  padding-right: 52px;
}

.ez-search-circle-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

/* The shared .preview-view (used by buttons.html/select2.html/dropdowns.html)
   defaults to a wrapped button row; form content needs normal block flow
   instead. Scoped to .ez-page (only Basic/Advanced Elements use it) so
   buttons.html/select2.html/dropdowns.html keep their wrapped-row layout. */
.ez-page .preview-view.active {
  display: block;
}

/* END CSS: Basic Elements (Forms) */

/* START CSS: Advanced Elements (Forms) */

/* Touch Spin (+/- stepper) — plain Bootstrap .btn + .form-control.
   Unscoped: .touch-spin/.touch-spin-light are custom class names not used
   anywhere else in the app, so these are safe to use on any page. */
.touch-spin {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
}

.touch-spin .btn {
  width: 42px;
  padding: 0;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.touch-spin input[type="number"] {
  width: 56px;
  min-width: 0; /* number inputs default to a large intrinsic width that
                   flex-shrink can't compress without this — without it,
                   the .w-100 variant overflows its card and gets clipped */
  text-align: center;
  border-radius: 10px;
  font-weight: 700;
  -moz-appearance: textfield;
}

.touch-spin input[type="number"]::-webkit-outer-spin-button,
.touch-spin input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.touch-spin.w-100 {
  width: 100%;
}

.touch-spin.w-100 input[type="number"] {
  width: auto;
  flex: 1;
}

/* "Light" variant — one soft pill container instead of 3 separate controls */
.touch-spin-light {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
}

.touch-spin-light .btn {
  background: transparent;
  color: #64748b;
}

.touch-spin-light .btn:hover {
  background: #e2e8f0;
}

.touch-spin-light input[type="number"] {
  background: transparent;
}

/* Country calling-code input group uses the same .s2-flag-img as the
   country select (see "SELECT2 PREMIUM CSS OVERRIDES" above). Gated by the
   custom .s2-flag-img class, so it's safe unscoped — it won't touch any
   .input-group-text that doesn't contain one of our flag images. */
.input-group-text img.s2-flag-img {
  margin-right: 6px;
}

/* Tag Input — pills render below the field, not wrapped inside it like
   Select2's multi-select does. Unscoped: .tag-input-pills/.tag-pill are
   custom class names, safe to reuse on any page. */
.tag-input-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-input-pills:empty {
  margin-top: 0;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 14px;
  border-radius: 20px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.tag-pill-remove {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.tag-pill-remove:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Inline calendar ("By Date" card) — reskin flatpickr to match the brand;
   scoped so the popup datepickers used elsewhere are untouched. */
.ez-page .flatpickr-calendar.inline {
  box-shadow: none;
  border: none;
  width: 100%;
  max-width: 320px;
  font-family: var(--font, "Sarabun", sans-serif);
}

.ez-page .flatpickr-current-month {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.ez-page .flatpickr-weekday {
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
}

.ez-page .flatpickr-day {
  border-radius: 8px;
}

.ez-page .flatpickr-day.today {
  border-color: #4f46e5;
}

.ez-page .flatpickr-day:hover {
  background: #eef2ff;
  border-color: #eef2ff;
}

.ez-page .flatpickr-day.selected,
.ez-page .flatpickr-day.selected:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

/* END CSS: Advanced Elements (Forms) */

/* END CSS: Basic Elements (Forms) */
