/* Google Fonts - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");
@import url("https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css");

:root {
	--timberwolf: #dad7cd;
	--sage: #a3b18a;
	--fern-green: #588157;
	--hunter-green: #3a5a40;
	--brunswick-green: #344e41;
	/* Enhance Global Styles */
	--transition-speed: 0.3s;
	--box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	--hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: "Poppins", sans-serif;
}

body {
	min-height: 100%;
	background: var(--timberwolf);
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

/* Smooth scrolling for mobile */
@media screen and (max-width: 420px) {
	html {
		scroll-behavior: smooth;
		-webkit-overflow-scrolling: touch;
	}

	body {
		overscroll-behavior-y: contain;
	}
}

/* --- Sidebar layout --- */
nav {
	position: fixed;
	top: 0;
	left: 0;
	height: 70px;
	width: 100%;
	display: flex;
	align-items: center;
	background: var(--brunswick-green);
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
	z-index: 1000; /* Sama dengan sidebar */
}

nav .logo {
	display: flex;
	align-items: center;
	margin: 0 24px;
}

.logo .menu-icon {
	color: var(--timberwolf);
	font-size: 24px;
	margin-right: 14px;
	cursor: pointer;
}

.logo .logo-name {
	color: var(--timberwolf);
	font-size: 22px;
	font-weight: 600;
}

/* Mobile optimization for navbar */
@media screen and (max-width: 420px) {
	nav {
		height: 60px;
	}

	nav .logo {
		margin: 0 16px;
	}

	.logo .menu-icon {
		font-size: 22px;
		margin-right: 12px;
	}

	.logo .logo-name {
		font-size: 18px;
	}
}

/* Optimized for 396×667 viewport */
@media screen and (max-width: 400px) {
	nav {
		height: 56px;
	}

	nav .logo {
		margin: 0 12px;
	}

	.logo .menu-icon {
		font-size: 20px;
		margin-right: 10px;
	}

	.logo .logo-name {
		font-size: 16px;
	}
}

nav .sidebar {
	position: fixed;
	top: 0;
	left: -100%;
	height: 100%;
	width: 260px;
	padding: 20px 0;
	background-color: var(--hunter-green);
	box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1000;
	overflow: hidden; /* Change from auto to hidden */
}
nav.open .sidebar {
	left: 0;
}

/* Mobile optimization for sidebar */
@media screen and (max-width: 420px) {
	nav .sidebar {
		width: 240px;
		padding: 16px 0;
	}

	.sidebar .sidebar-content {
		padding: 24px 12px;
	}

	.list .nav-link {
		padding: 12px 10px;
		margin: 6px 0;
	}

	.nav-link .icon {
		font-size: 18px;
		margin-right: 12px;
	}

	.nav-link .link {
		font-size: 15px;
	}
}

@media screen and (max-width: 400px) {
	nav .sidebar {
		width: 100vw;
	}

	.sidebar .sidebar-content {
		padding: 20px 10px;
	}

	.list .nav-link {
		padding: 11px 9px;
		margin: 5px 0;
	}

	.nav-link .icon {
		font-size: 17px;
		margin-right: 11px;
	}

	.nav-link .link {
		font-size: 14px;
	}
}

.sidebar .sidebar-content {
	display: flex;
	height: 100%;
	flex-direction: column;
	justify-content: space-between;
	padding: 30px 16px;
	overflow-y: auto; /* Only inner content scrollable if needed */
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar .sidebar-content::-webkit-scrollbar {
	display: none;
}

/* Make sure sidebar content fits better */
.sidebar-content .lists {
	max-height: calc(
		100% - 60px
	); /* Adjust based on your bottom content height */
}

.sidebar-content .list {
	list-style: none;
}

.list .nav-link {
	display: flex;
	align-items: center;
	margin: 8px 0;
	padding: 14px 12px;
	border-radius: 8px;
	text-decoration: none;
	background: transparent;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lists .nav-link:hover {
	background-color: var(--fern-green);
}

.nav-link .icon {
	margin-right: 14px;
	font-size: 20px;
	color: var(--sage);
	transition: 0.3s;
}

.nav-link .link {
	font-size: 16px;
	color: var(--timberwolf);
	font-weight: 400;
	transition: 0.3s;
}

.lists .nav-link:hover .icon,
.lists .nav-link:hover .link {
	color: #fff;
}

.overlay {
	position: fixed;
	top: 0;
	left: -100%;
	height: 100vh;
	width: 200%;
	opacity: 0;
	pointer-events: none;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	background: rgba(0, 0, 0, 0.4);
	z-index: 999; /* Sedikit lebih rendah dari sidebar */
}
nav.open ~ .overlay {
	opacity: 1;
	left: 260px;
	pointer-events: auto;
}

/* Mobile optimization for overlay */
@media screen and (max-width: 420px) {
	nav.open ~ .overlay {
		left: 240px;
		background: rgba(0, 0, 0, 0.5);
	}
}

@media screen and (max-width: 400px) {
	nav.open ~ .overlay {
		left: 100vw;
	}
}

/* Main Container Styles */
.main-container {
	padding: 90px 20px 20px 20px;
	margin-left: 0;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.open ~ .main-container {
	margin-left: 260px;
}

/* Mobile optimization for main container */
@media screen and (max-width: 420px) {
	.main-container {
		padding: 72px 14px 18px 14px;
	}

	nav.open ~ .main-container {
		margin-left: 0;
	}
}

@media screen and (max-width: 400px) {
	.main-container {
		padding: 68px 12px 14px 12px;
	}
}

.main-title {
	margin-bottom: 30px;
}

.main-title h2 {
	color: var(--brunswick-green);
	font-size: 28px;
	font-weight: 600;
	line-height: 1.3;
}

/* Mobile optimization for main title */
@media screen and (max-width: 420px) {
	.main-title {
		margin-bottom: 20px;
	}

	.main-title h2 {
		font-size: 23px;
		font-weight: 600;
		letter-spacing: -0.01em;
	}
}

@media screen and (max-width: 400px) {
	.main-title {
		margin-bottom: 18px;
	}

	.main-title h2 {
		font-size: 21px;
	}
}

/* Mobile optimization for title */
@media screen and (max-width: 420px) {
	.main-title {
		margin-bottom: 16px;
	}

	.main-title h2 {
		font-size: 22px;
	}
}

@media screen and (max-width: 400px) {
	.main-title {
		margin-bottom: 14px;
	}

	.main-title h2 {
		font-size: 20px;
	}
}

/* Card Styles */
.card-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

/* Mobile optimization for cards */
@media screen and (max-width: 420px) {
	.card-container {
		grid-template-columns: 1fr;
		gap: 12px;
		margin-bottom: 20px;
	}
}

@media screen and (max-width: 400px) {
	.card-container {
		gap: 10px;
		margin-bottom: 16px;
	}
}

.card {
	background: white;
	padding: 20px;
	border-radius: 10px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition:
		transform var(--transition-speed),
		box-shadow var(--transition-speed);
	position: relative;
	overflow: hidden;
}

/* Mobile optimization for individual cards */
@media screen and (max-width: 420px) {
	.card {
		padding: 16px;
		border-radius: 8px;
	}

	.card:active {
		transform: scale(0.98);
	}
}

@media screen and (max-width: 400px) {
	.card {
		padding: 14px;
		border-radius: 6px;
	}
}

.card::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 25%;
	z-index: 0;
	opacity: 0.15;
}

.card-instock::after {
	background: linear-gradient(to left, #2da544, transparent);
}

.card-lowstock::after {
	background: linear-gradient(to left, #ffa116, transparent);
}

.card-outstock::after {
	background: linear-gradient(to left, #ef4444, transparent);
}

.card-inner,
.card h3 {
	position: relative;
	z-index: 1;
}

.card-instock i,
.card-instock h3 {
	color: #2da544;
}

.card-lowstock i,
.card-lowstock h3 {
	color: #ffa116;
}

.card-outstock i,
.card-outstock h3 {
	color: #ef4444;
}

.card:hover {
	transform: translateY(-5px);
	box-shadow: var(--hover-shadow);
	cursor: pointer;
}

.card-inner {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

.card i {
	font-size: 30px;
	margin-right: 10px;
	color: var(--hunter-green);
}

.card-title {
	color: var(--brunswick-green);
	font-size: 16px;
	font-weight: 600;
}

.card h3 {
	color: var(--fern-green);
	font-size: 24px;
	font-weight: 600;
}

/* Mobile optimization for card content */
@media screen and (max-width: 420px) {
	.card i {
		font-size: 26px;
		margin-right: 8px;
	}

	.card-title {
		font-size: 14px;
	}

	.card h3 {
		font-size: 20px;
	}

	.card-inner {
		margin-bottom: 8px;
	}
}

@media screen and (max-width: 400px) {
	.card i {
		font-size: 24px;
		margin-right: 6px;
	}

	.card-title {
		font-size: 13px;
	}

	.card h3 {
		font-size: 18px;
	}
}

/* Table Styles */
.table-container {
	background: white;
	padding: 20px;
	border-radius: 10px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	position: relative;
	z-index: 1; /* Lebih rendah dari sidebar dan nav */
}

.table-container h3 {
	color: var(--brunswick-green);
	margin-bottom: 18px;
	font-size: 20px;
	font-weight: 600;
}

/* Mobile optimization for table container */
@media screen and (max-width: 420px) {
	.table-container {
		padding: 16px;
		border-radius: 10px;
		margin: 0;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	}

	.table-container h3 {
		font-size: 18px;
		margin-bottom: 16px;
		line-height: 1.4;
	}
}

@media screen and (max-width: 400px) {
	.table-container {
		padding: 14px 12px;
		border-radius: 8px;
	}

	.table-container h3 {
		font-size: 17px;
		margin-bottom: 14px;
	}
}

/* Table base */
.table-container table {
	width: 100%;
	border-collapse: collapse;
}
.table-container th,
.table-container td {
	border-bottom: 1px solid #eee;
	padding: 12px 10px;
	text-align: left;
}

.table-container th.numeric-col,
.table-container td.numeric-col {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

.table-container td.coverage-risk {
	font-weight: 700;
	color: #ef4444;
	background: #fde8e8;
}

/* Keep td as table-cell (not flex) */
td.actions {
	display: table-cell !important;
	white-space: nowrap;
	vertical-align: middle;
	padding: 8px 12px;
	width: 110px;
	min-width: 110px;
}

/* Use inner wrapper for layout */
td.actions .actions-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 74px;
}
td.actions .action-form {
	display: inline; /* avoid block that can break borders */
	margin: 0;
}

/* Mobile optimization for actions */
@media screen and (max-width: 420px) {
	td.actions .actions-inline {
		display: flex;
		gap: 10px;
		width: auto;
		margin-left: auto;
		justify-content: flex-end;
	}
}

@media screen and (max-width: 400px) {
	td.actions .actions-inline {
		gap: 8px;
	}
}

/* Buttons */
.btn-edit,
.btn-delete {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	background: #f3faf5;
	color: #2f5c45;
	transition: all 0.2s;
}
.btn-delete {
	background: #fff5f5;
	color: #dc2626;
}
.btn-edit:hover {
	background: #2f5c45;
	color: #fff;
	border-color: #2f5c45;
}
.btn-delete:hover {
	background: #dc2626;
	color: #fff;
	border-color: #dc2626;
}

/* Mobile optimization for edit/delete buttons */
@media screen and (max-width: 420px) {
	.btn-edit,
	.btn-delete {
		width: 44px;
		height: 44px;
		border-radius: 8px;
		border-width: 2px;
		flex-shrink: 0;
	}

	.btn-edit i,
	.btn-delete i {
		font-size: 20px;
	}

	.btn-edit:active {
		background: #2f5c45;
		color: #fff;
		transform: scale(0.95);
	}

	.btn-delete:active {
		background: #dc2626;
		color: #fff;
		transform: scale(0.95);
	}
}

@media screen and (max-width: 400px) {
	.btn-edit,
	.btn-delete {
		width: 40px;
		height: 40px;
	}

	.btn-edit i,
	.btn-delete i {
		font-size: 18px;
	}
}

/* Optional: avoid row scale that can cause hairline gaps */
.table-container tbody tr:hover {
	transform: none;
}

tbody tr {
	transition: background-color 0.2s ease;
}

tbody tr:hover {
	background-color: #f8f9fa;
	box-shadow: var(--box-shadow);
}

/* Stock Update Form Styles */
.table-container input[type="number"] {
	width: 100px;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
}

/* Mobile optimization for number input - prevent iOS zoom */
@media screen and (max-width: 420px) {
	.table-container input[type="number"] {
		font-size: 16px;
		padding: 10px 8px;
		width: 90px;
	}
}

@media screen and (max-width: 400px) {
	.table-container input[type="number"] {
		width: 85px;
		padding: 9px 6px;
	}
}

/* Hide number input spinners and optionally disable direct pointer events */
.quantity-control input[type="number"] {
	-webkit-appearance: none; /* Chrome/Safari */
	-moz-appearance: textfield; /* Firefox */
	appearance: textfield;
	/* pointer-events: none; prevent typing, rely on +/- buttons */
}

.quantity-control input[type="number"]::-webkit-inner-spin-button,
.quantity-control input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.table-container .form-actions {
	margin-top: 20px;
	text-align: right;
}

.table-container .btn-submit {
	padding: 10px 20px;
	background: var(--hunter-green);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s ease;
}

/* Level input styling */
td input[type="number"] {
	width: 80px;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
}

/* Mobile optimization for level input */
@media screen and (max-width: 420px) {
	td input[type="number"] {
		width: 100%;
		max-width: 120px;
		padding: 10px 8px;
		font-size: 16px;
		border-radius: 8px;
	}
}

@media screen and (max-width: 400px) {
	td input[type="number"] {
		max-width: 110px;
		padding: 9px 6px;
	}
}

/* --- Update Stock Page Enhancements --- */
.main-title .note {
	margin-top: 8px;
	display: inline-block;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.6),
		rgba(255, 255, 255, 0.4)
	);
	color: var(--brunswick-green);
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14px;
	box-shadow: var(--box-shadow);
}

/* Mobile optimization for note */
@media screen and (max-width: 420px) {
	.main-title .note {
		font-size: 12px;
		padding: 6px 10px;
		margin-top: 6px;
		display: block;
		text-align: left;
	}
}

@media screen and (max-width: 400px) {
	.main-title .note {
		font-size: 11px;
		padding: 5px 8px;
		margin-top: 5px;
	}
}

.quantity-control {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Mobile optimization for quantity control */
@media screen and (max-width: 420px) {
	.quantity-control {
		gap: 4px;
		width: 100%;
		justify-content: center;
	}
}

@media screen and (max-width: 400px) {
	.quantity-control {
		gap: 2px;
	}
}

.btn-qty {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	border: 1px solid #e6e6e6;
	background: #ffffff;
	color: var(--brunswick-green);
	cursor: pointer;
	transition:
		background 0.18s ease,
		transform 0.12s ease;
}

.btn-qty:hover {
	background: var(--sage);
	color: #fff;
	transform: translateY(-1px);
}

/* Mobile optimization for quantity buttons */
@media screen and (max-width: 420px) {
	.btn-qty {
		width: 40px;
		height: 40px;
		border-radius: 8px;
		flex-shrink: 0;
	}

	.btn-qty i {
		font-size: 18px;
	}

	.btn-qty:active {
		transform: scale(0.95);
		background: var(--sage);
		color: #fff;
	}
}

@media screen and (max-width: 400px) {
	.btn-qty {
		width: 38px;
		height: 38px;
	}

	.btn-qty i {
		font-size: 16px;
	}
}

.btn-save-row {
	padding: 8px 12px;
	border-radius: 8px;
	border: none;
	background: linear-gradient(90deg, var(--fern-green), var(--hunter-green));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(58, 90, 64, 0.12);
	transition:
		transform var(--transition-speed),
		box-shadow var(--transition-speed);
}

.btn-save-row:hover {
	transform: translateY(-3px);
	box-shadow: var(--hover-shadow);
}

/* Mobile optimization for save row button */
@media screen and (max-width: 420px) {
	.btn-save-row {
		padding: 10px 16px;
		font-size: 14px;
		font-weight: 500;
		width: 100%;
		min-height: 44px;
	}

	.btn-save-row:active {
		transform: scale(0.98);
	}
}

@media screen and (max-width: 400px) {
	.btn-save-row {
		padding: 9px 14px;
		font-size: 13px;
		min-height: 42px;
	}
}

/* Table header and zebra rows */
.table-container thead th {
	background: linear-gradient(
		90deg,
		rgba(52, 78, 65, 0.06),
		rgba(83, 132, 90, 0.02)
	);
	color: var(--brunswick-green);
	font-weight: 600;
	position: sticky;
	top: 0;
	z-index: 2;
}

/* Sortable table header links */
.th-sort {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--brunswick-green);
	text-decoration: none;
	font-weight: 600;
	transition: all 0.2s ease;
	padding: 4px 8px;
	margin: -4px -8px;
	border-radius: 4px;
}

.th-sort:hover {
	background: rgba(52, 78, 65, 0.08);
	color: var(--hunter-green);
}

.th-sort i {
	font-size: 16px;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.th-sort:hover i {
	opacity: 1;
}

.table-container tbody tr:nth-child(odd) {
	background: #ffffff;
}
.table-container tbody tr:nth-child(even) {
	background: #fbfdfb;
}

/* Responsive tweaks: allow table to scroll on small screens */
@media (max-width: 900px) {
	.table-container table {
		display: block;
		overflow-x: auto;
		width: 100%;
	}
	.table-container input[type="number"] {
		width: 84px;
	}
	.main-title h2 {
		font-size: 22px;
	}
}

@media (max-width: 420px) {
	.table-container input[type="number"] {
		width: 90px;
		font-size: 16px;
	}
	.main-title h2 {
		font-size: 22px;
	}
}

@media (max-width: 400px) {
	.table-container input[type="number"] {
		width: 85px;
	}
	.main-title h2 {
		font-size: 20px;
	}
}

/* Small helper for inline note in other pages */
.note-inline {
	display: inline-block;
	font-size: 13px;
	color: #445544;
}

.table-container .btn-submit:hover {
	background: var(--brunswick-green);
}

/* Status Styles */
.status {
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 500;
	transition: all var(--transition-speed);
}

.status.in-stock {
	background: #e3f2e5;
	color: #2da544;
}

.status.low-stock {
	background: #fff4e5;
	color: #ffa116;
}

.status.warning-stock {
	background: #fff8e5;
	color: #ff9500;
}

.status.out-stock {
	background: #fde8e8;
	color: #ef4444;
}

.status:hover {
	transform: scale(1.05);
}

/* Mobile optimization for status badges */
@media screen and (max-width: 420px) {
	.status {
		padding: 5px 10px;
		font-size: 13px;
		border-radius: 16px;
	}

	.status:hover {
		transform: none;
	}

	.status:active {
		transform: scale(0.98);
	}
}

@media screen and (max-width: 400px) {
	.status {
		padding: 4px 8px;
		font-size: 12px;
		border-radius: 14px;
	}
}

/* Add Form Styles */
.form-container {
	max-width: 800px;
	margin: 20px auto;
	padding: 20px;
	background: white;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-header {
	margin-bottom: 24px;
}

.form-header h2 {
	color: var(--hunter-green);
	font-size: 24px;
	font-weight: 500;
}

.add-form {
	display: grid;
	gap: 20px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.form-group label {
	color: var(--brunswick-green);
	font-weight: 500;
}

.form-group-inline-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.btn-inline-master {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 1px solid #d9e2d7;
	background: #f3faf5;
	color: var(--hunter-green);
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.btn-inline-master:hover {
	background: var(--hunter-green);
	color: #fff;
	border-color: var(--hunter-green);
}

.inline-feedback {
	min-height: 18px;
	font-size: 13px;
	font-weight: 500;
	color: #666;
}

.inline-feedback.success {
	color: #166534;
}

.inline-feedback.error {
	color: #b91c1c;
}

.form-group input,
.form-group select,
.form-group textarea {
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: var(--fern-green);
}

/* Mobile optimization for form container */
@media screen and (max-width: 420px) {
	.form-container {
		margin: 10px;
		padding: 16px;
		border-radius: 8px;
	}

	.form-header {
		margin-bottom: 18px;
	}

	.form-header h2 {
		font-size: 20px;
	}

	.add-form {
		gap: 16px;
	}

	.form-group {
		gap: 6px;
	}

	.form-group label {
		font-size: 14px;
	}

	.btn-inline-master {
		padding: 7px 10px;
		font-size: 12px;
	}

	.form-group input,
	.form-group select,
	.form-group textarea {
		padding: 11px 10px;
		font-size: 16px;
		border-radius: 8px;
	}
}

@media screen and (max-width: 400px) {
	.form-container {
		margin: 8px;
		padding: 14px;
		border-radius: 6px;
	}

	.form-header {
		margin-bottom: 16px;
	}

	.form-header h2 {
		font-size: 18px;
	}

	.add-form {
		gap: 14px;
	}

	.form-group {
		gap: 5px;
	}

	.form-group label {
		font-size: 13px;
	}

	.btn-inline-master {
		padding: 6px 9px;
		font-size: 11px;
	}

	.form-group input,
	.form-group select,
	.form-group textarea {
		padding: 10px 9px;
	}
}

.form-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}

.btn-submit,
.btn-cancel {
	padding: 10px 24px;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.btn-submit {
	background: var(--hunter-green);
	color: white;
	border: none;
}

.btn-cancel {
	background: #f5f5f5;
	color: #666;
	border: 1px solid #ddd;
}

.btn-submit:hover {
	background: var(--brunswick-green);
}

.btn-cancel:hover {
	background: #e5e5e5;
}

/* Mobile optimization for form actions and buttons */
@media screen and (max-width: 420px) {
	.form-actions {
		flex-direction: column;
		gap: 10px;
		margin-top: 20px;
	}

	.btn-submit,
	.btn-cancel {
		width: 100%;
		padding: 12px 20px;
		font-size: 16px;
		min-height: 44px;
	}
}

@media screen and (max-width: 400px) {
	.form-actions {
		gap: 8px;
		margin-top: 16px;
	}

	.btn-submit,
	.btn-cancel {
		padding: 11px 18px;
		min-height: 42px;
	}
}

/* Inline per-row save button in update-stock table */
.btn-save-row {
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all var(--transition-speed);
	background: var(--hunter-green);
	color: white;
	border: none;
}

.btn-save-row:hover {
	background: var(--brunswick-green);
}

.table-container td[data-label="Aksi"] {
	text-align: center;
}

.form-group select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: white;
	font-size: 14px;
}

.form-group select:focus {
	outline: none;
	border-color: var(--hunter-green);
	box-shadow: 0 0 0 2px rgba(64, 145, 108, 0.1);
}

/* Category filter row styles (update-stock.php) */
#filter-count improvements and responsive behaviour .filter-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	flex-wrap: wrap; /* allow items to wrap on small widths */
}

.filter-row label {
	color: var(--brunswick-green);
	font-weight: 500;
	font-size: 14px;
}

#category-filter {
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: white;
	transition:
		border-color var(--transition-speed),
		box-shadow var(--transition-speed),
		transform var(--transition-speed);
	cursor: pointer;
	min-width: 0; /* allow shrinking when needed */
	flex: 0 1 220px; /* prefer 220px but allow shrinking */
	max-width: 100%;
}

#category-filter:hover {
	border-color: var(--fern-green);
}

#category-filter:focus {
	outline: none;
	border-color: var(--hunter-green);
	box-shadow: 0 4px 12px rgba(58, 90, 64, 0.06);
	transform: translateY(-1px);
}

#filter-count {
	font-size: 13px;
	color: #666;
	flex: 1 1 auto; /* take remaining space */
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-left: 12px;
	margin-bottom: 200px;
	min-width: 0; /* important for text-overflow inside flex */
}

/* Mobile: stack filter controls and show count on its own line */
@media screen and (max-width: 480px) {
	.filter-row {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	#category-filter {
		width: 100%;
		flex: 1 1 auto;
	}

	#filter-count {
		width: 100%;
		text-align: left;
		margin-left: 0;
		margin-top: 6px;
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	/* Add extra spacing below the filter area so cards/tables don't touch it */
	.filter-row {
		margin-bottom: 18px; /* increased space on mobile */
		padding-bottom: 6px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.04);
	}

	/* Ensure table container doesn't overlap when space is tight */
	.table-container {
		padding-top: 10px;
	}
}

/* Additional mobile optimization for filter row */
@media screen and (max-width: 420px) {
	.filter-row {
		margin-bottom: 16px;
		gap: 10px;
	}

	.filter-row label {
		font-size: 13px;
		font-weight: 600;
	}

	#category-filter {
		padding: 10px 12px;
		font-size: 16px;
		border-radius: 8px;
	}

	#filter-count {
		font-size: 12px;
		margin-top: 4px;
		margin-bottom: 0;
	}
}

