* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
	background-color: #f5f7fb;
	display: flex;
	min-height: 100vh;
	overflow-x: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
	width: 260px;
	background: linear-gradient(180deg, #1a2a3a 0%, #0f1a24 100%);
	color: white;
	position: fixed;
	height: 100vh;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 100;
	overflow-y: auto;
	box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}

.sidebar-header {
	padding: 24px 20px;
	font-size: 1.25rem;
	font-weight: 700;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	text-align: center;
	background: rgba(0,0,0,0.2);
	letter-spacing: 0.5px;
}

.sidebar-header small {
	display: block;
	font-size: 0.7rem;
	opacity: 0.7;
	margin-top: 4px;
}

.sidebar-menu {
	padding: 16px 8px;
}

.menu-item {
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	color: #b0c4de;
	text-decoration: none;
	border-radius: 12px;
	margin-bottom: 4px;
	transition: all 0.2s ease;
	cursor: pointer;
	font-weight: 500;
}

.menu-item:hover {
	background: rgba(255,255,255,0.1);
	color: white;
	transform: translateX(4px);
}

.menu-item.active {
	background: #2c7da0;
	color: white;
	box-shadow: 0 2px 8px rgba(44,125,160,0.3);
}

.menu-icon {
	font-size: 1.2rem;
	width: 24px;
	text-align: center;
}

/* ========== MAIN CONTENT ========== */
.main-content {
	flex: 1;
	margin-left: 260px;
	padding: 24px 32px;
	min-height: 100vh;
}

/* ========== PAGE TRANSITION ========== */
.page-content {
	display: none;
	animation: fadeInUp 0.25s ease-out;
}

.page-content.active {
	display: block;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========== TYPOGRAPHY ========== */
h2 {
	font-size: 1.75rem;
	font-weight: 700;
	color: #1e2a3a;
	margin-bottom: 24px;
	padding-bottom: 8px;
	border-bottom: 3px solid #2c7da0;
	display: inline-block;
}

/* ========== CARDS ========== */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 32px;
}

.stat-card {
	background: white;
	border-radius: 20px;
	padding: 20px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.05);
	transition: transform 0.2s, box-shadow 0.2s;
	border: 1px solid #e9ecef;
}

.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.stat-label {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #6c757d;
	font-weight: 600;
}

.stat-value {
	font-size: 1.75rem;
	font-weight: 800;
	color: #1e2a3a;
	margin-top: 8px;
}

.card {
	background: white;
	border-radius: 20px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.05);
	margin-bottom: 28px;
	overflow: hidden;
	border: 1px solid #eef2f6;
}

.card-header {
	background: #f8fafc;
	padding: 16px 24px;
	font-weight: 700;
	font-size: 1.1rem;
	border-bottom: 1px solid #e9ecef;
	color: #1e2a3a;
}

.card-body {
	padding: 24px;
}

/* ========== FORMS ========== */
.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	align-items: end;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	position: relative;
}

