/*
 * CSS bổ trợ cho Bootstrap 4 (nhúng qua CDN trong layouts/admin.php và
 * layouts/admin-guest.php) — chỉ chứa phần Bootstrap không có sẵn: sidebar
 * cố định + trượt trên mobile, và vài chi tiết riêng của giao diện admin.
 */

:root {
	--color-primary: #0068ff;
	--color-sidebar-bg: #101828;
	--font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, Helvetica, Arial, sans-serif;
}

body {
	background-color: #f4f6fb;
	font-family: var(--font-sans);
}

/* Sidebar */

.admin-layout {
	min-height: 100vh;
}

.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 250px;
	z-index: 1040;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	background-color: var(--color-sidebar-bg) !important;
	transition: transform 0.25s ease;
}

.sidebar-brand {
	font-size: 1.05rem;
}

.sidebar-heading {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280 !important;
}

.sidebar .nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0.55rem 0.75rem;
	border-radius: 0.375rem;
	color: #cbd5e1;
	font-size: 0.9rem;
}

.sidebar .nav-link:hover {
	color: #fff;
	background-color: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-link.active {
	color: #fff;
	background-color: var(--color-primary);
}

.admin-main {
	margin-left: 250px;
	min-height: 100vh;
}

.admin-main .container-fluid {
	max-width: 1320px;
}

.admin-main a:hover,
.admin-main a:focus {
	text-decoration: none;
}

.topbar {
	background-color: var(--color-sidebar-bg);
}

.sidebar-overlay {
	display: none;
}

@media (max-width: 767.98px) {
	.sidebar {
		transform: translateX(-100%);
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
	}

	.sidebar.show {
		transform: translateX(0);
	}

	.admin-main {
		margin-left: 0;
	}

	.sidebar-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 1030;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}

	.sidebar-overlay.show {
		opacity: 1;
		pointer-events: auto;
	}
}

/* Trang Tổng quan */

.stat-card {
	text-decoration: none;
	color: inherit;
}

.stat-card:hover {
	color: inherit;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.stat-card--highlight {
	border-color: var(--color-primary) !important;
}

.stat-card__value {
	font-size: 1.75rem;
	font-weight: 700;
}

.stat-card__icon {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	font-size: 1.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Bảng danh sách */

.table thead th {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6b7280;
	background-color: #f9fafb;
	border-top: none;
}

.table td,
.table th {
	font-size: 0.9rem;
	vertical-align: middle;
}

.table-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 0.375rem;
}

/* Ô chọn ảnh upload (thumbnail, logo...) — xem partials/admin-file-upload.php */

.upload-dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 240px;
	height: 140px;
	overflow: hidden;
	background-color: #f9fafb;
	border: 2px dashed #cbd5e1;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone--wide {
	width: 100%;
	max-width: 480px;
	height: 180px;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
	background-color: rgba(0, 104, 255, 0.05);
	border-color: var(--color-primary);
}

.upload-dropzone__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	opacity: 0;
}

.upload-dropzone__preview {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.upload-dropzone__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 1rem;
	color: #6b7280;
	text-align: center;
}

.upload-dropzone.has-preview .upload-dropzone__empty {
	display: none;
}

.upload-dropzone__icon {
	margin-bottom: 0.375rem;
	font-size: 1.5rem;
	color: #9ca3af;
}

.upload-dropzone__text {
	font-size: 0.85rem;
	font-weight: 500;
}

.upload-dropzone__hint {
	font-size: 0.75rem;
}

.upload-dropzone__overlay {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 0.375rem 0;
	font-size: 0.8rem;
	color: #fff;
	text-align: center;
	background-color: rgba(16, 24, 40, 0.65);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.upload-dropzone.has-preview:hover .upload-dropzone__overlay {
	opacity: 1;
}

/* API key hiển thị 1 lần ngay sau khi tạo — xem admin/api_clients/index.php */

.api-key-box {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: var(--color-sidebar-bg);
	color: #86efac;
	padding: 0.625rem 0.875rem;
	border-radius: 0.5rem;
	margin: 0.5rem 0;
	word-break: break-all;
	font-size: 0.8125rem;
}

/* Màn đăng nhập */

.guest-body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #0068ff, #101828);
}

.guest-card {
	width: 100%;
	max-width: 380px;
	border: none;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