@media screen and (max-width: 400px) {
	.filter-row {
		margin-bottom: 14px;
		gap: 8px;
	}

	.filter-row label {
		font-size: 12px;
	}

	#category-filter {
		padding: 9px 10px;
	}

	#filter-count {
		font-size: 11px;
	}
}

/* Table Header Styles */
.table-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	gap: 20px;
	flex-wrap: wrap;
}

/* Mobile optimization for table header */
@media screen and (max-width: 420px) {
	.table-header {
		flex-direction: column;
		gap: 12px;
		margin-bottom: 16px;
		align-items: stretch;
	}
}

@media screen and (max-width: 400px) {
	.table-header {
		gap: 10px;
		margin-bottom: 14px;
	}
}

.table-search {
	display: flex;
	align-items: center;
	background: #f5f5f5;
	padding: 8px 12px;
	border-radius: 6px;
	flex: 1;
}

.table-search i {
	color: var(--brunswick-green);
	margin-right: 8px;
}

.table-search input {
	border: none;
	background: none;
	outline: none;
	width: 100%;
	color: var(--brunswick-green);
}

/* Mobile optimization for search input - prevent iOS zoom */
@media screen and (max-width: 420px) {
	.table-search input {
		font-size: 16px;
	}

	.table-search {
		padding: 10px 12px;
	}
}

