/* ===== Admin Panel - Berteau Eric ===== */
:root {
	--primary: #2d6a6a;
	--primary-dark: #1e4d4d;
	--accent: #d4813b;
	--bg: #f4f5f7;
	--white: #fff;
	--dark: #1a2332;
	--text: #444;
	--text-light: #888;
	--border: #e2e4e8;
	--radius: 10px;
	--shadow: 0 2px 12px rgba(0,0,0,0.06);
	--transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 15px;
	line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* Login page */
.login-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
}

.login-card {
	background: var(--white);
	border-radius: var(--radius);
	padding: 48px 40px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
	text-align: center;
	margin-bottom: 32px;
}

.login-header i {
	font-size: 2.5rem;
	color: var(--primary);
	margin-bottom: 16px;
	display: block;
}

.login-header h1 {
	font-size: 1.6rem;
	color: var(--dark);
	margin-bottom: 8px;
}

.login-header p {
	color: var(--text-light);
	font-size: 0.9rem;
}

.login-back {
	display: block;
	text-align: center;
	margin-top: 24px;
	color: var(--text-light);
	font-size: 0.85rem;
}

.login-back:hover { color: var(--primary); }

/* Form elements */
.form-group {
	margin-bottom: 20px;
	flex: 1;
}

.form-group label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
	font-size: 0.9rem;
	color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95rem;
	transition: border-color var(--transition);
	background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
	outline: none;
	border-color: var(--primary);
}

.form-group textarea { resize: vertical; }

.form-row {
	display: flex;
	gap: 20px;
}

.form-actions {
	display: flex;
	gap: 12px;
	margin-top: 8px;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 8px;
	font-family: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	border: 1.5px solid transparent;
	transition: all var(--transition);
}

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

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

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

.btn-secondary:hover { border-color: var(--text-light); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm, .btn-sm-inline {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	cursor: pointer;
	border: 1.5px solid var(--border);
	background: var(--white);
	color: var(--text);
	transition: all var(--transition);
	text-decoration: none;
}

.btn-sm:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm-danger {
	color: #dc3545;
	border-color: #fce4e6;
	background: #fef7f7;
}

.btn-sm-danger:hover { background: #dc3545; color: var(--white); border-color: #dc3545; }

.btn-icon-danger {
	background: rgba(220,53,69,0.1);
	color: #dc3545;
	border: none;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.85rem;
	transition: all var(--transition);
}

.btn-icon-danger:hover { background: #dc3545; color: var(--white); }

/* Alerts */
.alert {
	padding: 14px 20px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-weight: 500;
	font-size: 0.9rem;
}

.alert-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.alert-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Admin header */
.admin-header {
	background: var(--white);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	height: 60px;
	gap: 32px;
}

.admin-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--dark);
	flex-shrink: 0;
}

.admin-brand i { color: var(--primary); font-size: 1.2rem; }

.admin-nav {
	display: flex;
	gap: 4px;
	flex: 1;
}

.admin-nav a {
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 0.9rem;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all var(--transition);
}

.admin-nav a:hover { background: var(--bg); color: var(--primary); }
.admin-nav a.active { background: rgba(45,106,106,0.08); color: var(--primary); }

.admin-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

/* Main content */
.admin-main {
	max-width: 1200px;
	margin: 24px auto;
	padding: 0 24px;
}

/* Cards */
.admin-card {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin-bottom: 24px;
	overflow: hidden;
}

.admin-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 28px;
	border-bottom: 1px solid var(--border);
}

.admin-card-header h2 {
	font-size: 1.15rem;
	color: var(--dark);
	display: flex;
	align-items: center;
	gap: 10px;
}

.admin-card-header h2 i { color: var(--primary); }

/* Admin forms */
.admin-form { padding: 28px; }
.admin-form-inline {
	padding: 28px;
	background: #f8f9fa;
	border-bottom: 1px solid var(--border);
}

.admin-form-inline h3 {
	font-size: 1.05rem;
	color: var(--dark);
	margin-bottom: 20px;
}

/* Table rows */
.admin-table-row {
	display: flex;
	align-items: center;
	padding: 16px 28px;
	border-bottom: 1px solid var(--border);
	gap: 20px;
	transition: background var(--transition);
}

