:root {
	--primary-color: #6366f1;
	--primary-hover: #4f46e5;
	--secondary-color: #64748b;
	--success-color: #10b981;
	--danger-color: #ef4444;
	--warning-color: #f59e0b;
	--bg-color: #f8fafc;
	--card-bg: #ffffff;
	--text-primary: #1e293b;
	--text-secondary: #64748b;
	--border-color: #e2e8f0;
	--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
	background-color: var(--bg-color);
	color: var(--text-primary);
	line-height: 1.6;
}

/* Login */
.login-container {
	display: none;
	min-height: 100vh;
	align-items: center;
	justify-content: center;
	background-color: var(--bg-color);
}

.login-card {
	background: var(--card-bg);
	padding: 2rem;
	border-radius: 0.75rem;
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 420px;
}

.login-card h2 {
	margin-bottom: 1rem;
	color: var(--text-primary);
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form input { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 0.5rem; }
.login-form input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

.admin-container {
	display: flex;
	min-height: 100vh;
}

/* Sidebar */
.sidebar {
	width: 280px;
	background: var(--card-bg);
	border-right: 1px solid var(--border-color);
	box-shadow: var(--shadow);
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}

.sidebar-header {
	padding: 2rem 1.5rem;
	border-bottom: 1px solid var(--border-color);
}

.brand { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-direction: column; }
.logo { display: block; width: auto; height: auto; }
.brand-logo { display: block; max-width: 180px; height: auto; margin: 0 auto 0.75rem auto; }
.login-logo { max-width: 260px; }

#admin-name { display:block; text-align:center; margin-top: 0.25rem; }
.login-logo-wrap { display:flex; justify-content:center; margin-bottom: 0.75rem; }

.sidebar-header h1 {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary-color);
	margin-bottom: 0.25rem;
}

.sidebar-header p {
	color: var(--text-secondary);
	font-size: 0.875rem;
}

.sidebar-nav {
	padding: 1rem 0;
}

.nav-item {
	width: 100%;
	padding: 1rem 1.5rem;
	border: none;
	background: none;
	text-align: left;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--text-secondary);
	transition: all 0.2s;
	font-size: 0.9375rem;
}

.nav-item:hover {
	background-color: var(--bg-color);
	color: var(--primary-color);
}

.nav-item.active {
	background-color: rgba(99, 102, 241, 0.1);
	color: var(--primary-color);
	border-right: 3px solid var(--primary-color);
	font-weight: 600;
}

.nav-item .icon {
	font-size: 1.25rem;
}

/* Main Content */
.main-content {
	flex: 1;
	padding: 2rem;
	overflow-x: auto;
	position: relative;
	background-image: 
		linear-gradient(to bottom, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0.95)),
		url('/admin/logo.png');
	background-repeat: no-repeat;
	background-position: center center;
	background-size: 500px 500px;
	background-attachment: fixed;
	z-index: 1;
}
.main-content > * {
	position: relative;
	z-index: 1;
}

.content-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
}

.content-header h2 {
	font-size: 1.875rem;
	font-weight: 700;
	color: var(--text-primary);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-sm {
	padding: 0.625rem 1.25rem;
	border: none;
	border-radius: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.btn-primary {
	background-color: var(--primary-color);
	color: white;
}

.btn-primary:hover {
	background-color: var(--primary-hover);
	transform: translateY(-1px);
	box-shadow: var(--shadow-lg);
}

.btn-secondary {
	background-color: var(--secondary-color);
	color: white;
}

.btn-secondary:hover {
	background-color: #475569;
}

.btn-danger {
	background-color: var(--danger-color);
	color: white;
}

.btn-danger:hover {
	background-color: #dc2626;
}

.btn-sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.875rem;
}

.lang-select { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 0.5rem; background: var(--card-bg); }

/* Toolbar */
.toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	gap: 1rem;
}

.search-input {
	padding: 0.75rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 0.9375rem;
	width: 300px;
	transition: all 0.2s;
}

.search-input:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toolbar-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.page-size-label {
	color: var(--text-secondary);
	font-size: 0.875rem;
	white-space: nowrap;
}

.page-size-select {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 0.875rem;
	background: var(--card-bg);
	color: var(--text-primary);
	cursor: pointer;
	transition: all 0.2s;
}

.page-size-select:hover {
	border-color: var(--primary-color);
}

.page-size-select:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.pagination-info {
	color: var(--text-secondary);
	font-size: 0.875rem;
}

/* Table */
.table-container {
	background: var(--card-bg);
	border-radius: 0.75rem;
	box-shadow: var(--shadow);
	overflow: hidden;
	overflow-x: auto;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
}

.data-table thead {
	background-color: var(--bg-color);
}

.data-table th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 2px solid var(--border-color);
}

.data-table td {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
	font-size: 0.9375rem;
}

.data-table tbody tr:hover {
	background-color: var(--bg-color);
}

.data-table tbody tr.clickable-row {
	cursor: pointer;
}

.data-table tbody tr.clickable-row:hover {
	background-color: rgba(99, 102, 241, 0.05);
}

.data-table tbody tr:last-child td {
	border-bottom: none;
}

