/* Preview tema ERP berdasarkan design.md dan referensi SDM Sister2. */
html.erp-new-theme {
	--erp-theme-green: #078d75;
	--erp-theme-teal: #12aa95;
	--erp-theme-blue: #2355d8;
	--erp-theme-purple: #7938e6;
	--erp-theme-ink: #172b49;
	--erp-theme-border: #e2e9f1;
	--erp-theme-page: #f3f5f9;
	--erp-theme-shadow: 0 5px 18px rgba(29, 52, 91, .055);
}

html.erp-new-theme body {
	background: var(--erp-theme-page);
	/* custom.css memaksa Poppins !important; design.md memakai Inter */
	font-family: "Inter", sans-serif !important;
}

html.erp-new-theme #page-topbar {
	left: 250px !important;
	height: 70px;
	background: linear-gradient(90deg, #b21feb 0%, #8b24eb 30%, #5d38ed 62%, #1464f0 100%);
	box-shadow: 0 3px 18px rgba(48, 49, 130, .13);
	z-index: 9999;
}

html.erp-new-theme #page-topbar .navbar-brand-box {
	position: fixed;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 250px;
	height: 70px;
	padding: 0 16px;
	background: #129879;
	z-index: 10000;
}

html.erp-new-theme .erp-new-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #fff;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .01em;
	text-decoration: none;
}

html.erp-new-theme .erp-new-brand img {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

html.erp-new-theme #page-topbar .navbar-header {
	height: 70px;
	padding: 0 20px 0 0;
}

html.erp-new-theme #page-topbar .header-item,
html.erp-new-theme #page-topbar .header-item i {
	color: rgba(255, 255, 255, .96);
}

html.erp-new-theme #page-topbar .header-item:hover,
html.erp-new-theme #page-topbar .header-item:focus {
	color: #fff;
	background: rgba(255, 255, 255, .12);
}

html.erp-new-theme #page-topbar .list-menu-custom {
	position: static;
	left: auto;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-left: 0;
	border-radius: 10px;
}

html.erp-new-theme #page-topbar .vertical-menu-btn {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative;
	z-index: 10002;
	flex: 0 0 46px;
}

html.erp-new-theme #page-topbar .header-profile-user {
	width: 36px;
	height: 36px;
	border: 2px solid rgba(255, 255, 255, .8);
}

html.erp-new-theme body.vertical-collpsed #page-topbar {
left: 70px !important;
}

html.erp-new-theme body.vertical-collpsed #page-topbar .navbar-header {
	padding-left: 0;
}

html.erp-new-theme body.vertical-collpsed #page-topbar .navbar-brand-box {
	width: 70px !important;
	justify-content: center;
	padding: 0;
}

html.erp-new-theme body.vertical-collpsed .erp-new-brand span {
	display: none;
}

html.erp-new-theme body.vertical-collpsed .erp-new-brand img {
	width: 36px;
	height: 36px;
}

html.erp-new-theme .vertical-menu {
	background: linear-gradient(172deg, #078d75 0%, #0a958b 38%, #167cba 72%, #2452d0 100%);
	box-shadow: 3px 0 18px rgba(29, 52, 91, .08);
}

html.erp-new-theme #sidebar-menu ul li a {
	margin: 3px 10px;
	padding: 9px 16px;
	border-radius: 9px;
	color: rgba(255, 255, 255, .91);
	font-size: 14px;
	font-weight: 500;
}

html.erp-new-theme #sidebar-menu ul li ul.sub-menu li a {
	font-size: 13.5px;
}

html.erp-new-theme #sidebar-menu ul li a i,
html.erp-new-theme #sidebar-menu ul li a .menu-arrow {
	color: #fff !important;
}

html.erp-new-theme #sidebar-menu ul li a:hover,
html.erp-new-theme #sidebar-menu ul li.mm-active > a {
	color: #fff !important;
	background: rgba(255, 255, 255, .17);
	border-radius: 9px !important;
}

html.erp-new-theme #sidebar-menu ul li a:hover i,
html.erp-new-theme #sidebar-menu ul li.mm-active > a i,
html.erp-new-theme #sidebar-menu ul li.mm-active > a .menu-arrow {
	color: #fff !important;
}

html.erp-new-theme #sidebar-menu ul li.mm-active > a i {
	background: transparent !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