.admin-table-row:last-child { border-bottom: none; }
.admin-table-row:hover { background: #fafbfc; }

.admin-table-thumb {
	width: 80px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--bg);
}

.admin-table-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-light);
	font-size: 1.2rem;
}

.admin-table-info {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.admin-table-info strong {
	color: var(--dark);
	font-size: 0.95rem;
}

.admin-table-info small {
	color: var(--text-light);
	font-size: 0.8rem;
	width: 100%;
}

.admin-table-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* Badges */
.badge {
	padding: 3px 10px;
	border-radius: 50px;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.badge-sdb { background: #e3f2fd; color: #1565c0; }
.badge-carrelage { background: #fff3e0; color: #e65100; }
.badge-chauffage { background: #fce4ec; color: #c62828; }

/* Gallery grid admin */
.gallery-admin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
	padding: 24px 28px;
}

.gallery-admin-item {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 4/3;
	background: var(--bg);
}

.gallery-admin-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-admin-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0,0,0,0.7));
	padding: 24px 8px 8px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	opacity: 0;
	transition: opacity var(--transition);
}

.gallery-admin-item:hover .gallery-admin-overlay { opacity: 1; }

.photo-name {
	color: #fff;
	font-size: 0.7rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100px;
}

/* Upload zone */
.upload-form { padding: 24px 28px; border-bottom: 1px solid var(--border); }

.upload-zone {
	border: 2px dashed var(--border);
	border-radius: var(--radius);
	padding: 40px;
	text-align: center;
	margin-bottom: 16px;
	transition: all var(--transition);
	cursor: pointer;
}

.upload-zone.drag-over {
	border-color: var(--primary);
	background: rgba(45,106,106,0.04);
}

.upload-zone i { font-size: 2rem; color: var(--text-light); margin-bottom: 12px; display: block; }
.upload-zone p { color: var(--text-light); font-size: 0.9rem; }
.upload-zone input[type="file"] { display: none; }
.upload-label { color: var(--primary); font-weight: 600; cursor: pointer; }
.upload-label:hover { text-decoration: underline; }

/* Current header image */
.current-header-img {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 12px;
	padding: 12px;
	background: var(--bg);
	border-radius: 8px;
}

.current-header-img img {
	width: 120px;
	height: 80px;
	object-fit: cover;
	border-radius: 6px;
}

.current-header-img span {
	font-size: 0.85rem;
	color: var(--text-light);
}

/* Testimonials admin */
.testimonial-admin-item {
	padding: 24px 28px;
	border-bottom: 1px solid var(--border);
}

.testimonial-admin-item:last-child { border-bottom: none; }

.testimonial-admin-text {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.testimonial-admin-text i {
	color: var(--primary);
	opacity: 0.3;
	font-size: 1.2rem;
	flex-shrink: 0;
	margin-top: 3px;
}

.testimonial-admin-text p {
	flex: 1;
	font-style: italic;
	line-height: 1.7;
}

.testimonial-admin-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	padding-left: 36px;
}

.testimonial-edit-form {
	margin-top: 16px;
	padding: 20px;
	background: var(--bg);
	border-radius: 8px;
}

.testimonial-edit-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95rem;
	resize: vertical;
	margin-bottom: 12px;
}

.testimonial-edit-form textarea:focus {
	outline: none;
	border-color: var(--primary);
}

/* Color picker */
.color-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-bottom: 24px;
}

.color-item label {
	display: block;
	font-weight: 500;
	margin-bottom: 8px;
	font-size: 0.9rem;
	color: var(--dark);
}

.color-item small {
	display: block;
	color: var(--text-light);
	font-size: 0.8rem;
	margin-top: 6px;
}

.color-input-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
}

.color-input-wrap input[type="color"] {
	width: 48px;
	height: 40px;
	border: 2px solid var(--border);
	border-radius: 8px;
	cursor: pointer;
	padding: 2px;
	background: var(--white);
}

.color-input-wrap .color-text {
	width: 90px;
	padding: 8px 12px;
	border: 1.5px solid var(--border);
	border-radius: 6px;
	font-family: monospace;
	font-size: 0.85rem;
	background: var(--bg);
	color: var(--text);
}