.form-group label {
	font-size: 0.75rem;
	font-weight: 600;
	color: #495057;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

input, select {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	font-size: 0.9rem;
	transition: all 0.2s;
	background: white;
}

input:focus, select:focus {
	outline: none;
	border-color: #2c7da0;
	box-shadow: 0 0 0 3px rgba(44,125,160,0.1);
}

button {
	cursor: pointer;
	border: none;
	border-radius: 12px;
	padding: 10px 20px;
	font-weight: 600;
	transition: all 0.2s;
	font-size: 0.9rem;
}

.btn-primary {
	background: #2c7da0;
	color: white;
}

.btn-primary:hover {
	background: #1f5e7a;
	transform: translateY(-1px);
}

.btn-danger {
	background: #dc2626;
	color: white;
}

.btn-danger:hover {
	background: #b91c1c;
}

.btn-success {
	background: #10b981;
	color: white;
}

.btn-success:hover {
	background: #059669;
}

.btn-outline {
	background: white;
	border: 1.5px solid #cbd5e1;
	color: #475569;
}

.btn-outline:hover {
	background: #f8fafc;
	border-color: #2c7da0;
}

/* ========== TABLES ========== */
.table-wrapper {
	overflow-x: auto;
	border-radius: 16px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

th {
	background: #f8fafc;
	padding: 14px 12px;
	text-align: left;
	font-weight: 600;
	color: #334155;
	border-bottom: 2px solid #e2e8f0;
	cursor: pointer;
	user-select: none;
}

th:hover {
	background: #f1f5f9;
}

td {
	padding: 12px;
	border-bottom: 1px solid #f0f2f5;
	color: #1e293b;
}

tr:hover {
	background: #fefce8;
}

.badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
}

.badge-success {
	background: #d1fae5;
	color: #065f46;
}

.badge-warning {
	background: #fed7aa;
	color: #9a3412;
}

.badge-info {
	background: #dbeafe;
	color: #1e40af;
}

.badge-danger {
	background: #fee2e2;
	color: #991b1b;
}

.search-box {
	margin-bottom: 20px;
}

.search-box input {
	border: 2px solid #e2e8f0;
	padding: 12px 16px;
	font-size: 0.9rem;
}

/* ========== TOAST NOTIFICATION ========== */
#toast {
	visibility: hidden;
	min-width: 280px;
	background: #1e293b;
	color: white;
	text-align: center;
	border-radius: 16px;
	padding: 14px 20px;
	position: fixed;
	z-index: 1000;
	left: 50%;
	bottom: 30px;
	transform: translateX(-50%);
	font-size: 0.85rem;
	font-weight: 500;
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: center;
}

#toast.show {
	visibility: visible;
	animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

.btn-undo {
	background: #f59e0b;
	color: #1e293b;
	border: none;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
}

.loading {
	text-align: center;
	padding: 40px;
	color: #6c757d;
}

/* Autocomplete Suggestions */
.suggestions-box {
	position: absolute;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	max-height: 250px;
	overflow-y: auto;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	display: none;
	width: 100%;
	top: 100%;
	left: 0;
}

.suggestions-box.active {
	display: block;
}

.suggestion-item {
	padding: 12px 16px;
	cursor: pointer;
	border-bottom: 1px solid #f0f2f5;
	transition: background 0.2s;
}

.suggestion-item:hover {
	background: #f8fafc;
}

.suggestion-item strong {
	color: #1e293b;
	display: block;
}

.suggestion-item small {
	color: #6c757d;
	font-size: 0.75rem;
	display: block;
	margin-top: 4px;
}

#tabelStok tr {
	cursor: pointer;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 1024px) {
	.stats-grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
		gap: 16px;
	}
	.stat-value {
		font-size: 1.5rem;
	}
	.form-grid {
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
		gap: 12px;
	}
}