@media screen and (max-width: 400px) {
	.table-search {
		padding: 9px 10px;
		border-radius: 6px;
	}

	.table-search i {
		margin-right: 6px;
		font-size: 16px;
	}
}

.table-filter {
	display: flex;
	gap: 12px;
}

.table-filter select {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	color: var(--brunswick-green);
	background: white;
	cursor: pointer;
}

/* Mobile optimization for select - prevent iOS zoom */
@media screen and (max-width: 420px) {
	.table-filter select {
		font-size: 16px;
		padding: 10px 12px;
	}
}

@media screen and (max-width: 400px) {
	.table-filter select {
		padding: 9px 10px;
	}
}

/* Table Action Buttons */
.actions {
	display: flex;
	gap: 8px;
}

.btn-edit,
.btn-delete {
	padding: 6px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
}

.btn-edit {
	background: #e3f2e5;
	color: #2da544;
}

.btn-delete {
	background: #fde8e8;
	color: #ef4444;
}

.btn-edit:hover,
.btn-delete:hover {
	opacity: 0.8;
}

/* Table Pagination */
.table-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
}

.btn-page {
	padding: 8px 12px;
	border: 1px solid #ddd;
	background: white;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	color: var(--brunswick-green);
}

.btn-page.active,
.btn-page:hover {
	background: var(--hunter-green);
	color: white;
	border-color: var(--hunter-green);
}