.color-preview {
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 24px;
	border: 1px solid var(--border);
}

.cp-header {
	padding: 20px 24px;
	background: linear-gradient(135deg, #1e4d4d, #2d6a6a);
	color: #fff;
	font-weight: 600;
}

.cp-body {
	padding: 24px;
	display: flex;
	gap: 16px;
	background: var(--white);
}

.cp-btn-primary {
	padding: 10px 24px;
	border-radius: 8px;
	background: #d4813b;
	color: #fff;
	font-weight: 600;
	font-size: 0.85rem;
}

.cp-btn-outline {
	padding: 10px 24px;
	border-radius: 8px;
	border: 2px solid #2d6a6a;
	color: #2d6a6a;
	font-weight: 600;
	font-size: 0.85rem;
	background: transparent;
}

/* Nav labels mobile */
@media (max-width: 600px) {
	.nav-label { display: none; }
}

/* Empty state */
.empty-state {
	text-align: center;
	padding: 40px;
	color: var(--text-light);
	font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
	.admin-header-inner {
		flex-wrap: wrap;
		height: auto;
		padding: 12px 16px;
		gap: 8px;
	}

	.admin-nav { order: 3; width: 100%; }

	.admin-actions { margin-left: auto; }

	.form-row { flex-direction: column; gap: 0; }

	.admin-table-row { flex-wrap: wrap; }
	.admin-table-actions { width: 100%; justify-content: flex-end; }

	.gallery-admin-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

	.stats-overview { grid-template-columns: 1fr 1fr; }
	.stats-grid-2col { grid-template-columns: 1fr; }
	.chart-container { gap: 2px; }
	.chart-label { font-size: 8px; }
}

/* === STATISTICS TAB === */
.stats-overview {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}
.stat-card {
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
	border: 1px solid #e8ecf0;
}
.stat-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 28px; font-weight: 700; line-height: 1.1; color: #1a1a2e; }
.stat-label { font-size: 13px; color: #888; margin-top: 2px; }

/* Chart */
.chart-container {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 180px;
	padding: 20px 0 0;
}
.chart-bar-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	justify-content: flex-end;
	cursor: default;
}
.chart-bar {
	width: 100%;
	min-height: 4px;
	background: linear-gradient(180deg, #3498db, #2980b9);
	border-radius: 4px 4px 0 0;
	transition: opacity .2s;
}
.chart-bar-wrapper:hover .chart-bar { opacity: .75; }
.chart-label {
	font-size: 10px;
	color: #999;
	margin-top: 6px;
	line-height: 1;
}

/* Stats 2-col grid */
.stats-grid-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-bottom: 24px;
}

/* Device bars */
.device-bars { padding: 8px 0 16px; }
.device-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.device-label { font-size: 13px; color: #555; min-width: 110px; }
.device-bar-track { flex: 1; height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.device-bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.device-pct { font-size: 14px; font-weight: 600; color: #333; min-width: 40px; text-align: right; }

/* SEO */
.seo-score-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 14px;
	border-radius: 20px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
}
.seo-progress-bar {
	height: 8px;
	background: #f0f0f0;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 20px;
}
.seo-progress-fill {
	height: 100%;
	border-radius: 4px;
	transition: width .5s ease;
}
.seo-checklist { display: flex; flex-direction: column; gap: 10px; }
.seo-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid #e8ecf0;
}
.seo-item i { font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.seo-item div { display: flex; flex-direction: column; }
.seo-item strong { font-size: 14px; color: #1a1a2e; }
.seo-item small { font-size: 12px; color: #888; margin-top: 2px; }
.seo-ok { background: #f0fdf4; border-color: #bbf7d0; }
.seo-ok i { color: #27ae60; }
.seo-warn { background: #fffbeb; border-color: #fde68a; }
.seo-warn i { color: #f39c12; }

/* Admin table (stats) */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.admin-table th { font-weight: 600; color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table tbody tr:hover { background: #fafbfc; }

/* Button outline admin */
.btn-outline-admin {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 2px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #555;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all .2s;
}
.btn-outline-admin:hover { border-color: #3498db; color: #3498db; }
