/* ธีมกลางสำหรับทุกหน้าที่ใช้ Vuexy (inc/vuexy/doctype.php, medkru/vuexy/doctype.php)
   หัวข้อใช้ Mali เนื้อหาใช้ Sarabun ปุ่ม/ตาราง/ช่องกรอกใช้ Sarabun เพื่อความอ่านง่าย
   สีทั้งหมดอ่านจากตัวแปรด้านล่าง เปลี่ยนธีมได้ด้วย <html data-ibs-theme="...">
   ค่าเริ่มต้น = pastel  ทางเลือก premium: navy-gold, emerald-gold, saffron */

:root {
	/* พื้น + ตัวอักษร */
	--ibs-bg: #faf7ff;
	--ibs-surface: #ffffff;
	--ibs-ink: #2d2a4a;
	--ibs-muted: #5f5c7a;
	--ibs-line: #e6e2f3;
	--ibs-glow-1: rgba(190, 220, 255, .55);
	--ibs-glow-2: rgba(196, 238, 220, .5);
	--ibs-glow-3: rgba(255, 196, 216, .4);

	/* สีหลัก (ปุ่ม เมนูที่เลือก โฟกัส) */
	--ibs-primary: #6a58cf;
	--ibs-primary-ink: #5443b6;
	--ibs-primary-soft: #efebff;
	--ibs-on-primary: #ffffff;
	--ibs-primary-2: #8d7ce6;

	/* สีประจำหมวด: soft = พื้น, ink = ไอคอน/ตัวเน้น (ink บน soft ผ่าน 4.5:1) */
	--ibs-h1-soft: #efebff; --ibs-h1-ink: #5443b6;
	--ibs-h2-soft: #ffe6ee; --ibs-h2-ink: #ad2f5d;
	--ibs-h3-soft: #ddf4ea; --ibs-h3-ink: #186b4d;
	--ibs-h4-soft: #e2eeff; --ibs-h4-ink: #2456a8;
	--ibs-h5-soft: #fff3cf; --ibs-h5-ink: #7a4f00;
	--ibs-h6-soft: #ffe9df; --ibs-h6-ink: #9e3d17;
	--ibs-h7-soft: #eceef4; --ibs-h7-ink: #3d4660;

	/* sidebar */
	--ibs-side-bg: linear-gradient(180deg, #ffffff 0%, #f6f2ff 55%, #fdf2f7 100%);
	--ibs-side-fade: #ffffff;
	--ibs-side-ink: #2d2a4a;
	--ibs-side-muted: #6c6987;
	--ibs-side-hover: rgba(106, 88, 207, .08);
	--ibs-side-panel: rgba(106, 88, 207, .06);
	--ibs-side-line: #e6e2f3;
	--ibs-side-active-bg: linear-gradient(120deg, #6a58cf, #8d7ce6);
	--ibs-side-active-ink: #ffffff;
	--ibs-side-active-shadow: rgba(106, 88, 207, .9);
	--ibs-side-chip-alpha: 1;
	--ibs-brand-ink: #4a39a8;
	--ibs-brand-accent: #ff8fab;

	--ibs-radius: 20px;
	--ibs-head: 'Mali', 'Sarabun', sans-serif;
	--ibs-body: 'Sarabun', sans-serif;
	--ibs-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- ธีม premium (ทางเลือก) ---------- */

/* กรมท่า-ทอง: ทรงคุณค่า น่าเชื่อถือ */
html[data-ibs-theme="navy-gold"] {
	--ibs-bg: #f8f5ee;
	--ibs-ink: #1d2433;
	--ibs-muted: #586073;
	--ibs-line: #e6dfcd;
	--ibs-glow-1: rgba(212, 175, 97, .22);
	--ibs-glow-2: rgba(31, 58, 107, .1);
	--ibs-glow-3: rgba(212, 175, 97, .16);
	--ibs-primary: #1f3a6b;
	--ibs-primary-ink: #142a52;
	--ibs-primary-soft: #e7ecf5;
	--ibs-primary-2: #2c5190;
	--ibs-h1-soft: #e7ecf5; --ibs-h1-ink: #1f3a6b;
	--ibs-h2-soft: #f6e7e9; --ibs-h2-ink: #8c2a3b;
	--ibs-h3-soft: #e3f0ea; --ibs-h3-ink: #1f5e45;
	--ibs-h4-soft: #e6eef8; --ibs-h4-ink: #22427a;
	--ibs-h5-soft: #f6eedb; --ibs-h5-ink: #6e5110;
	--ibs-h6-soft: #f5e9e0; --ibs-h6-ink: #83411d;
	--ibs-h7-soft: #eceef2; --ibs-h7-ink: #3d4657;
	--ibs-side-bg: linear-gradient(180deg, #0f1c33 0%, #142645 60%, #1a2f55 100%);
	--ibs-side-fade: #0f1c33;
	--ibs-side-ink: #ece6d6;
	--ibs-side-muted: #a7afc3;
	--ibs-side-hover: rgba(212, 175, 97, .12);
	--ibs-side-panel: rgba(255, 255, 255, .05);
	--ibs-side-line: rgba(212, 175, 97, .25);
	--ibs-side-active-bg: linear-gradient(120deg, #d9b766, #b08a35);
	--ibs-side-active-ink: #1d1606;
	--ibs-side-active-shadow: rgba(176, 138, 53, .8);
	--ibs-side-chip-alpha: .16;
	--ibs-brand-ink: #f3e3bd;
	--ibs-brand-accent: #d4af61;
}

/* มรกต-ทอง: สงบ หรูหรา */
html[data-ibs-theme="emerald-gold"] {
	--ibs-bg: #f6f6f0;
	--ibs-ink: #16302a;
	--ibs-muted: #4f645d;
	--ibs-line: #dfe3d6;
	--ibs-glow-1: rgba(212, 175, 97, .2);
	--ibs-glow-2: rgba(23, 97, 79, .12);
	--ibs-glow-3: rgba(212, 175, 97, .14);
	--ibs-primary: #17614f;
	--ibs-primary-ink: #0f4a3c;
	--ibs-primary-soft: #e2efe9;
	--ibs-primary-2: #1f7d66;
	--ibs-h1-soft: #e2efe9; --ibs-h1-ink: #17614f;
	--ibs-h2-soft: #f5e8e6; --ibs-h2-ink: #8a3329;
	--ibs-h3-soft: #e8f1e2; --ibs-h3-ink: #3d5e1f;
	--ibs-h4-soft: #e4edf3; --ibs-h4-ink: #24506e;
	--ibs-h5-soft: #f5eedb; --ibs-h5-ink: #6e5110;
	--ibs-h6-soft: #f3e9df; --ibs-h6-ink: #7f4320;
	--ibs-h7-soft: #ebeee9; --ibs-h7-ink: #3c4a44;
	--ibs-side-bg: linear-gradient(180deg, #0c3129 0%, #0f3e34 60%, #134b3f 100%);
	--ibs-side-fade: #0c3129;
	--ibs-side-ink: #e9eadc;
	--ibs-side-muted: #a4b8af;
	--ibs-side-hover: rgba(212, 175, 97, .12);
	--ibs-side-panel: rgba(255, 255, 255, .05);
	--ibs-side-line: rgba(212, 175, 97, .25);
	--ibs-side-active-bg: linear-gradient(120deg, #d9b766, #b08a35);
	--ibs-side-active-ink: #1d1606;
	--ibs-side-active-shadow: rgba(176, 138, 53, .8);
	--ibs-side-chip-alpha: .16;
	--ibs-brand-ink: #f3e3bd;
	--ibs-brand-accent: #d4af61;
}

/* จีวร-ครีม: อบอุ่น เป็นเอกลักษณ์ไทย */
html[data-ibs-theme="saffron"] {
	--ibs-bg: #fbf6ee;
	--ibs-ink: #3a1f17;
	--ibs-muted: #6e5248;
	--ibs-line: #eedfcc;
	--ibs-glow-1: rgba(227, 151, 58, .22);
	--ibs-glow-2: rgba(122, 35, 56, .08);
	--ibs-glow-3: rgba(227, 151, 58, .16);
	--ibs-primary: #a8431c;
	--ibs-primary-ink: #84320f;
	--ibs-primary-soft: #fbeadf;
	--ibs-primary-2: #c4601f;
	--ibs-h1-soft: #fbeadf; --ibs-h1-ink: #8c3712;
	--ibs-h2-soft: #f7e5ea; --ibs-h2-ink: #8c2a45;
	--ibs-h3-soft: #e6f0e4; --ibs-h3-ink: #2f5e2a;
	--ibs-h4-soft: #e8edf5; --ibs-h4-ink: #2c4a7a;
	--ibs-h5-soft: #fbf0d6; --ibs-h5-ink: #6e4d00;
	--ibs-h6-soft: #f4e7f0; --ibs-h6-ink: #6b2d5e;
	--ibs-h7-soft: #efe9e4; --ibs-h7-ink: #4f4038;
	--ibs-side-bg: linear-gradient(180deg, #4a1622 0%, #5a1b29 60%, #6a2232 100%);
	--ibs-side-fade: #4a1622;
	--ibs-side-ink: #f7e9dc;
	--ibs-side-muted: #d5b8ad;
	--ibs-side-hover: rgba(240, 168, 80, .14);
	--ibs-side-panel: rgba(255, 255, 255, .06);
	--ibs-side-line: rgba(240, 168, 80, .3);
	--ibs-side-active-bg: linear-gradient(120deg, #f0aa52, #d47c22);
	--ibs-side-active-ink: #2a1404;
	--ibs-side-active-shadow: rgba(212, 124, 34, .8);
	--ibs-side-chip-alpha: .18;
	--ibs-brand-ink: #fbe2c2;
	--ibs-brand-accent: #f0aa52;
}

/* ---------- พื้นหลัง + ตัวอักษร ---------- */
html body {
	font-family: var(--ibs-body);
	font-size: 16px;
	color: var(--ibs-ink);
	background-color: var(--ibs-bg) !important;
	background-image:
		radial-gradient(40rem 26rem at 105% -5%, var(--ibs-glow-1), transparent 60%),
		radial-gradient(40rem 28rem at 100% 105%, var(--ibs-glow-2), transparent 62%),
		radial-gradient(36rem 24rem at 20% 110%, var(--ibs-glow-3), transparent 60%);
	background-attachment: fixed;
}

::selection {
	background: var(--ibs-primary-soft);
	color: var(--ibs-ink);
}

html body h1,
html body h2,
html body h3,
html body .h1,
html body .h2,
html body .h3,
html body .card-title,
html body .content-header-title,
html body .prompt-bold {
	font-family: var(--ibs-head);
	font-weight: 600;
	letter-spacing: 0;
	color: var(--ibs-ink);
}

html body h4,
html body h5,
html body h6 {
	font-family: var(--ibs-body);
	color: var(--ibs-ink);
}

html body .btn,
html body .btn.prompt-bold,
html body .table,
html body .form-control,
html body .form-select,
html body .select2-container {
	font-family: var(--ibs-body);
}

html body .text-muted {
	color: var(--ibs-muted) !important;
}

/* ---------- Sidebar ---------- */
html body .main-menu,
html.semi-dark-layout body .main-menu {
	background: var(--ibs-side-bg) !important;
	box-shadow: 0 0 28px -10px rgba(20, 16, 50, .35) !important;
	border-right: 1px solid var(--ibs-side-line);
}

html body .main-menu .shadow-bottom,
html.semi-dark-layout body .main-menu .shadow-bottom {
	background: linear-gradient(180deg, var(--ibs-side-fade) 40%, transparent) !important;
}

/* โลโก้ตัวอักษร IBS / OFFICIAL */
html body .main-menu .navbar-header {
	height: auto;
	padding: 18px 18px 14px 22px;
}

html body .main-menu .navbar-header .navbar-brand {
	margin-top: 0;
	align-items: center;
}

html body .main-menu .navbar-header .brand-text.ibs-wordmark {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0 0 0 10px;
	padding: 0;
	line-height: 1;
	animation: none;
}

html body .ibs-wordmark .ibs-wm-main {
	font-family: var(--ibs-head);
	font-weight: 700;
	font-size: 1.75rem;
	line-height: .95;
	letter-spacing: .02em;
	color: var(--ibs-brand-ink) !important;
}

html body .ibs-wordmark .ibs-wm-main::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-left: 3px;
	border-radius: 50%;
	background: var(--ibs-brand-accent);
	vertical-align: .1em;
}

html body .ibs-wordmark .ibs-wm-sub {
	font-family: var(--ibs-body);
	font-weight: 700;
	font-size: .66rem;
	letter-spacing: .38em;
	color: var(--ibs-side-muted) !important;
}

html body .main-menu .navbar-header .brand-logo img {
	width: 38px;
	height: 38px;
	max-width: none;
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 6px 14px -8px rgba(20, 16, 50, .6);
}

html body .main-menu .navbar-header .nav-toggle svg {
	color: var(--ibs-side-muted) !important;
}

html body .main-menu-content .navigation-main,
html body .main-menu-content .navigation-main .menu-content,
html.semi-dark-layout body .main-menu-content .navigation-main,
html.semi-dark-layout body .main-menu-content .navigation-main .menu-content,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item .menu-content,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item .menu-content li:not(.active) a {
	background: transparent !important;
}

html body .main-menu-content .navigation-main .nav-item a,
html body .main-menu-content .navigation-main .nav-item a:after,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item a,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item a:after {
	color: var(--ibs-side-ink) !important;
	font-family: var(--ibs-body);
	font-size: 1rem;
}

/* ชื่อเมนูไม่ตัดคำ ขึ้นบรรทัดใหม่ได้ */
html body .main-menu .navigation li a .menu-title,
html body .main-menu .navigation li a .menu-item {
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	line-height: 1.35;
}

html body .main-menu .navigation > li > a {
	margin: 2px 12px !important;
	padding: 8px 12px !important;
	border-radius: 14px !important;
	transition: background .2s;
}

html body .main-menu .navigation li a:hover {
	background: var(--ibs-side-hover) !important;
}

/* ไอคอนเมนูชั้นแรกอยู่ในกรอบสีประจำหมวด วนตามลำดับ */
html body .main-menu .navigation > li > a > svg {
	flex: 0 0 32px;
	width: 32px !important;
	height: 32px !important;
	padding: 7px;
	margin-right: 12px !important;
	border-radius: 11px;
	stroke-width: 2.2;
	--chip-soft: var(--ibs-h1-soft);
	--chip-ink: var(--ibs-h1-ink);
	background: color-mix(in srgb, var(--chip-soft) calc(var(--ibs-side-chip-alpha) * 100%), transparent);
	color: var(--chip-ink) !important;
}

html[data-ibs-theme] body .main-menu .navigation > li > a > svg {
	background: color-mix(in srgb, var(--chip-soft) 16%, transparent);
	color: color-mix(in srgb, var(--chip-soft) 85%, #ffffff) !important;
}

html body .main-menu .navigation > li:nth-child(6n+2) > a > svg { --chip-soft: var(--ibs-h2-soft); --chip-ink: var(--ibs-h2-ink); }
html body .main-menu .navigation > li:nth-child(6n+3) > a > svg { --chip-soft: var(--ibs-h3-soft); --chip-ink: var(--ibs-h3-ink); }
html body .main-menu .navigation > li:nth-child(6n+4) > a > svg { --chip-soft: var(--ibs-h4-soft); --chip-ink: var(--ibs-h4-ink); }
html body .main-menu .navigation > li:nth-child(6n+5) > a > svg { --chip-soft: var(--ibs-h5-soft); --chip-ink: var(--ibs-h5-ink); }
html body .main-menu .navigation > li:nth-child(6n+6) > a > svg { --chip-soft: var(--ibs-h6-soft); --chip-ink: var(--ibs-h6-ink); }

/* เมนูย่อย: แยกระดับด้วยแผงพื้นอ่อน + น้ำหนักตัวอักษร แทนการเยื้องลึก */
html body .main-menu .navigation > li > ul.menu-content {
	margin: 4px 12px 8px !important;
	padding: 6px 0 !important;
	border-radius: 16px;
	background: var(--ibs-side-panel) !important;
}

html body .main-menu .navigation li ul.menu-content li > a {
	margin: 1px 6px !important;
	padding: 8px 10px !important;
	border-radius: 12px !important;
}

html body .main-menu .navigation li ul.menu-content li > a > svg {
	flex: 0 0 18px;
	width: 18px !important;
	height: 18px !important;
	margin-right: 10px !important;
	color: var(--ibs-side-muted) !important;
}

/* หัวกลุ่มในเมนูย่อย (เช่น จัดการกฐินสัมฤทธิ์) ตัวหนา */
html body .main-menu .navigation li ul.menu-content > li.has-sub > a .menu-item,
html body .main-menu .navigation li ul.menu-content > li:has(> ul) > a .menu-item {
	font-weight: 600;
}

/* รายการชั้นที่ 3: ไม่มีไอคอน ใช้จุดสีนำหน้าแทน ไม่เยื้องเพิ่ม */
html body .main-menu .navigation li ul.menu-content ul.menu-content {
	margin: 2px 6px 6px !important;
	padding: 0 !important;
	border-left: 0;
}

html body .main-menu .navigation li ul.menu-content ul.menu-content li > a {
	padding: 6px 10px 6px 38px !important;
	position: relative;
}

html body .main-menu .navigation li ul.menu-content ul.menu-content li > a > svg {
	display: none;
}

html body .main-menu .navigation li ul.menu-content ul.menu-content li > a::before {
	content: "";
	position: absolute;
	left: 18px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -3.5px;
	border-radius: 50%;
	background: var(--ibs-brand-accent);
	opacity: .7;
}

/* กลุ่มที่เปิดอยู่ */
html body .main-menu .navigation .nav-item.open > a,
html body .main-menu .navigation .nav-item.sidebar-group-active > a,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item.open:not(.sidebar-group-active) > a,
html.semi-dark-layout body .main-menu:not(.expanded) .navigation .sidebar-group-active > a {
	background: var(--ibs-side-hover) !important;
}

/* รายการที่ active */
html body .main-menu .navigation li.active > a,
html.semi-dark-layout body .main-menu-content .navigation-main .active > a,
html.semi-dark-layout body .menu-collapsed .main-menu:not(.expanded) .navigation-main li.active > a {
	background: var(--ibs-side-active-bg) !important;
	box-shadow: 0 8px 18px -10px var(--ibs-side-active-shadow) !important;
	color: var(--ibs-side-active-ink) !important;
}

html body .main-menu .navigation li.active > a .menu-title,
html body .main-menu .navigation li.active > a .menu-item,
html body .main-menu .navigation li.active > a > svg,
html.semi-dark-layout body .main-menu-content .navigation-main .active .menu-title,
html.semi-dark-layout body .main-menu-content .navigation-main .nav-item .menu-content .active .menu-item {
	color: var(--ibs-side-active-ink) !important;
}

html body .main-menu .navigation > li.active > a > svg {
	background: rgba(255, 255, 255, .22) !important;
}

html body .main-menu .navigation li ul.menu-content ul.menu-content li.active > a::before {
	background: var(--ibs-side-active-ink);
	opacity: 1;
}

/* ---------- แถบด้านบน ---------- */
html body .header-navbar.floating-nav,
html body .header-navbar {
	border-radius: var(--ibs-radius);
	box-shadow: 0 10px 26px -18px rgba(20, 16, 50, .4) !important;
}

/* ---------- การ์ด ปุ่ม ช่องกรอก ---------- */
html body .card {
	border: 0;
	border-radius: var(--ibs-radius);
	box-shadow: 0 16px 34px -24px rgba(20, 16, 50, .4), 0 1px 3px rgba(20, 16, 50, .06);
	overflow: hidden;
}

html body .card .card-img-top {
	border-radius: var(--ibs-radius) var(--ibs-radius) 0 0;
}

html body .btn {
	border-radius: 14px;
	font-weight: 600;
}

html body .btn.rounded-pill {
	border-radius: 999px;
}

html body .btn-primary {
	background-color: var(--ibs-primary) !important;
	border-color: var(--ibs-primary) !important;
	color: var(--ibs-on-primary) !important;
}

html body .btn-primary:hover,
html body .btn-primary:focus {
	background-color: var(--ibs-primary-ink) !important;
	border-color: var(--ibs-primary-ink) !important;
	box-shadow: 0 8px 18px -10px var(--ibs-primary) !important;
}

html body .btn-info {
	background-color: #3d7fcc !important;
	border-color: #3d7fcc !important;
	color: #fff !important;
}

html body .btn-info:hover,
html body .btn-info:focus {
	background-color: #2f6ab0 !important;
	border-color: #2f6ab0 !important;
	box-shadow: 0 8px 18px -10px rgba(47, 106, 176, .9) !important;
}

html body .form-control,
html body .form-select,
html body .select2-container--default .select2-selection--single,
html body .select2-container--default .select2-selection--multiple {
	border-radius: 12px;
	border-color: var(--ibs-line);
}

html body .form-control:focus,
html body .form-select:focus {
	border-color: var(--ibs-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ibs-primary) 16%, transparent);
}

html body .colored,
html body a.colored {
	color: var(--ibs-primary-ink);
}

html body .footer {
	color: var(--ibs-muted);
}

html body .footer a {
	color: var(--ibs-primary-ink);
}

/* ---------- แถบด้านบน (topbar.php): ชื่อหน้า + ผู้ใช้ ---------- */
html body .header-navbar.ibs-topbar {
	min-height: 66px;
	background: color-mix(in srgb, var(--ibs-surface, #fff) 88%, transparent) !important;
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	border: 1px solid color-mix(in srgb, var(--ibs-line) 80%, transparent);
	box-shadow: 0 12px 28px -22px rgba(20, 16, 50, .55) !important;
}

html body .ibs-topbar .navbar-container {
	align-items: center;
	padding-left: 1.2rem;
	padding-right: .8rem;
}

.ibs-topbar-title {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.ibs-topbar-page {
	font-family: "Mali", "Sarabun", sans-serif;
	font-weight: 700;
	font-size: 1.12rem;
	/* overflow ตัดสระ/วรรณยุกต์บนของภาษาไทย (เช่น ผู้) ถ้าบรรทัดเตี้ย: เผื่อความสูงบรรทัดและขอบบน */
	line-height: 1.6;
	padding-top: .1em;
	color: var(--ibs-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ibs-topbar-sub {
	font-size: .82rem;
	line-height: 1.5;
	color: var(--ibs-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

html body .ibs-topbar .ibs-topbar-burger {
	margin-right: .4rem;
	padding: .45rem !important;
	border-radius: 12px;
	color: var(--ibs-ink) !important;
}

html body .ibs-topbar .ibs-topbar-burger:hover {
	background: var(--ibs-primary-soft);
}

/* ปุ่มผู้ใช้ */
html body .ibs-topbar .dropdown-user-link.ibs-user {
	display: flex !important;
	align-items: center;
	gap: .7rem;
	padding: .3rem .45rem .3rem .9rem !important;
	border-radius: 999px;
	border: 1px solid transparent;
	transition: background .2s var(--ibs-ease, ease), border-color .2s var(--ibs-ease, ease);
}

html body .ibs-topbar .dropdown-user-link.ibs-user::after {
	display: none;
}

html body .ibs-topbar .dropdown-user-link.ibs-user:hover,
html body .ibs-topbar .dropdown-user-link.ibs-user[aria-expanded="true"] {
	background: var(--ibs-primary-soft);
	border-color: var(--ibs-line);
}

html body .ibs-topbar .dropdown-user-link.ibs-user:focus-visible {
	outline: 2px solid var(--ibs-primary);
	outline-offset: 2px;
}

.ibs-user-text {
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.2;
}

.ibs-user-name {
	font-family: "Mali", "Sarabun", sans-serif;
	font-weight: 700;
	font-size: 1rem;
	color: var(--ibs-ink);
}

.ibs-user-role {
	font-size: .78rem;
	font-weight: 600;
	color: var(--ibs-muted);
}

/* avatar มีวงแหวนสีแบรนด์ ถ้ารูปเสียจะเห็นตัวอักษรแรกของชื่อ */
.ibs-avatar {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	flex: none;
	border-radius: 50%;
	padding: 2px;
	background: conic-gradient(from 200deg, var(--ibs-brand-accent, var(--ibs-primary)), var(--ibs-primary), var(--ibs-brand-accent, var(--ibs-primary)));
}

.ibs-avatar::before {
	content: attr(data-initial);
	position: absolute;
	inset: 2px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--ibs-primary-soft);
	color: var(--ibs-primary-ink);
	font-weight: 700;
	font-size: 1rem;
}

.ibs-avatar img {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--ibs-surface, #fff);
}

.ibs-avatar.is-lg {
	width: 52px;
	height: 52px;
}

html body .ibs-topbar .ibs-user-caret {
	width: 16px;
	height: 16px;
	color: var(--ibs-muted);
	transition: transform .2s var(--ibs-ease, ease);
}

html body .ibs-topbar .ibs-user[aria-expanded="true"] .ibs-user-caret {
	transform: rotate(180deg);
}

/* เมนูผู้ใช้ */
html body .ibs-topbar .dropdown-menu.ibs-user-menu {
	width: 290px !important;
	max-width: calc(100vw - 24px);
	margin-top: .55rem !important;
	padding: .45rem;
	border: 1px solid var(--ibs-line);
	border-radius: 18px;
	background: var(--ibs-surface, #fff);
	box-shadow: 0 22px 44px -22px rgba(20, 16, 50, .5);
}

.ibs-user-card {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem .7rem .85rem;
	margin-bottom: .35rem;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--ibs-primary-soft), color-mix(in srgb, var(--ibs-brand-accent, var(--ibs-primary)) 14%, var(--ibs-surface, #fff)));
}

.ibs-user-card-text {
	display: grid;
	min-width: 0;
	gap: .1rem;
}

.ibs-user-card-text b {
	font-family: "Mali", "Sarabun", sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ibs-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ibs-user-card-text small {
	font-size: .8rem;
	color: var(--ibs-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ibs-user-chip {
	justify-self: start;
	margin-top: .2rem;
	padding: 0 .55rem;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 700;
	line-height: 1.7;
	background: var(--ibs-primary);
	color: var(--ibs-on-primary, #fff);
}

html body .ibs-topbar .ibs-user-menu .dropdown-item {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .6rem .75rem;
	border-radius: 12px;
	font-weight: 600;
	color: var(--ibs-ink);
}

html body .ibs-topbar .ibs-user-menu .dropdown-item svg {
	flex: none;
	width: 18px !important;
	height: 18px !important;
	margin: 0 !important;
	color: var(--ibs-muted);
}

html body .ibs-topbar .ibs-user-menu .dropdown-item:hover,
html body .ibs-topbar .ibs-user-menu .dropdown-item:focus-visible {
	background: var(--ibs-primary-soft);
	color: var(--ibs-primary-ink);
	outline: none;
}

html body .ibs-topbar .ibs-user-menu .dropdown-item:hover svg {
	color: var(--ibs-primary-ink);
}

html body .ibs-topbar .ibs-user-menu .dropdown-divider {
	margin: .35rem .4rem;
	border-color: var(--ibs-line);
}

html body .ibs-topbar .ibs-user-menu .dropdown-item.ibs-logout,
html body .ibs-topbar .ibs-user-menu .dropdown-item.ibs-logout svg {
	color: #b3264a;
}

html body .ibs-topbar .ibs-user-menu .dropdown-item.ibs-logout:hover {
	background: #fdebef;
	color: #8f1b3a;
}

@media (max-width: 575.98px) {
	html body .header-navbar.ibs-topbar {
		min-height: 58px;
	}

	html body .ibs-topbar .navbar-container {
		padding-left: .6rem;
	}

	.ibs-topbar-page {
		font-size: 1rem;
		max-width: 52vw;
	}

	html body .ibs-topbar .dropdown-user-link.ibs-user {
		padding: .2rem !important;
		gap: .3rem;
	}

	html body .ibs-topbar .ibs-user-caret {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html body .ibs-topbar .ibs-user-caret,
	html body .ibs-topbar .dropdown-user-link.ibs-user {
		transition: none;
	}
}