.bulk-select-header,
.bulk-select-cell {
	text-align: center;
	width: 42px;
}

.bulk-select-cell input[type="checkbox"],
.bulk-select-header input[type="checkbox"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
}

.bulk-action-sticky {
	position: sticky;
	bottom: 12px;
	margin-top: 14px;
	padding: 12px;
	border: 1px solid rgba(58, 90, 64, 0.16);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 6px 18px rgba(58, 90, 64, 0.12);
	z-index: 5;
}

.bulk-action-form {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.bulk-action-summary {
	font-size: 14px;
	font-weight: 500;
	color: var(--brunswick-green);
}

.bulk-action-controls {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.bulk-action-controls select {
	min-width: 165px;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	background: #fff;
	color: var(--brunswick-green);
}

.item-expand-cell {
	text-align: center;
}

.row-expand-toggle {
	padding: 6px 10px;
	font-size: 12px;
}

.item-details-row td {
	background: #f9fbf8;
	border-top: none;
}

.item-details-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(180px, 1fr));
	gap: 10px;
	padding: 10px 4px;
}

.item-detail {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px 10px;
	border: 1px solid rgba(58, 90, 64, 0.16);
	border-radius: 8px;
	background: #ffffff;
}

.item-detail .label {
	font-size: 12px;
	font-weight: 600;
	color: #4b5563;
}

.item-detail .value {
	font-size: 13px;
	color: var(--brunswick-green);
	word-break: break-word;
}

.item-detail--full {
	grid-column: 1 / -1;
}