@media (max-width: 768px) {
	.sidebar {
		width: 70px;
	}
	.sidebar-header {
		padding: 16px 0;
	}
	.sidebar-header span, .menu-text {
		display: none;
	}
	.menu-item {
		justify-content: center;
		padding: 14px;
		margin: 4px 8px;
	}
	.menu-icon {
		font-size: 1.5rem;
		width: auto;
	}
	.main-content {
		margin-left: 70px;
		padding: 16px;
		width: calc(100% - 70px);
	}
	h2 {
		font-size: 1.3rem;
		margin-bottom: 16px;
		display: block;
		width: 100%;
	}
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
		margin-bottom: 20px;
	}
	.stat-card {
		padding: 14px;
	}
	.stat-label {
		font-size: 0.7rem;
	}
	.stat-value {
		font-size: 1.2rem;
		margin-top: 4px;
		word-break: break-word;
	}
	.card {
		margin-bottom: 16px;
		border-radius: 16px;
	}
	.card-header {
		padding: 12px 16px;
		font-size: 0.95rem;
	}
	.card-body {
		padding: 16px;
	}
	.form-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.form-group {
		grid-column: auto !important;
	}
	input, select, button {
		padding: 12px 14px;
		font-size: 16px;
	}
	button {
		width: 100%;
	}
	div[style*="display: flex"] {
		flex-direction: column;
		gap: 8px !important;
	}
	div[style*="display: flex"] button {
		width: 100%;
	}
	.table-wrapper {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	table {
		min-width: 600px;
		font-size: 0.8rem;
	}
	th, td {
		padding: 10px 8px;
		white-space: nowrap;
	}
	.search-box input {
		padding: 10px 14px;
		font-size: 14px;
	}
	#toast {
		min-width: 260px;
		padding: 12px 16px;
		bottom: 20px;
		font-size: 0.8rem;
		white-space: normal;
		word-break: break-word;
	}
	.badge {
		padding: 3px 8px;
		font-size: 0.7rem;
	}
	.suggestions-box {
		max-height: 200px;
		position: fixed;
		left: 70px !important;
		right: 16px !important;
		width: auto !important;
		z-index: 2000;
	}
	.suggestion-item {
		padding: 10px 12px;
	}
}

@media (max-width: 480px) {
	.sidebar {
		width: 60px;
	}
	.main-content {
		margin-left: 60px;
		padding: 12px;
		width: calc(100% - 60px);
	}
	.sidebar-header {
		padding: 12px 0;
		font-size: 1rem;
	}
	.menu-item {
		padding: 10px;
		margin: 2px 6px;
	}
	.menu-icon {
		font-size: 1.3rem;
	}
	h2 {
		font-size: 1.1rem;
		margin-bottom: 12px;
	}
	.stats-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.stat-card {
		padding: 12px;
	}
	.stat-value {
		font-size: 1.1rem;
	}
	.card-header {
		padding: 10px 12px;
		font-size: 0.85rem;
	}
	.card-body {
		padding: 12px;
	}
	input, select, button {
		padding: 10px 12px;
		font-size: 14px;
	}
	th, td {
		padding: 8px 6px;
		font-size: 0.75rem;
	}
	.btn-outline, .btn-primary, .btn-success, .btn-danger {
		padding: 8px 12px;
		font-size: 0.85rem;
	}
	#tbodyKeranjang td {
		white-space: normal;
		word-break: break-word;
	}
}

@media (max-width: 768px) and (orientation: landscape) {
	.stats-grid {
		grid-template-columns: repeat(4, 1fr);
	}
	.form-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.sidebar {
		width: 60px;
	}
	.main-content {
		margin-left: 60px;
	}
}

@media (hover: none) and (pointer: coarse) {
	button, .menu-item, .suggestion-item, th, tr[ondblclick] {
		min-height: 44px;
	}
	th {
		min-height: 44px;
	}
	.stat-card:hover, .card:hover, tr:hover {
		transform: none;
	}
	.table-wrapper {
		-webkit-overflow-scrolling: touch;
	}
}

@media (prefers-color-scheme: dark) {
	body {
		background-color: #0f172a;
	}
	.card, .stat-card {
		background: #1e293b;
		border-color: #334155;
	}
	.card-header {
		background: #0f172a;
		color: #e2e8f0;
		border-bottom-color: #334155;
	}
	.stat-label {
		color: #94a3b8;
	}
	.stat-value {
		color: #f1f5f9;
	}
	input, select {
		background: #0f172a;
		border-color: #334155;
		color: #f1f5f9;
	}
	th {
		background: #0f172a;
		color: #94a3b8;
		border-bottom-color: #334155;
	}
	td {
		color: #cbd5e1;
		border-bottom-color: #1e293b;
	}
	tr:hover {
		background: #334155;
	}
	.btn-outline {
		background: transparent;
		border-color: #475569;
		color: #94a3b8;
	}
}