html.erp-new-theme body.vertical-collpsed {
	min-height: 100vh !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu {
	position: fixed !important;
	top: 70px !important;
	bottom: 0 !important;
	height: auto !important;
	margin-top: 0 !important;
	overflow: visible !important;
	background: linear-gradient(172deg, #078d75 0%, #0a958b 38%, #167cba 72%, #2452d0 100%);
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .sidebar-menu-scroll {
	height: 100% !important;
	margin-top: 0 !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-wrapper,
html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-mask,
html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-offset,
html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-content-wrapper {
	height: 100% !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-wrapper {
	width: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	overflow: hidden !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-mask {
	position: absolute !important;
	bottom: 0 !important;
	overflow: hidden !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-offset {
	position: absolute !important;
	top: 0 !important;
	bottom: 0 !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-content-wrapper {
	position: relative !important;
	max-width: 100% !important;
	max-height: 100% !important;
	padding: 0 !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu .simplebar-scrollbar {
	display: block !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu > ul {
	padding-top: 12px;
	padding-bottom: 12px;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li a {
	color: rgba(255, 255, 255, .91) !important;
	background: transparent;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li a i,
html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li a .menu-arrow {
	color: #fff !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li:not(.mm-active) > a:hover {
	color: #fff !important;
	background: rgba(255, 255, 255, .17) !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li:not(.mm-active) > a:hover i {
	color: #fff !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li.mm-active > a {
	background: #d1fae5 !important;
	color: #078d75 !important;
	border-radius: 12px !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu ul li.mm-active > a i {
	color: #078d75 !important;
	background: transparent !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a {
	width: 50px !important;
	background: rgba(255, 255, 255, .17) !important;
	box-shadow: none !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a i {
	color: #fff !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li.mm-active:hover > a {
	background: #d1fae5 !important;
	color: #078d75 !important;
}

html.erp-new-theme body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li.mm-active:hover > a i {
	color: #078d75 !important;
}

.erp-sidebar-hover-panel {
	position: fixed;
	display: flex;
	align-items: center;
	gap: 18px;
	width: 250px;
	max-width: calc(100vw - 24px);
	min-height: 54px;
	padding: 0 18px;
	border: 1px solid #e2e9f1;
	border-radius: 14px;
	background: linear-gradient(110deg, #f6fbff 0%, #eff7fa 100%);
	box-shadow: 0 8px 22px rgba(29, 52, 91, .16);
	color: #078d75;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	z-index: 10020;
	pointer-events: none;
}

.erp-sidebar-hover-panel i {
	flex: 0 0 auto;
	color: #078d75;
	font-size: 19px;
}

html.erp-new-theme #sidebar-menu .menu-title {
	color: rgba(255, 255, 255, .68);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
}

html.erp-new-theme .main-content,
html.erp-new-theme .page-content {
	background: var(--erp-theme-page);
}

html.erp-new-theme .card {
	border: 1px solid var(--erp-theme-border);
	border-radius: 14px !important;
	box-shadow: var(--erp-theme-shadow);
}

html.erp-new-theme .card-title,
html.erp-new-theme .page-title,
html.erp-new-theme h1,
html.erp-new-theme h2,
html.erp-new-theme h3,
html.erp-new-theme h4 {
	color: var(--erp-theme-ink);
}

html.erp-new-theme .btn {
	border-radius: 8px;
	font-weight: 600;
	transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

html.erp-new-theme .btn:hover {
	filter: brightness(.96);
	transform: translateY(-1px);
}

/* Tombol bertema (design.md §3.3 / §4.5): gradien 110deg. Di-scope ke html, bukan #layout-wrapper,
   supaya modal di luar wrapper ikut tema. !important dipakai karena custom.css memaksa .btn-success flat. */
html.erp-new-theme .btn-primary,
html.erp-new-theme .btn-success,
html.erp-new-theme .btn-info,
html.erp-new-theme .btn-warning,
html.erp-new-theme .btn-danger {
	border-color: transparent !important;
	box-shadow: 0 3px 9px rgba(31, 82, 158, .12);
	color: #fff !important;
}

html.erp-new-theme .btn-primary { background: linear-gradient(110deg, #7552ee 0%, #3b62e9 100%) !important; }
html.erp-new-theme .btn-success { background: linear-gradient(110deg, #089778 0%, #22bba0 100%) !important; }
html.erp-new-theme .btn-info { background: linear-gradient(110deg, #438eee 0%, #58aff1 100%) !important; }
html.erp-new-theme .btn-warning { background: linear-gradient(110deg, #f9bc3e 0%, #ffdc73 100%) !important; color: #47370d !important; }
html.erp-new-theme .btn-danger { background: linear-gradient(110deg, #e85367 0%, #f17d84 100%) !important; }

html.erp-new-theme .btn-primary:hover,
html.erp-new-theme .btn-success:hover,
html.erp-new-theme .btn-info:hover,
html.erp-new-theme .btn-warning:hover,
html.erp-new-theme .btn-danger:hover {
	filter: brightness(.94);
}

html.erp-new-theme .btn-primary:focus,
html.erp-new-theme .btn-success:focus,
html.erp-new-theme .btn-info:focus,
html.erp-new-theme .btn-warning:focus,
html.erp-new-theme .btn-danger:focus {
	box-shadow: 0 3px 9px rgba(31, 82, 158, .12), 0 0 0 .2rem rgba(18, 170, 149, .2);
}

/* Batal / Kembali / Tutup */
html.erp-new-theme .btn-light {
	color: #172b49;
	background: #f5f6f8;
	border-color: #e7eaf0;
}

html.erp-new-theme .btn-light:hover {
	color: #172b49;
	background: #eef1f5;
	border-color: #e2e6ed;
}

/* Toolbar ikon (filter, export, pengaturan) */
html.erp-new-theme .btn-default {
	color: #495057;
	background: #fff;
	border: 1px solid #edeef1;
}

html.erp-new-theme .btn-default:hover {
	color: var(--erp-theme-ink);
	background: rgba(57, 77, 111, .04);
}

/* Tinggi tombol seragam di semua lebar layar: normal 40px, btn-sm 32px.
   custom.css memaksa padding 8px 20px ke semua .btn (termasuk btn-sm) dan 5px 15px !important ke btn-default. */
html.erp-new-theme .btn:not(.header-item):not(.btn-link):not(.btn-close):not(.btn-lg) {
	min-height: 40px;
}

html.erp-new-theme .btn > :is(i.mdi, i.uil, i.fa, i.fas, i.far) {
	line-height: 1;
	vertical-align: -1px;
}

html.erp-new-theme .btn.btn-sm:not(.header-item):not(.btn-link):not(.btn-close):not(.btn-lg) {
	min-height: 32px;
	padding-top: 5px;
	padding-bottom: 5px;
}

html.erp-new-theme .btn-default,
html.erp-new-theme .btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

html.erp-new-theme .btn-default.btn-sm,
html.erp-new-theme .btn-icon.btn-sm {
	padding-top: 3px !important;
	padding-bottom: 3px !important;
}

/* di tombol inline-flex spasi antara ikon dan teks hilang; diganti gap (tidak muncul di tombol ikon saja) */
html.erp-new-theme .btn-default,
html.erp-new-theme .btn-icon,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > :is(.btn-group, .dropdown) > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div > :is(.btn-group, .dropdown) > .btn {
	gap: .35em;
}

html.erp-new-theme .btn-default > i[class*="me-"],
html.erp-new-theme .btn-icon > i[class*="me-"],
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) .btn > i[class*="me-"] {
	margin-right: 0 !important;
}

/* tombol di input-group mengikuti tinggi input */
html.erp-new-theme .input-group > .btn {
	min-height: 0;
}

html.erp-new-theme .btn:disabled,
html.erp-new-theme .btn.disabled {
	filter: none;
	transform: none;
	box-shadow: none;
}

html.erp-new-theme .page-item.active .page-link {
	background-color: var(--erp-theme-blue);
	border-color: var(--erp-theme-blue);
}

/* Toolbar kartu: baris judul + kolom tombol (.col-md-* .text-end). Kolom tombol selebar isinya dan
   turun ke baris berikutnya bila tidak muat, tombol membungkus dengan jarak rata (design.md §9 no. 4). */
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"]:first-child:not(:has(.btn)) {
	flex: 1 1 260px;
	width: auto;
	max-width: 100%;
	min-width: 0;
}

html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 6px;
	width: auto;
	max-width: 100%;
	margin-left: auto;
}

html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div:not(.btn-group):not(.dropdown):not(.modal):not(.d-none) {
	display: flex !important;
	flex: 0 1 auto;
	flex-wrap: wrap !important;
	justify-content: flex-end !important;
	align-items: center;
	gap: 6px !important;
	min-width: 0;
	max-width: 100%;
}

html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > :is(.btn, .btn-group, .dropdown),
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div > :is(.btn, .btn-group, .dropdown) {
	margin: 0 !important;
	white-space: nowrap;
}

/* tombol ikon (btn-default, padding 5px + ikon 20px) disamakan tingginya dengan tombol teks */
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > :is(.btn-group, .dropdown) > .btn,
html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div > :is(.btn-group, .dropdown) > .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
}

html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) :is(.btn, .btn-group, .dropdown) > i {
	line-height: 1;
}

/* Toolbar lepas (d-flex justify-content-end berisi tombol) ikut membungkus */
html.erp-new-theme .d-flex.justify-content-end:has(> .btn) {
	flex-wrap: wrap;
	gap: 6px;
}

html.erp-new-theme .d-flex.justify-content-end > .btn {
	white-space: nowrap;
}

html.erp-new-theme .form-control,
html.erp-new-theme .form-select,
html.erp-new-theme .select2-container--default .select2-selection--single,
html.erp-new-theme .select2-container--default .select2-selection--multiple {
	border-radius: 6px;
}

html.erp-new-theme .form-control:focus,
html.erp-new-theme .form-select:focus {
	border-color: #66b9a8;
	box-shadow: 0 0 0 .2rem rgba(18, 170, 149, .12);
}

html.erp-new-theme .table thead th {
	color: #24445b;
	background: #edf5f8;
	border-color: #dce8ed;
}

html.erp-new-theme .footer {
	min-height: 60px;
	color: #74788d;
	background: #fff;
}

@media (max-width: 991.98px) {
	html.erp-new-theme #page-topbar,
	html.erp-new-theme body.vertical-collpsed #page-topbar {
		left: 0 !important;
	}

	html.erp-new-theme #page-topbar .navbar-brand-box,
	html.erp-new-theme body.vertical-collpsed #page-topbar .navbar-brand-box {
		position: absolute;
		width: 70px !important;
		justify-content: center;
		padding: 0 8px;
		background: transparent;
	}

	html.erp-new-theme #page-topbar .navbar-header {
		padding-left: 70px;
	}

	html.erp-new-theme .erp-new-brand span {
		display: none;
	}

	html.erp-new-theme .erp-new-brand img {
		width: 36px;
		height: 36px;
	}
}

@media (max-width: 767.98px) {
	/* kolom tombol sudah turun di bawah judul: rata kiri dan selebar kartu */
	html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) {
		flex: 1 1 100%;
		justify-content: flex-start;
		margin-top: 12px;
		margin-left: 0;
	}

	html.erp-new-theme .card-body > .row:has(> [class*="col-"]:nth-child(2):last-child) > [class*="col-"].text-end:has(.btn) > div:not(.btn-group):not(.dropdown):not(.modal):not(.d-none) {
		justify-content: flex-start !important;
	}

	html.erp-new-theme .page-title-box .form-inline,
	html.erp-new-theme .page-title-box .search-box {
		width: 100%;
	}

	html.erp-new-theme .page-title-box .search-box .form-control {
		width: 100%;
	}
}

@media (max-width: 575.98px) {
	/* hanya padding samping yang dikecilkan; tinggi tetap sama dengan desktop */
	html.erp-new-theme .btn {
		padding-left: 14px;
		padding-right: 14px;
	}

	html.erp-new-theme .btn-sm {
		padding-left: 10px;
		padding-right: 10px;
	}

	html.erp-new-theme #page-topbar .navbar-brand-box,
	html.erp-new-theme body.vertical-collpsed #page-topbar .navbar-brand-box {
		width: 58px !important;
		justify-content: center;
		padding: 0 8px;
	}

	html.erp-new-theme #page-topbar .navbar-header {
		padding-left: 58px;
		padding-right: 8px;
	}

	html.erp-new-theme .erp-new-brand span {
		display: none;
	}

	html.erp-new-theme .erp-new-brand img {
		width: 36px;
		height: 36px;
	}
}