/* Mobile optimization for pagination */
@media screen and (max-width: 420px) {
	.table-pagination {
		gap: 6px;
		margin-top: 16px;
		flex-wrap: wrap;
	}

	.bulk-select-header,
	.bulk-select-cell,
	#select-all-items,
	.bulk-item-checkbox,
	.bulk-action-sticky {
		display: none !important;
	}

	.bulk-action-form {
		flex-direction: column;
		align-items: stretch;
	}

	.item-details-grid {
		grid-template-columns: 1fr;
	}

	.bulk-action-controls {
		width: 100%;
	}

	.bulk-action-controls select,
	.bulk-action-controls .btn-filter,
	.bulk-action-controls .btn-page {
		width: 100%;
	}

	.btn-page {
		padding: 10px 14px;
		font-size: 14px;
		border-radius: 6px;
		min-width: 44px;
		min-height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.btn-page:hover {
		transform: none;
	}

	.btn-page:active {
		transform: scale(0.95);
	}
}

@media screen and (max-width: 400px) {
	.table-pagination {
		gap: 5px;
		margin-top: 14px;
	}

	.btn-page {
		padding: 9px 12px;
		font-size: 13px;
		min-width: 40px;
		min-height: 40px;
	}
}

/* Sort Icons */
th {
	cursor: pointer;
	user-select: none;
}

th i {
	font-size: 14px;
	margin-left: 4px;
	transition: transform 0.3s ease;
}

th:hover i {
	transform: translateY(-2px);
}

/* Sortable Column Styles */
th.sortable {
	position: relative;
	cursor: pointer;
}

th.sortable a {
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-right: 24px; /* Space for the sort indicator */
	width: 100%;
}

/* Sortable header styling */
.sort-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.sort-link {
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	padding: 4px;
	border-radius: 4px;
}

.sort-link:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

.sort-link i {
	font-size: 18px;
}

/* Legacy sort pseudo-element reset */
th.sortable::after {
	content: none;
}

/* Active sort indicators with arrows */
th.sortable.sort-asc::after {
	content: "\ea77"; /* bx-up-arrow-alt */
	opacity: 1;
	color: var(--hunter-green);
}

th.sortable.sort-desc::after {
	content: "\ea5f"; /* bx-down-arrow-alt */
	opacity: 1;
	color: var(--hunter-green);
}

th.sortable:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

th.sortable:hover::after {
	opacity: 0.9;
}

/* Make entire header cell clickable */
th.sortable a {
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	padding: 12px;
	box-sizing: border-box;
	z-index: 1;
}

/* Fix table header text positioning */
th.sortable {
	padding: 0; /* Remove default padding */
	position: relative;
}

/* Ensure header content stays visible */
th.sortable span {
	position: relative;
	z-index: 0;
	pointer-events: none;
	padding: 12px 0;
	display: block;
}

/* Table sorting styles */
table th a {
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

table th a:hover {
	text-decoration: underline;
}

table th i {
	font-size: 16px;
	margin-left: 4px;
}

/* Mobile optimization for sortable columns */
@media screen and (max-width: 420px) {
	table th a {
		font-size: 13px;
		gap: 4px;
	}

	table th i {
		font-size: 14px;
		margin-left: 2px;
		flex-shrink: 0;
	}
}

@media screen and (max-width: 400px) {
	table th a {
		font-size: 12px;
		gap: 3px;
	}

	table th i {
		font-size: 13px;
		margin-left: 1px;
	}
}

/* Fix for mobile view with sortable columns */
@media screen and (max-width: 480px) {
	td::before {
		width: 42%; /* Wider to fit longer Indonesian labels */
	}
}

/* Alert Styles */
.alert {
	padding: 15px;
	border-radius: 6px;
	margin-bottom: 20px;
	text-align: center;
	animation: slideIn 0.3s ease-out;
}

.alert.success {
	background-color: #e3f2e5;
	color: #2da544;
	border: 1px solid #2da544;
}

.alert.error {
	background-color: #fde8e8;
	color: #ef4444;
	border: 1px solid #ef4444;
}

/* Login Page Styles */
.login-page {
	background: linear-gradient(120deg, var(--timberwolf), var(--sage));
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-container {
	width: 100%;
	max-width: 500px;
	padding: 20px;
}

.login-form {
	background: white;
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
	transition:
		transform 0.3s,
		box-shadow 0.3s;
}

.login-form:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.login-form h2 {
	text-align: center;
	color: var(--brunswick-green);
	margin-bottom: 30px;
	font-size: 28px;
	font-weight: 600;
}

.input-group {
	position: relative;
	margin-bottom: 20px;
}

.input-group i {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--fern-green);
	font-size: 20px;
	transition: color 0.3s;
}

.input-group input,
.input-group select {
	width: 100%;
	padding: 15px 15px 15px 50px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 16px;
	color: var(--brunswick-green);
	transition:
		border-color 0.3s,
		box-shadow 0.3s;
}

.input-group input:focus,
.input-group select:focus {
	outline: none;
	border-color: var(--fern-green);
	box-shadow: 0 0 0 3px rgba(88, 129, 87, 0.2);
}

.input-group input:focus + i,
.input-group select:focus + i {
	color: var(--hunter-green);
}

.btn-login {
	width: 100%;
	padding: 16px;
	margin-top: 25px;
	background: linear-gradient(
		to right,
		var(--fern-green),
		var(--hunter-green)
	);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition:
		transform 0.3s,
		box-shadow 0.3s;
	box-shadow: 0 4px 15px rgba(58, 90, 64, 0.2);
}

.btn-login:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(58, 90, 64, 0.3);
}

.btn-login:active {
	transform: translateY(0);
}

/* Alert Styles - Improved */
.alert {
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 25px;
	position: relative;
	display: flex;
	align-items: center;
	font-size: 16px;
}

.alert::before {
	font-family: "boxicons";
	margin-right: 12px;
	font-size: 24px;
}

.alert.error {
	background: #fee2e2;
	color: #b91c1c;
	border-left: 4px solid #ef4444;
}

.alert.error::before {
	content: "\ed12"; /* bx-error-circle */
}

/* Register Form Styles - Enhanced */
.register-form {
	max-width: 550px;
}

.alert.success {
	background: #dcfce7;
	color: #166534;
	border-left: 4px solid #22c55e;
}

.alert.success::before {
	content: "\e901"; /* bx-check-circle */
}

.alert a {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
	margin-left: 5px;
}

.alert a:hover {
	text-decoration: none;
}

.text-center {
	text-align: center;
	margin-top: 25px;
	color: #666;
}

.text-center a {
	color: var(--hunter-green);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.3s;
}

.text-center a:hover {
	color: var(--fern-green);
	text-decoration: underline;
}

.btn-back {
	display: block;
	text-align: center;
	margin-top: 20px;
	color: var(--brunswick-green);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s;
}

.btn-back:hover {
	color: var(--fern-green);
	text-decoration: underline;
}

/* Responsive adjustments for login/register */
@media screen and (max-width: 576px) {
	.login-container {
		padding: 15px;
	}

	.login-form {
		padding: 25px 20px;
	}

	.login-form h2 {
		font-size: 24px;
		margin-bottom: 20px;
	}

	.input-group input,
	.input-group select {
		padding: 12px 12px 12px 45px;
		font-size: 15px;
	}

	.btn-login {
		padding: 14px;
		font-size: 16px;
	}
}

@media screen and (max-width: 420px) and (max-height: 700px) {
	.login-page {
		padding: 16px 0;
	}

	.login-container {
		padding: 12px;
	}

	.login-form {
		padding: 20px 16px;
		border-radius: 10px;
	}

	.login-form:hover {
		transform: none;
		box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
	}

	.login-form h2 {
		font-size: 22px;
		margin-bottom: 16px;
	}

	.input-group {
		margin-bottom: 16px;
	}

	.input-group input,
	.input-group select {
		padding: 11px 11px 11px 44px;
		font-size: 14px;
	}

	.btn-login {
		padding: 12px;
		font-size: 15px;
		margin-top: 18px;
	}

	.text-center {
		margin-top: 18px;
		font-size: 14px;
	}

	.alert {
		padding: 12px;
		font-size: 14px;
		margin-bottom: 16px;
	}
}

/* Optimized for 396×667 viewport - login page */
@media screen and (max-width: 400px) and (max-height: 700px) {
	.login-page {
		padding: 12px 0;
	}

	.login-container {
		padding: 10px;
	}

	.login-form {
		padding: 18px 14px;
	}

	.login-form h2 {
		font-size: 20px;
		margin-bottom: 14px;
	}

	.input-group {
		margin-bottom: 14px;
	}

	.input-group input,
	.input-group select {
		padding: 10px 10px 10px 42px;
		font-size: 14px;
	}

	.input-group i {
		font-size: 18px;
		left: 12px;
	}

	.btn-login {
		padding: 11px;
		font-size: 14px;
		margin-top: 16px;
	}

	.text-center {
		margin-top: 16px;
		font-size: 13px;
	}

	.alert {
		padding: 10px;
		font-size: 13px;
		margin-bottom: 14px;
	}
}

/* Additional mobile optimization for alerts */
@media screen and (max-width: 420px) {
	.alert {
		padding: 10px 12px;
		font-size: 13px;
		margin-bottom: 14px;
		border-radius: 8px;
	}

	.alert::before {
		font-size: 20px;
		margin-right: 10px;
	}
}

@media screen and (max-width: 400px) {
	.alert {
		padding: 9px 10px;
		font-size: 12px;
		margin-bottom: 12px;
	}

	.alert::before {
		font-size: 18px;
		margin-right: 8px;
	}
}

/* Table Filter Styles */
.table-filters {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-bottom: 20px;
}

/* Mobile optimization for table filters */
@media screen and (max-width: 420px) {
	.table-filters {
		flex-direction: column;
		gap: 12px;
		margin-bottom: 18px;
		align-items: stretch;
	}
}

@media screen and (max-width: 400px) {
	.table-filters {
		gap: 11px;
		margin-bottom: 16px;
	}
}

.search-box {
	display: flex;
	align-items: center;
	background: #f5f5f5;
	padding: 8px 12px;
	border-radius: 6px;
	flex: 1;
	position: relative;
}

.search-box i {
	color: var(--brunswick-green);
	margin-right: 8px;
}

.search-box input {
	border: none;
	background: none;
	outline: none;
	width: 100%;
	padding-right: 28px;
}

.search-clear-btn {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	border: none;
	background: transparent;
	color: var(--hunter-green);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0.7;
}

.search-clear-btn.show {
	display: flex;
}

.search-clear-btn:hover {
	opacity: 1;
}

/* Autocomplete Styles */
.autocomplete-items {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	display: none;
}

/* Custom scrollbar for autocomplete */
.autocomplete-items::-webkit-scrollbar {
	width: 6px;
}

.autocomplete-items::-webkit-scrollbar-track {
	background: #f3f4f6;
	border-radius: 0 6px 6px 0;
}

.autocomplete-items::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

.autocomplete-items::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

.autocomplete-items.show {
	display: block;
}

.autocomplete-item {
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f3f4f6;
	transition: background-color 0.15s ease;
	font-size: 14px;
	color: var(--brunswick-green);
}

.autocomplete-item:last-child {
	border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
	background-color: #f8f9fa;
}

.autocomplete-item strong {
	color: var(--hunter-green);
	font-weight: 600;
}

.autocomplete-no-results {
	padding: 12px 14px;
	text-align: center;
	color: #9ca3af;
	font-size: 13px;
	font-style: italic;
}

/* Autocomplete loading state */
.autocomplete-loading {
	padding: 12px 14px;
	text-align: center;
	color: var(--sage);
	font-size: 13px;
}

.autocomplete-loading::after {
	content: "...";
	animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
	0%,
	20% {
		content: ".";
	}
	40% {
		content: "..";
	}
	60%,
	100% {
		content: "...";
	}
}

/* Mobile optimization for search box */
@media screen and (max-width: 420px) {
	.search-box {
		padding: 12px 14px;
		border-radius: 10px;
		background: #f8f9fa;
		border: 1.5px solid #e9ecef;
		transition: all 0.2s ease;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	}

	.search-box:focus-within {
		background: white;
		border-color: var(--sage);
		box-shadow: 0 2px 6px rgba(88, 129, 87, 0.1);
	}

	.search-box input {
		font-size: 16px;
		color: var(--brunswick-green);
		padding-right: 30px;
	}

	.search-box input::placeholder {
		color: #9ca3af;
		opacity: 0.8;
	}

	.search-box i {
		font-size: 18px;
		color: var(--hunter-green);
		opacity: 0.7;
	}

	.search-clear-btn {
		right: 12px;
		font-size: 22px;
	}

	/* Autocomplete mobile optimization */
	.autocomplete-items {
		border-radius: 10px;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
		max-height: 280px;
	}

	.autocomplete-item {
		padding: 12px 14px;
		font-size: 15px;
		min-height: 44px;
		display: flex;
		align-items: center;
	}

	.autocomplete-item:active {
		background-color: #e8f5e9;
	}

	.autocomplete-no-results,
	.autocomplete-loading {
		padding: 14px;
		font-size: 14px;
	}
}

@media screen and (max-width: 400px) {
	.search-box {
		padding: 11px 12px;
		border-radius: 8px;
	}

	.search-box i {
		margin-right: 8px;
		font-size: 17px;
	}

	.search-box input {
		font-size: 15px;
		padding-right: 28px;
	}

	.search-clear-btn {
		right: 10px;
		font-size: 21px;
	}

	/* Autocomplete mobile optimization for smaller viewport */
	.autocomplete-items {
		border-radius: 8px;
		max-height: 260px;
	}

	.autocomplete-item {
		padding: 11px 12px;
		font-size: 14px;
		min-height: 42px;
	}

	.autocomplete-no-results,
	.autocomplete-loading {
		padding: 12px;
		font-size: 13px;
	}
}

.filter-group {
	display: flex;
	gap: 10px;
}

.filter-group select {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: white;
}

.btn-filter {
	padding: 8px 16px;
	background: var(--hunter-green);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
}

.btn-filter:hover {
	background: var(--brunswick-green);
}

.filter-result-count {
	font-size: 13px;
	color: var(--brunswick-green);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

.active-filter-chips {
	display: none;
	flex-wrap: wrap;
	gap: 8px;
}

.active-filter-chips.show {
	display: flex;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #f8faf8;
	color: var(--brunswick-green);
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.filter-chip:hover {
	background: #eef4ef;
	border-color: var(--sage);
}

.chip-remove {
	font-size: 16px;
	line-height: 1;
	opacity: 0.75;
}

/* Mobile optimization for filter group and button */
@media screen and (max-width: 420px) {
	.filter-group {
		gap: 8px;
		flex-wrap: wrap;
		width: 100%;
	}

	.filter-group select {
		padding: 12px;
		font-size: 16px;
		border-radius: 8px;
		flex: 1;
		min-width: calc(50% - 4px);
		background: white;
		border: 1.5px solid #ddd;
		color: var(--brunswick-green);
		font-weight: 500;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	}

	.btn-filter {
		padding: 13px 16px;
		font-size: 16px;
		border-radius: 8px;
		font-weight: 600;
		transition: all 0.2s;
		width: 100%;
		min-height: 48px;
		background: var(--hunter-green);
		color: white;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	}

	.btn-filter:active {
		transform: scale(0.98);
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	}

	.filter-result-count {
		font-size: 14px;
	}

	.active-filter-chips {
		gap: 6px;
	}

	.filter-chip {
		font-size: 13px;
		padding: 7px 10px;
	}
}

@media screen and (max-width: 400px) {
	.filter-group {
		gap: 8px;
		width: 100%;
	}

	.filter-group select {
		padding: 11px;
		font-size: 15px;
		border-radius: 6px;
	}

	.btn-filter {
		padding: 12px 14px;
		font-size: 15px;
		min-height: 46px;
		font-weight: 600;
	}

	.filter-result-count {
		font-size: 13px;
	}

	.filter-chip {
		font-size: 12px;
		padding: 6px 9px;
	}
}

.no-data {
	text-align: center;
	color: #666;
	padding: 20px;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	max-width: 520px;
	margin: 0 auto;
}

.empty-state-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--brunswick-green);
	margin: 0;
}

.empty-state-desc {
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
	margin: 0;
}

.empty-reset-btn {
	margin-top: 6px;
}

/* Mobile optimization for no data message */
@media screen and (max-width: 420px) {
	.no-data {
		padding: 24px 14px;
		font-size: 14px;
		color: #6b7280;
		font-weight: 500;
		line-height: 1.5;
	}

	.empty-state-title {
		font-size: 15px;
	}

	.empty-state-desc {
		font-size: 13px;
	}
}

@media screen and (max-width: 400px) {
	.no-data {
		padding: 22px 12px;
		font-size: 13px;
	}
}

/* Nav Separator Styles */
.nav-separator {
	padding: 10px 12px;
	margin: 10px 0;
	border-top: 1px solid rgba(163, 177, 138, 0.2);
	border-bottom: 1px solid rgba(163, 177, 138, 0.2);
}

.separator-text {
	color: var(--sage);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.8;
}

/* User Management Styles */
.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.btn-add {
	padding: 8px 16px;
	background: var(--hunter-green);
	color: white;
	border-radius: 6px;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	transition: all 0.2s;
}

.btn-add:hover {
	background: var(--brunswick-green);
}

/* Mobile optimization for header-actions and btn-add */
@media screen and (max-width: 420px) {
	.header-actions {
		margin-bottom: 12px;
	}

	.btn-add {
		padding: 12px 20px;
		font-size: 16px;
		border-radius: 8px;
		width: 100%;
		justify-content: center;
		min-height: 44px;
		font-weight: 500;
	}

	.btn-add i {
		font-size: 20px;
	}

	.btn-add:active {
		transform: scale(0.98);
	}
}

@media screen and (max-width: 400px) {
	.header-actions {
		margin-bottom: 10px;
	}

	.btn-add {
		padding: 11px 18px;
		font-size: 15px;
		min-height: 42px;
	}

	.btn-add i {
		font-size: 18px;
	}
}

.role {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
}

.role.admin {
	background: #e3f2e5;
	color: #2da544;
}

.role.staff {
	background: #e5f6ff;
	color: #0284c7;
}

.btn-toggle {
	padding: 6px 12px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
}

.btn-toggle.active {
	background: #fde8e8;
	color: #ef4444;
}

.btn-toggle.inactive {
	background: #e3f2e5;
	color: #2da544;
}

.action-form {
	display: inline-block;
}

/* Quantity Control Styles */
.quantity-control {
	display: inline-flex;
	align-items: center;
	gap: 0;
	background: #fff;
	border-radius: 6px;
	border: 1px solid #ddd;
}

/* Mobile optimization for bordered quantity control */
@media screen and (max-width: 420px) {
	.quantity-control {
		border-radius: 8px;
		border: 1px solid #e5e7eb;
		max-width: 200px;
		margin: 0 auto;
	}
}

@media screen and (max-width: 400px) {
	.quantity-control {
		border-radius: 6px;
		max-width: 190px;
	}
}

.quantity-control input[type="number"] {
	width: 60px;
	text-align: center;
	border: none;
	padding: 8px 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

.quantity-control input[type="number"]::-webkit-inner-spin-button,
.quantity-control input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Mobile optimization for quantity input */
@media screen and (max-width: 420px) {
	.quantity-control input[type="number"] {
		width: 70px;
		font-size: 16px;
		padding: 10px 4px;
		font-weight: 500;
	}
}

@media screen and (max-width: 400px) {
	.quantity-control input[type="number"] {
		width: 65px;
		padding: 9px 3px;
	}
}

.btn-qty {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #f5f5f5;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-qty:hover {
	background: var(--hunter-green);
	color: white;
}

/* Mobile optimization for btn-qty in quantity-control */
@media screen and (max-width: 420px) {
	.quantity-control .btn-qty {
		width: 42px;
		height: 42px;
		border-radius: 8px;
	}

	.quantity-control .btn-qty i {
		font-size: 18px;
	}
}

@media screen and (max-width: 400px) {
	.quantity-control .btn-qty {
		width: 40px;
		height: 40px;
		border-radius: 6px;
	}

	.quantity-control .btn-qty i {
		font-size: 16px;
	}
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.table-filters {
		flex-direction: column;
	}

	.filter-group {
		width: 100%;
		flex-wrap: wrap;
	}

	.filter-group select,
	.btn-filter {
		flex: 1;
		min-width: 150px;
	}

	.table-header {
		flex-direction: column;
		gap: 10px;
	}

	.table-filter {
		width: 100%;
	}

	.table-filter select {
		flex: 1;
	}

	.btn-add {
		width: 100%;
		justify-content: center;
	}
}

/* Mobile Responsive Styles */
@media screen and (max-width: 480px) {
	/* Filter adjustments */
	.table-filters {
		flex-direction: column;
		gap: 10px;
		margin: 0 10px 15px 10px;
	}

	.search-box {
		width: 100%;
	}

	.filter-group {
		width: 100%;
		flex-wrap: wrap;
		gap: 8px;
	}

	.filter-group select {
		flex: 1;
		min-width: 140px;
	}

	.btn-filter {
		width: 100%;
	}

	/* Table container */
	.table-container {
		margin: 10px;
		padding: 15px;
		overflow-x: hidden;
	}

	/* Table responsive */
	table,
	thead,
	tbody,
	th,
	td,
	tr {
		display: block;
	}

	/* Ensure expandable detail rows can truly close on mobile */
	tr[hidden],
	.item-details-row[hidden] {
		display: none !important;
	}

	thead tr {
		display: none;
	}

	tr {
		margin-bottom: 15px;
		border: 1px solid #ddd;
		border-radius: 8px;
		background: white;
		box-shadow: var(--box-shadow);
	}

	td {
		border: none;
		border-bottom: 1px solid #eee;
		position: relative;
		padding-left: 50% !important;
		text-align: right;
		min-height: 40px;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	td:last-child {
		border-bottom: none;
	}

	td::before {
		content: attr(data-label);
		position: absolute;
		left: 10px;
		width: 45%;
		padding-right: 10px;
		white-space: nowrap;
		text-align: left;
		font-weight: 500;
		color: var(--brunswick-green);
	}

	/* Status badge adjustments */
	.status {
		margin-left: auto;
	}

	/* No data message */
	.no-data {
		text-align: center;
		padding: 20px 10px;
	}

	/* Main title adjustment */
	.main-title {
		padding: 0 15px;
		margin-bottom: 15px;
	}

	.main-title h2 {
		font-size: 22px;
	}

	/* Remove hover effects */
	tbody tr:hover {
		transform: none;
		box-shadow: var(--box-shadow);
	}
}

/* Specific optimization for viewport ~400px (396×667) */
@media screen and (max-width: 420px) {
	/* Table mobile overrides from 480px baseline */
	tr {
		margin-bottom: 14px;
		border: 1.5px solid #e5e7eb;
		border-radius: 10px;
		background: white;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
		overflow: hidden;
		transition: box-shadow 0.2s ease;
	}

	tr:active {
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	}

	td {
		border-bottom: 1px solid #f5f5f5;
		padding: 13px 14px 13px 50% !important;
		min-height: 44px;
		font-size: 14px;
		line-height: 1.4;
		background: white;
	}

	td:first-child {
		border-top-left-radius: 10px;
		border-top-right-radius: 10px;
		padding-top: 15px !important;
		background: linear-gradient(to bottom, #fafafa 0%, white 100%);
	}

	/* Make first item (Nama Barang) more prominent */
	td[data-label="Nama Barang"] {
		font-size: 15px;
		font-weight: 600;
		color: var(--brunswick-green);
		border-bottom: 2px solid #e5e7eb;
	}

	td[data-label="Nama Barang"]::before {
		font-size: 13px;
	}

	td:last-child {
		border-bottom-left-radius: 10px;
		border-bottom-right-radius: 10px;
		padding-bottom: 15px !important;
	}

	td::before {
		left: 14px;
		width: 46%;
		padding-right: 10px;
		font-weight: 600;
		font-size: 12.5px;
		color: var(--hunter-green);
		overflow: hidden;
		text-overflow: ellipsis;
		opacity: 0.9;
	}

	/* Status badge mobile */
	.status {
		margin-left: auto;
		padding: 5px 12px;
		font-size: 12.5px;
		border-radius: 14px;
		font-weight: 600;
		letter-spacing: 0.02em;
	}

	/* Last login mobile */
	.last-login {
		font-size: 12px;
		line-height: 1.4;
	}

	.last-login .timestamp,
	.last-login .never-login {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		padding: 4px 8px;
		background: #f8f9fa;
		border-radius: 6px;
	}

	.last-login i {
		font-size: 14px;
		flex-shrink: 0;
	}

	/* No hover effects on mobile */
	tbody tr:hover {
		transform: none;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	}

	/* Adjust table container spacing */
	.table-container {
		margin: 0;
		overflow-x: hidden;
	}

	/* Optimize quantity control in mobile table view */
	td[data-label="Stok Lapangan"] .quantity-control,
	td[data-label="Stok Gudang"] .quantity-control {
		width: 100%;
		max-width: 200px;
		margin-left: auto;
	}

	/* Optimize level input in mobile table view */
	td[data-label="Level (cm)"] {
		justify-content: flex-end;
	}

	/* Optimize total stock display */
	td[data-label="Stok Total"] {
		font-weight: 600;
		color: var(--hunter-green);
	}

	/* Optimize action button cell */
	td[data-label="Aksi"] {
		padding: 14px 12px 14px 58% !important;
		justify-content: flex-end;
	}

	/* Ensure action buttons are centered and properly sized */
	td[data-label="Aksi"] .actions-inline {
		margin-left: auto;
		width: auto;
		min-width: 98px;
		justify-content: flex-end;
	}

	/* Optimize data cells with numeric values */
	td[data-label="Stok Lapangan"],
	td[data-label="Stok Gudang"],
	td[data-label="Pemakaian Harian"] {
		font-variant-numeric: tabular-nums;
		font-weight: 600;
		color: var(--brunswick-green);
	}

	/* Optimize field stock display */
	td[data-label="Stok"] {
		font-weight: 600;
		font-size: 15px;
		color: var(--hunter-green);
	}

	/* Optimize coverage display */
	td[data-label="Ketahanan di lapangan"] {
		font-weight: 600;
		color: var(--fern-green);
	}

	/* td with longer labels */
	td[data-label="Ketahanan di lapangan"]::before,
	td[data-label="Terakhir Diperbarui"]::before,
	td[data-label="Pemakaian Harian"]::before {
		font-size: 11.5px;
		line-height: 1.3;
	}
}

/* Additional optimizations for 396×667 viewport */
@media screen and (max-width: 400px) {
	/* Table mobile view adjustments */
	tr {
		margin-bottom: 12px;
		border-radius: 8px;
		border-width: 1.5px;
	}

	td {
		padding: 12px 12px 12px 48% !important;
		min-height: 42px;
		font-size: 13.5px;
	}

	td:first-child {
		border-top-left-radius: 8px;
		border-top-right-radius: 8px;
		padding-top: 14px !important;
	}

	/* Make first item (Nama Barang) more prominent */
	td[data-label="Nama Barang"] {
		font-size: 14.5px;
		font-weight: 600;
		color: var(--brunswick-green);
		border-bottom: 1.5px solid #e5e7eb;
	}

	td[data-label="Nama Barang"]::before {
		font-size: 12px;
	}

	td:last-child {
		border-bottom-left-radius: 8px;
		border-bottom-right-radius: 8px;
		padding-bottom: 14px !important;
	}

	td::before {
		left: 12px;
		width: 44%;
		padding-right: 8px;
		font-size: 11.5px;
	}

	/* Status badge for smaller viewport */
	.status {
		padding: 4px 10px;
		font-size: 12px;
		border-radius: 12px;
		font-weight: 600;
	}

	/* Last login smaller */
	.last-login {
		font-size: 11.5px;
	}

	.last-login .timestamp,
	.last-login .never-login {
		gap: 4px;
		padding: 3px 6px;
	}

	.last-login i {
		font-size: 13px;
	}

	/* Optimize quantity control for smaller viewport */
	td[data-label="Stok Lapangan"] .quantity-control,
	td[data-label="Stok Gudang"] .quantity-control {
		max-width: 190px;
	}

	/* Optimize action button cell for smaller viewport */
	td[data-label="Aksi"] {
		padding: 12px 10px 12px 60% !important;
		justify-content: flex-end;
	}

	td[data-label="Aksi"] .actions-inline {
		margin-left: auto;
		width: auto;
		min-width: 90px;
		justify-content: flex-end;
	}

	/* td with longer labels - smaller font */
	td[data-label="Ketahanan di lapangan"]::before,
	td[data-label="Terakhir Diperbarui"]::before,
	td[data-label="Pemakaian Harian"]::before {
		font-size: 10.5px;
		line-height: 1.3;
	}

	/* Optimize field stock for smaller viewport */
	td[data-label="Stok"] {
		font-size: 14px;
	}

	/* Role badge smaller */
	.role {
		padding: 3px 6px;
		font-size: 11px;
		border-radius: 3px;
	}

	/* Toggle button smaller */
	.btn-toggle {
		padding: 5px 10px;
		font-size: 11px;
		gap: 3px;
	}
}

/* Desktop: show overlay and push content */
@media (min-width: 992px) {
	body {
		padding-left: 0;
	}
	body.sidebar-open {
		padding-left: 260px;
	}
	nav .overlay {
		display: block;
	}
	body.sidebar-open nav .overlay {
		opacity: 1;
		pointer-events: auto;
	}
}

/* Mobile: show sidebar full-screen in front and hide overlay */
@media (max-width: 991px) {
	nav .sidebar {
		width: 100vw;
		left: -100vw;
		transform: translateX(0);
		z-index: 2000; /* ensure it's on top */
		box-shadow: none;
	}
	nav.open .sidebar,
	body.sidebar-open nav .sidebar {
		left: 0;
	}
	/* Hide overlay entirely on mobile */
	nav .overlay {
		display: none !important;
	}
}

/* Modal styles for custom pop-up */
.custom-modal-overlay {
	position: fixed;
	z-index: 9999;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
}
.custom-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: var(--box-shadow);
	padding: 2rem 1.5rem 1.2rem 1.5rem;
	max-width: 350px;
	width: 90vw;
	text-align: center;
	position: relative;
	animation: fadeInModal 0.2s;
}
@keyframes fadeInModal {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.custom-modal .modal-icon {
	font-size: 2.5rem;
	display: block;
	margin-bottom: 0.5rem;
}
.custom-modal .modal-title {
	font-weight: 600;
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
}
.custom-modal .modal-message {
	margin-bottom: 1.2rem;
	color: #333;
}
.custom-modal .modal-actions {
	display: flex;
	justify-content: center;
	gap: 0.7rem;
}
.custom-modal .modal-btn {
	padding: 0.5rem 1.2rem;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}
.custom-modal .modal-btn.ok {
	background: var(--fern-green);
	color: #fff;
}
.custom-modal .modal-btn.cancel {
	background: #eee;
	color: #444;
}
.custom-modal .modal-btn.ok:hover {
	background: var(--hunter-green);
}
.custom-modal .modal-btn.cancel:hover {
	background: #ccc;
}
.custom-modal .modal-close {
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	background: none;
	border: none;
	font-size: 1.3rem;
	color: #888;
	cursor: pointer;
	transition: color 0.2s;
}
.custom-modal .modal-close:hover {
	color: #222;
}

/* Icon color variations */
.custom-modal .modal-icon.success {
	color: var(--fern-green);
}
.custom-modal .modal-icon.error {
	color: #e74c3c;
}
.custom-modal .modal-icon.warning {
	color: #f39c12;
}

.modal-header-actions {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.btn-modal-add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	padding: 10px 14px;
	background-color: var(--fern-green);
	color: #fff;
	font-weight: 600;
}

.btn-modal-add:hover {
	background-color: var(--hunter-green);
}

.app-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.app-modal-overlay.show {
	display: flex;
}

.app-modal {
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	overflow-x: hidden;
	background: #fff;
	border-radius: 12px;
	box-shadow: var(--box-shadow);
}

.app-modal--item {
	max-width: 640px;
}

.app-modal--category {
	max-width: 520px;
}

.app-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #eee;
}

.app-modal-header h3 {
	margin: 0;
	font-size: 1.05rem;
}

.app-modal-close {
	border: none;
	background: transparent;
	color: #666;
	font-size: 1.2rem;
	cursor: pointer;
}

.app-modal-body {
	padding: 16px;
}

/* Mobile optimization for modal */
@media screen and (max-width: 420px) {
	.modal-header-actions {
		justify-content: stretch;
	}

	.btn-modal-add {
		width: 100%;
		justify-content: center;
		padding: 10px 12px;
		font-size: 0.95rem;
	}

	.app-modal-overlay {
		padding: 10px;
		align-items: flex-end;
	}

	.app-modal {
		max-width: 100%;
		max-height: 92vh;
		border-radius: 12px 12px 0 0;
	}

	.app-modal-header {
		padding: 12px 14px;
	}

	.app-modal-header h3 {
		font-size: 1rem;
	}

	.app-modal-close {
		font-size: 1.1rem;
		padding: 6px;
	}

	.app-modal-body {
		padding: 14px;
	}

	.custom-modal {
		max-width: 320px;
		width: 88vw;
		padding: 1.8rem 1.3rem 1rem 1.3rem;
		border-radius: 10px;
	}

	.custom-modal .modal-icon {
		font-size: 2.2rem;
		margin-bottom: 0.4rem;
	}

	.custom-modal .modal-title {
		font-size: 1.1rem;
		margin-bottom: 0.4rem;
	}

	.custom-modal .modal-message {
		margin-bottom: 1rem;
		font-size: 0.95rem;
	}

	.custom-modal .modal-actions {
		gap: 0.6rem;
		flex-wrap: wrap;
	}

	.custom-modal .modal-btn {
		padding: 0.6rem 1.1rem;
		font-size: 0.95rem;
		min-height: 44px;
		flex: 1;
		min-width: 120px;
	}

	.custom-modal .modal-btn:active {
		transform: scale(0.95);
	}

	.custom-modal .modal-close {
		top: 0.6rem;
		right: 0.6rem;
		font-size: 1.2rem;
		padding: 8px;
	}
}

@media screen and (max-width: 400px) {
	.btn-modal-add {
		padding: 9px 10px;
		font-size: 0.9rem;
	}

	.app-modal-overlay {
		padding: 8px;
	}

	.app-modal {
		max-height: 94vh;
		border-radius: 10px 10px 0 0;
	}

	.app-modal-header {
		padding: 10px 12px;
	}

	.app-modal-header h3 {
		font-size: 0.95rem;
	}

	.app-modal-close {
		font-size: 1rem;
		padding: 5px;
	}

	.app-modal-body {
		padding: 12px;
	}

	.custom-modal {
		max-width: 300px;
		width: 86vw;
		padding: 1.6rem 1.1rem 0.9rem 1.1rem;
		border-radius: 8px;
	}

	.custom-modal .modal-icon {
		font-size: 2rem;
	}

	.custom-modal .modal-title {
		font-size: 1rem;
	}

	.custom-modal .modal-message {
		font-size: 0.9rem;
		margin-bottom: 0.9rem;
	}

	.custom-modal .modal-actions {
		gap: 0.5rem;
	}

	.custom-modal .modal-btn {
		padding: 0.55rem 1rem;
		font-size: 0.9rem;
		min-width: 110px;
	}

	.custom-modal .modal-close {
		font-size: 1.1rem;
		padding: 6px;
	}
}

/* Row dirty state indicator (update-stock) */
.row-action-wrap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	justify-content: center;
}

.batch-save-sticky {
	position: sticky;
	bottom: 12px;
	margin-top: 16px;
	padding: 12px;
	border: 1px solid rgba(58, 90, 64, 0.16);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 6px 18px rgba(58, 90, 64, 0.12);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	z-index: 4;
}

.batch-save-summary {
	font-size: 14px;
	font-weight: 500;
	color: var(--brunswick-green);
}

.batch-save-btn {
	min-width: 240px;
}

.batch-save-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.batch-save-fab {
	display: none;
}

.item-name-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.row-dirty-indicator {
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #dc2626;
	border-radius: 999px;
	opacity: 0;
	pointer-events: none;
	flex-shrink: 0;
	transition: opacity 0.2s ease;
}

.row-dirty-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.table-container input[type="number"].input-inline-error {
	border-color: #dc2626;
	background: #fff5f5;
}

.table-container td {
	position: relative;
}

.cell-inline-error {
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.3;
	color: #b91c1c;
}

.embedded-audit-panel {
	margin-bottom: 14px;
	padding: 12px;
	border: 1px solid rgba(58, 90, 64, 0.18);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 4px 12px rgba(58, 90, 64, 0.08);
}

.embedded-audit-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.embedded-audit-header h3 {
	margin: 0;
	font-size: 15px;
	color: var(--brunswick-green);
}

.embedded-audit-subtitle {
	font-size: 12px;
	color: #6b7280;
}

.embedded-audit-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	max-height: 260px;
	overflow-y: auto;
}

.embedded-audit-item {
	border: 1px solid rgba(58, 90, 64, 0.15);
	border-radius: 8px;
	padding: 8px 10px;
	background: #f9fbf8;
}

.embedded-audit-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.embedded-audit-top strong {
	font-size: 13px;
	color: var(--brunswick-green);
}

.embedded-audit-time {
	font-size: 12px;
	color: #6b7280;
	white-space: nowrap;
}

.embedded-audit-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: #4b5563;
	margin-bottom: 6px;
}

