/**
 * WMS Modern UI — global enhancements (dashboard, master data, e-commerce, auth)
 */
:root {
	--wms-primary: #4f46e5;
	--wms-primary-hover: #4338ca;
	--wms-primary-soft: rgba(79, 70, 229, 0.12);
	--wms-accent: #0ea5e9;
	--wms-bg: #f0f2f8;
	--wms-surface: #ffffff;
	--wms-border: #e5e9f2;
	--wms-text: #111827;
	--wms-muted: #6b7280;
	--wms-radius: 14px;
	--wms-radius-sm: 10px;
	--wms-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
	--wms-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
	--wms-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ─── Base ─── */
body.wms-ui,
body.wms-auth-page {
	font-family: var(--wms-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.wms-ui {
	background: var(--wms-bg) !important;
}

body.wms-ui .app-content.main-content,
body.wms-ui .side-app {
	background: transparent !important;
}

body.wms-ui .side-app {
	padding: 1rem 1.25rem 1.5rem;
}

/* ─── Header ─── */
body.wms-ui .app-header {
	background: rgba(255, 255, 255, 0.92) !important;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--wms-border) !important;
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

body.wms-ui .header-icon {
	transition: color 0.15s ease, transform 0.15s ease;
}

body.wms-ui .nav-link.icon:hover .header-icon {
	color: var(--wms-primary);
}

/* ─── Page header ─── */
body.wms-ui .page-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
	padding: 1.1rem 1.25rem;
	background: var(--wms-surface);
	border: 1px solid var(--wms-border);
	border-radius: var(--wms-radius);
	box-shadow: var(--wms-shadow);
}

body.wms-ui .page-header .page-title {
	font-weight: 700;
	font-size: 1.35rem;
	color: var(--wms-text);
	letter-spacing: -0.02em;
}

body.wms-ui .breadcrumb-style1 {
	background: transparent;
	padding: 0;
	margin: 0.35rem 0 0;
	font-size: 0.8125rem;
}

body.wms-ui .breadcrumb-item a {
	color: var(--wms-muted);
	transition: color 0.15s;
}

body.wms-ui .breadcrumb-item a:hover {
	color: var(--wms-primary);
}

body.wms-ui .page-rightheader {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

/* ─── Cards ─── */
body.wms-ui .card {
	border: 1px solid var(--wms-border) !important;
	border-radius: var(--wms-radius) !important;
	box-shadow: var(--wms-shadow) !important;
	background: var(--wms-surface) !important;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.wms-ui .card:hover {
	box-shadow: var(--wms-shadow-lg) !important;
}

body.wms-ui .card-header {
	background: linear-gradient(180deg, #fafbfc 0%, #fff 100%) !important;
	border-bottom: 1px solid var(--wms-border) !important;
	padding: 1rem 1.25rem !important;
}

body.wms-ui .card-title {
	font-weight: 700;
	font-size: 1rem;
	color: var(--wms-text);
	margin-bottom: 0;
}

body.wms-ui .card-body {
	padding: 1.15rem 1.25rem !important;
}

body.wms-ui .card.border-0.shadow-sm,
body.wms-ui .ec-order-list .card,
body.wms-ui .ec-customer-profile .card {
	border: 1px solid var(--wms-border) !important;
}

/* ─── Tables ─── */
body.wms-ui .table-responsive {
	border-radius: var(--wms-radius-sm);
	border: 1px solid var(--wms-border);
	overflow: hidden;
}

body.wms-ui .table {
	margin-bottom: 0;
	font-size: 0.875rem;
}

body.wms-ui .table thead th {
	background: #f8fafc !important;
	color: #374151;
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--wms-border) !important;
	white-space: nowrap;
	padding: 0.85rem 1rem !important;
}

body.wms-ui .table tbody td {
	padding: 0.75rem 1rem !important;
	vertical-align: middle;
	border-color: #f1f5f9 !important;
}

body.wms-ui .table-hover tbody tr:hover {
	background: #f8fafc !important;
}

body.wms-ui .table-bordered {
	border: none !important;
}

/* ─── Forms ─── */
body.wms-ui .form-control,
body.wms-ui .custom-select,
body.wms-ui select.form-control {
	border-radius: var(--wms-radius-sm) !important;
	border-color: var(--wms-border) !important;
	padding: 0.5rem 0.85rem;
	font-size: 0.9rem;
	transition: border-color 0.15s, box-shadow 0.15s;
}

body.wms-ui .form-control:focus,
body.wms-ui .custom-select:focus {
	border-color: var(--wms-primary) !important;
	box-shadow: 0 0 0 3px var(--wms-primary-soft) !important;
}

body.wms-ui .form-label {
	font-weight: 600;
	font-size: 0.8125rem;
	color: #374151;
	margin-bottom: 0.35rem;
}

body.wms-ui .input-group-text {
	border-radius: var(--wms-radius-sm);
	border-color: var(--wms-border);
	background: #f8fafc;
}

/* ─── Buttons ─── */
body.wms-ui .btn {
	border-radius: var(--wms-radius-sm) !important;
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0.45rem 1rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}

body.wms-ui .btn-primary {
	background: linear-gradient(135deg, var(--wms-primary) 0%, #6366f1 100%) !important;
	border: none !important;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

body.wms-ui .btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

body.wms-ui .btn-secondary {
	background: #4b5563 !important;
	border: none !important;
	color: #fff !important;
	box-shadow: 0 2px 6px rgba(75, 85, 99, 0.3);
}

body.wms-ui .btn-secondary:hover {
	background: #374151 !important;
	transform: translateY(-1px);
}

body.wms-ui .btn-outline-primary {
	border-color: var(--wms-primary) !important;
	color: var(--wms-primary) !important;
	background: transparent !important;
	box-shadow: none !important;
}

body.wms-ui .btn-outline-primary:hover {
	background: var(--wms-primary-soft) !important;
	transform: translateY(-1px);
}

body.wms-ui .btn-light {
	background: #f3f4f6 !important;
	border-color: var(--wms-border) !important;
	color: #374151 !important;
	box-shadow: none !important;
}

body.wms-ui .btn-sm {
	padding: 0.35rem 0.75rem;
	font-size: 0.8125rem;
}

/* ─── Badges & alerts ─── */
body.wms-ui .badge {
	font-weight: 600;
	border-radius: 6px;
	padding: 0.35em 0.65em;
}

body.wms-ui .alert {
	border-radius: var(--wms-radius-sm);
	border: none;
	box-shadow: var(--wms-shadow);
}

body.wms-ui .alert-success {
	background: #ecfdf5;
	color: #047857;
}

body.wms-ui .alert-danger {
	background: #fef2f2;
	color: #b91c1c;
}

body.wms-ui .alert-warning {
	background: #fffbeb;
	color: #b45309;
}

/* ─── Nav pills / tabs ─── */
body.wms-ui .nav-pills .nav-link {
	border-radius: var(--wms-radius-sm);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--wms-muted);
}

body.wms-ui .nav-pills .nav-link.active {
	background: var(--wms-primary) !important;
}

/* ─── Modals ─── */
body.wms-ui .modal-content {
	border: none;
	border-radius: var(--wms-radius);
	box-shadow: var(--wms-shadow-lg);
}

body.wms-ui .modal-header {
	border-bottom: 1px solid var(--wms-border);
	padding: 1rem 1.25rem;
}

body.wms-ui .modal-footer {
	border-top: 1px solid var(--wms-border);
}

/* ─── Pagination ─── */
body.wms-ui .pagination .page-link {
	border-radius: 8px !important;
	margin: 0 2px;
	border-color: var(--wms-border);
	color: var(--wms-text);
}

body.wms-ui .pagination .page-item.active .page-link {
	background: var(--wms-primary);
	border-color: var(--wms-primary);
}

/* ─── Footer ─── */
body.wms-ui .footer,
body.ec-catalog-full-page.wms-ui .footer {
	background: var(--wms-surface) !important;
	border-top: 1px solid var(--wms-border) !important;
	padding: 1rem 0 !important;
	font-size: 0.8125rem;
	color: var(--wms-muted);
}

/* ─── Dashboard stat cards ─── */
body.wms-ui .dash1-card,
body.wms-ui .card.overflow-hidden {
	border-radius: var(--wms-radius) !important;
}

/* ─── Custom switch / checkbox cards (jabatan) ─── */
body.wms-ui .card.border-primary {
	border-color: rgba(79, 70, 229, 0.35) !important;
}

body.wms-ui .bg-primary-transparent {
	background: var(--wms-primary-soft) !important;
}

/* ─── Dropdown profile ─── */
body.wms-ui .dropdown-menu {
	border: 1px solid var(--wms-border);
	border-radius: var(--wms-radius-sm);
	box-shadow: var(--wms-shadow-lg);
}

/* ─── Auth pages ─── */
body.wms-auth-page {
	min-height: 100vh;
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%) !important;
	font-family: var(--wms-font);
}

body.wms-auth-page .box {
	opacity: 0.15;
}

body.wms-auth-page .page-content {
	min-height: 100vh;
	display: flex;
	align-items: center;
	padding: 2rem 0;
}

body.wms-auth-page .text-white .card-body,
body.wms-auth-page .wms-auth-panel {
	background: rgba(255, 255, 255, 0.98);
	border-radius: 20px;
	box-shadow: var(--wms-shadow-lg);
	padding: 2rem !important;
	color: var(--wms-text) !important;
	margin: 1rem;
}

body.wms-auth-page .text-white .card-body h2,
body.wms-auth-page .text-white .card-body h4,
body.wms-auth-page .wms-auth-panel h2 {
	color: var(--wms-text) !important;
	font-weight: 700;
}

body.wms-auth-page .text-white-80,
body.wms-auth-page .text-muted {
	color: var(--wms-muted) !important;
}

body.wms-auth-page .form-control {
	border-radius: var(--wms-radius-sm);
	border: 1px solid var(--wms-border);
	padding: 0.65rem 1rem;
}

body.wms-auth-page .form-control:focus {
	border-color: var(--wms-primary);
	box-shadow: 0 0 0 3px var(--wms-primary-soft);
}

body.wms-auth-page .btn-secondary {
	background: linear-gradient(135deg, var(--wms-primary) 0%, #6366f1 100%) !important;
	border: none !important;
	border-radius: var(--wms-radius-sm);
	padding: 0.65rem 1.25rem;
	font-weight: 600;
}

body.wms-auth-page .input-group-text {
	background: #f8fafc;
	border-color: var(--wms-border);
}

body.wms-auth-page .custom-btns {
	display: none;
}

body.wms-auth-page .col-md-6.d-none.d-md-flex {
	display: none !important;
}

body.wms-auth-page .row.justify-content-center > .col-lg-8,
body.wms-auth-page .col-md-6:first-child {
	max-width: 440px;
	margin: 0 auto;
	width: 100%;
}

/* Catalog storefront content area */
body.ec-catalog-full-page.wms-ui .side-app {
	padding: 0.5rem 0.65rem 1rem;
}

body.ec-catalog-full-page.wms-ui .app-header {
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

/* Empty states */
body.wms-ui .text-muted.small {
	color: var(--wms-muted) !important;
}

/* Loader subtle */
body.wms-ui #global-loader .dimmer {
	background: rgba(255, 255, 255, 0.85) !important;
}

/* ─── Mobile responsive ─── */
@media (max-width: 991.98px) {
	body.wms-ui .side-app {
		padding: 0.75rem;
	}

	body.wms-ui .page-header {
		padding: 1rem;
	}

	body.wms-ui .page-header .page-title {
		font-size: 1.15rem;
	}

	body.wms-ui .card-body {
		padding: 1rem !important;
	}
}

@media (max-width: 767.98px) {
	body.wms-ui .page-header {
		flex-direction: column;
		align-items: stretch;
	}

	body.wms-ui .page-leftheader,
	body.wms-ui .page-rightheader {
		width: 100%;
	}

	body.wms-ui .page-rightheader {
		justify-content: stretch;
	}

	body.wms-ui .page-rightheader .btn,
	body.wms-ui .page-rightheader > a {
		flex: 1 1 auto;
		text-align: center;
		min-width: calc(50% - 0.25rem);
	}

	body.wms-ui .table {
		font-size: 0.8125rem;
	}

	body.wms-ui .table thead th,
	body.wms-ui .table tbody td {
		padding: 0.6rem 0.5rem !important;
	}

	body.wms-ui .btn-group.w-100 .btn {
		font-size: 0.75rem;
		padding: 0.35rem 0.5rem;
	}

	body.wms-ui .app-header .order-lg-2 {
		gap: 2px !important;
	}

	body.wms-ui .app-header .btn-sm {
		padding: 0.25rem 0.5rem;
		font-size: 0.75rem;
	}

	body.wms-auth-page .page-content {
		padding: 1rem 0;
	}

	body.wms-auth-page .text-white .card-body,
	body.wms-auth-page .wms-auth-panel {
		padding: 1.25rem !important;
		margin: 0.5rem;
		border-radius: 16px;
	}

	body.ec-catalog-full-page.wms-ui .side-app {
		padding: 0.4rem 0.5rem 0.85rem;
	}
}

@media (max-width: 575.98px) {
	body.wms-ui .page-rightheader .btn,
	body.wms-ui .page-rightheader > a {
		width: 100%;
		min-width: 100%;
		margin-left: 0 !important;
	}

	body.wms-ui .row > [class*="col-"] {
		margin-bottom: 0.5rem;
	}

	body.wms-ui .d-flex.flex-wrap {
		gap: 0.5rem !important;
	}
}

/* ─── E-commerce catalog ─── */
body.wms-ui .ec-catalog-hero {
	border-radius: var(--wms-radius) !important;
	overflow: hidden;
}

body.wms-ui .ec-filter-label {
	font-weight: 600;
	font-size: 0.8125rem;
	color: #374151;
}

body.wms-ui .ec-filter-input,
body.wms-ui .ec-pcat-card .btn {
	border-radius: var(--wms-radius-sm) !important;
}

body.wms-ui .ec-pcat-card {
	border-radius: var(--wms-radius) !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.wms-ui .ec-pcat-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wms-shadow-lg) !important;
}

body.wms-ui .ec-catalog-empty-icon {
	font-size: 3rem;
	color: #c7d2fe;
}

body.wms-ui .ec-msel__menu {
	border-radius: var(--wms-radius-sm) !important;
	border-color: var(--wms-border) !important;
}

/* Sidebar menu polish */
body.wms-ui .app-sidebar {
	box-shadow: 2px 0 16px rgba(15, 23, 42, 0.06);
}

body.wms-ui .side-menu__item {
	border-radius: 8px;
	margin: 2px 8px;
	transition: background 0.15s ease;
}

body.wms-ui .side-menu__item.active,
body.wms-ui .side-menu__item:hover {
	background: rgba(79, 70, 229, 0.08) !important;
}

/* Skin switcher — jangan menutupi header (profil/cart) di mobile portrait */
@media (max-width: 991.98px) {
	body.wms-ui .switcher-wrapper,
	body.wms-ui .demo_changer {
		pointer-events: none;
		height: auto;
		top: auto;
		bottom: 0;
	}

	body.wms-ui .demo_changer .demo-icon {
		pointer-events: auto;
		position: fixed;
		top: auto !important;
		bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
		right: 0;
		left: auto;
		float: none;
		margin: 0;
		z-index: 1040;
	}

	body.wms-ui .demo_changer .form_holder {
		pointer-events: auto;
	}

	body.wms-ui .app-header {
		z-index: 1050;
	}

	body.wms-ui .app-header .order-lg-2 {
		position: relative;
		z-index: 1;
	}
}

/* Print */
@media print {
	body.wms-ui .app-header,
	body.wms-ui .app-sidebar,
	body.wms-ui .footer,
	body.wms-ui .switcher-wrapper {
		display: none !important;
	}
}