.loading {
	text-align: center;
	padding: 3rem;
	color: var(--text-secondary);
}

.empty-state {
	text-align: center;
	padding: 3rem;
	color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
	display: flex;
	gap: 0.5rem;
}

.action-btn {
	padding: 0.375rem 0.75rem;
	border: none;
	border-radius: 0.375rem;
	cursor: pointer;
	font-size: 0.875rem;
	transition: all 0.2s;
}

.action-btn.edit {
	background-color: rgba(245, 158, 11, 0.1);
	color: var(--warning-color);
}

.action-btn.edit:hover {
	background-color: rgba(245, 158, 11, 0.2);
}

.action-btn.delete {
	background-color: rgba(239, 68, 68, 0.1);
	color: var(--danger-color);
}

.action-btn.delete:hover {
	background-color: rgba(239, 68, 68, 0.2);
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
}

.pagination button {
	padding: 0.5rem 1rem;
	border: 1px solid var(--border-color);
	background: var(--card-bg);
	border-radius: 0.5rem;
	cursor: pointer;
	transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
	background-color: var(--bg-color);
	border-color: var(--primary-color);
	color: var(--primary-color);
}

.pagination button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pagination button.active {
	background-color: var(--primary-color);
	color: white;
	border-color: var(--primary-color);
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.modal.active {
	display: flex;
}

.modal-content {
	background: var(--card-bg);
	border-radius: 0.75rem;
	box-shadow: var(--shadow-lg);
	width: 90%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.modal-content.modal-large {
	max-width: 800px;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem;
	border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
	font-size: 1.5rem;
	font-weight: 600;
}

.modal-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: var(--text-secondary);
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.375rem;
	transition: all 0.2s;
}

.modal-close:hover {
	background-color: var(--bg-color);
	color: var(--text-primary);
}

.modal-body {
	padding: 1.5rem;
	flex: 1;
	overflow-y: auto;
}

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 1rem;
	padding: 1.5rem;
	border-top: 1px solid var(--border-color);
}

/* Form */
.form-group {
	margin-bottom: 1.5rem;
}

.form-group label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--text-primary);
	font-size: 0.9375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 0.9375rem;
	transition: all 0.2s;
	font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
	resize: vertical;
	min-height: 100px;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

/* Detail View */
.detail-content {
	padding: 0.5rem 0;
}

.detail-grid {
	display: grid;
	gap: 1.5rem;
}

.detail-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border-color);
}

.detail-field:last-child {
	border-bottom: none;
}

.detail-field label {
	font-weight: 600;
	color: var(--text-secondary);
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.detail-field .detail-value {
	color: var(--text-primary);
	font-size: 1rem;
	line-height: 1.6;
	word-break: break-word;
}

.detail-field .detail-value:empty::before {
	content: '-';
	color: var(--text-secondary);
}

.detail-file-img {
	border-radius: 0.5rem;
	box-shadow: var(--shadow);
}

.detail-file-link {
	color: var(--primary-color);
	text-decoration: none;
	font-weight: 500;
}

.detail-file-link:hover {
	text-decoration: underline;
}

/* Toast */
.toast-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	padding: 1rem 1.5rem;
	border-radius: 0.5rem;
	box-shadow: var(--shadow-lg);
	animation: slideIn 0.3s ease-out;
	min-width: 300px;
}

.toast.success {
	background-color: var(--success-color);
	color: white;
}

.toast.error {
	background-color: var(--danger-color);
	color: white;
}

.toast.info {
	background-color: var(--primary-color);
	color: white;
}

@keyframes slideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* File Upload */
.file-upload-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.custom-file-input-wrapper {
	position: relative;
}

.file-input-hidden {
	position: absolute;
	width: 0.1px;
	height: 0.1px;
	opacity: 0;
	overflow: hidden;
	z-index: -1;
}

.custom-file-label {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	background: var(--card-bg);
	cursor: pointer;
	transition: all 0.2s;
	font-size: 0.9375rem;
	width: 100%;
}

.custom-file-label:hover {
	border-color: var(--primary-color);
	background: var(--bg-color);
}

.file-label-text {
	color: var(--primary-color);
	font-weight: 500;
}

.file-name-text {
	color: var(--text-secondary);
	font-size: 0.875rem;
	margin-left: 1rem;
	flex-shrink: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-upload-btn {
	margin-top: 0;
	width: auto;
	align-self: flex-start;
}

.file-preview {
	margin-top: 0.5rem;
	min-height: 100px;
	border: 1px dashed var(--border-color);
	border-radius: 0.5rem;
	padding: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-color);
}

.file-preview-img {
	max-width: 100%;
	max-height: 200px;
	border-radius: 0.5rem;
	object-fit: contain;
}

.file-preview-link a {
	color: var(--primary-color);
	text-decoration: none;
}

.file-preview-link a:hover {
	text-decoration: underline;
}

.upload-status {
	color: var(--text-secondary);
	font-size: 0.875rem;
}

.upload-status.error {
	color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
	.sidebar {
		width: 100%;
		position: fixed;
		height: auto;
		top: 0;
		z-index: 100;
	}

	.main-content {
		margin-top: 200px;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.search-input {
		width: 100%;
	}
}