.embedded-audit-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.embedded-audit-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	color: var(--hunter-green);
	background: rgba(163, 177, 138, 0.25);
}

.embedded-audit-empty {
	padding: 8px 10px;
	font-size: 13px;
	color: #6b7280;
	border: 1px dashed rgba(58, 90, 64, 0.18);
	border-radius: 8px;
	background: #fbfdfb;
}

.cell-inline-error.server-validation {
	font-weight: 600;
}

.cell-inline-error.server-validation-row {
	margin-top: 6px;
}

tr.is-dirty {
	background-color: #fffbeb;
}

tr.is-dirty td[data-label="Nama Barang"] .row-dirty-indicator {
	opacity: 1;
	background: #d97706;
}

tr.is-saved {
	background-color: #ecfdf3;
}

tr.is-saved td[data-label="Nama Barang"] .row-dirty-indicator {
	opacity: 1;
	background: #16a34a;
}

tr.is-failed {
	background-color: #fef2f2;
}

tr.is-failed td[data-label="Nama Barang"] .row-dirty-indicator {
	opacity: 1;
	background: #dc2626;
}

tr.is-autosaving {
	background-color: #eff6ff;
}

tr.is-autosaving td[data-label="Nama Barang"] .row-dirty-indicator {
	opacity: 1;
	background: #2563eb;
}

tr.is-locked {
	opacity: 0.72;
}

tr.is-locked td {
	cursor: wait;
}

body.update-stock-ui-locked nav .nav-link,
body.update-stock-ui-locked nav .menu-icon {
	pointer-events: none;
	opacity: 0.6;
}

@media screen and (max-width: 420px) {
	.row-action-wrap {
		width: auto;
		flex-direction: row;
		align-items: center;
	}

	.batch-save-sticky {
		display: none;
	}

	.batch-save-fab {
		position: fixed;
		right: 14px;
		bottom: 18px;
		width: 56px;
		height: 56px;
		border-radius: 999px;
		border: none;
		background: linear-gradient(
			90deg,
			var(--fern-green),
			var(--hunter-green)
		);
		color: #fff;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 8px 20px rgba(58, 90, 64, 0.28);
		z-index: 7;
		cursor: pointer;
	}

	.batch-save-fab i {
		font-size: 24px;
	}

	.batch-save-fab-count {
		position: absolute;
		top: -4px;
		right: -4px;
		min-width: 20px;
		height: 20px;
		padding: 0 5px;
		border-radius: 999px;
		background: #dc2626;
		color: #fff;
		font-size: 11px;
		font-weight: 600;
		line-height: 20px;
		text-align: center;
		border: 2px solid #fff;
	}

	.batch-save-fab:disabled {
		opacity: 0.65;
		cursor: not-allowed;
		box-shadow: none;
	}

	.row-dirty-indicator {
		width: 7px;
		height: 7px;
	}

	.cell-inline-error {
		font-size: 11px;
	}

	.embedded-audit-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.embedded-audit-list {
		max-height: 220px;
	}
}
