/* PawaPostGenerator — Frontend
   Palette alignée sur la maquette : fond bleu très clair, accent bleu,
   violet et doré en touches ponctuelles. */

.pwpg-canvas-body {
	margin: 0;
	background: #f0f4ff;
	color: #1f2937;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.pwpg-canvas-body * {
	box-sizing: border-box;
}

/* ---------- Éléments partagés ---------- */

.pwpg-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: linear-gradient(135deg, #1a44d4, #6d28d9);
	color: #fff;
	font-weight: 700;
}

.pwpg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.2rem;
	border-radius: 10px;
	border: none;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.pwpg-btn-primary {
	background: #1a44d4;
	color: #fff;
}

.pwpg-btn-primary:hover {
	background: #1536ab;
}

.pwpg-btn-block {
	width: 100%;
}

.pwpg-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.pwpg-avatar-sm { width: 32px; height: 32px; }
.pwpg-avatar-xs { width: 24px; height: 24px; margin-right: 0.4rem; vertical-align: middle; }

.pwpg-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
}

.pwpg-badge-info { background: #dbeafe; color: #1a44d4; }
.pwpg-badge-success { background: #dcfce7; color: #15803d; }
.pwpg-badge-purple { background: #ede9fe; color: #6d28d9; }
.pwpg-badge-error { background: #fee2e2; color: #dc2626; }
.pwpg-badge-neutral { background: #e5e7eb; color: #4b5563; }

/* ---------- Écrans de connexion / mot de passe ---------- */

.pwpg-auth-shell {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.pwpg-auth-card {
	width: 100%;
	max-width: 400px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(20, 30, 80, 0.08);
	padding: 2rem;
}

.pwpg-auth-logo {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
}

.pwpg-auth-title {
	font-size: 1.3rem;
	margin: 0 0 0.5rem;
}

.pwpg-auth-help {
	color: #6b7280;
	font-size: 0.9rem;
	margin: 0 0 1.2rem;
}

.pwpg-auth-links {
	text-align: center;
	margin-top: 1.2rem;
	font-size: 0.9rem;
}

.pwpg-auth-links a {
	color: #1a44d4;
	text-decoration: none;
}

.pwpg-alert {
	padding: 0.7rem 1rem;
	border-radius: 8px;
	font-size: 0.88rem;
	margin-bottom: 1.2rem;
}

.pwpg-alert-error { background: #fee2e2; color: #b91c1c; }
.pwpg-alert-success { background: #dcfce7; color: #15803d; }

.pwpg-form { display: flex; flex-direction: column; gap: 1rem; }

.pwpg-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; font-weight: 600; color: #374151; }

.pwpg-field input,
.pwpg-field select,
.pwpg-field textarea {
	font: inherit;
	padding: 0.65rem 0.8rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #111827;
}

.pwpg-field input:focus,
.pwpg-field select:focus,
.pwpg-field textarea:focus {
	outline: 2px solid #1a44d4;
	outline-offset: 1px;
}

.pwpg-field-row { display: flex; gap: 1rem; }
.pwpg-field-row .pwpg-field { flex: 1; }

.pwpg-checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: #4b5563; }

.pwpg-code-input {
	font-size: 1.4rem;
	letter-spacing: 0.5em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* ---------- Layout applicatif (dashboard) ---------- */

.pwpg-app {
	display: flex;
	min-height: 100vh;
}

.pwpg-sidebar {
	width: 240px;
	flex-shrink: 0;
	background: #fff;
	border-right: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1rem;
	position: sticky;
	top: 0;
	height: 100vh;
}

.pwpg-sidebar-logo {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 700;
	padding: 0 0.5rem;
	margin-bottom: 1.5rem;
}

.pwpg-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }

.pwpg-nav-item {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.65rem 0.8rem;
	border-radius: 8px;
	color: #374151;
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 500;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
}

.pwpg-nav-item:hover { background: #f3f4f6; }

.pwpg-nav-item-active { background: #eef2ff; color: #1a44d4; font-weight: 600; }

.pwpg-nav-item-disabled { color: #9ca3af; cursor: default; }
.pwpg-nav-item-disabled:hover { background: none; }

.pwpg-nav-icon { width: 1.2em; text-align: center; }

.pwpg-nav-badge {
	margin-left: auto;
	background: #dc2626;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	border-radius: 999px;
	padding: 0.05rem 0.5rem;
}

.pwpg-sidebar-user {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.8rem 0.5rem 0;
	border-top: 1px solid #e5e7eb;
	margin-top: 0.8rem;
	padding-top: 1rem;
}

.pwpg-user-name { font-weight: 600; font-size: 0.9rem; }

.pwpg-logout-link { font-size: 0.8rem; color: #6b7280; text-decoration: none; }

.pwpg-main { flex: 1; padding: 2rem; max-width: 1200px; }

.pwpg-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }

.pwpg-greeting { font-size: 1.5rem; margin: 0; }

.pwpg-date { color: #6b7280; margin: 0.2rem 0 0; font-size: 0.9rem; }

.pwpg-stats-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.pwpg-stat-card {
	background: #fff;
	border-radius: 14px;
	padding: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	box-shadow: 0 1px 3px rgba(20, 30, 80, 0.05);
}

.pwpg-stat-card strong { display: block; font-size: 1.4rem; }
.pwpg-stat-card span { display: block; color: #6b7280; font-size: 0.8rem; }
.pwpg-stat-error { color: #dc2626; }

.pwpg-stat-icon {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	font-size: 1.1rem;
}

.pwpg-stat-icon-blue { background: #dbeafe; }
.pwpg-stat-icon-green { background: #dcfce7; }
.pwpg-stat-icon-purple { background: #ede9fe; }
.pwpg-stat-icon-red { background: #fee2e2; }

.pwpg-actions-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.pwpg-action-card {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 1.1rem;
	border-radius: 14px;
	border: none;
	background: #fff;
	box-shadow: 0 1px 3px rgba(20, 30, 80, 0.05);
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.pwpg-action-card small { display: block; color: #6b7280; font-size: 0.8rem; font-weight: 400; margin-top: 0.15rem; }

.pwpg-action-card-primary { background: #1a44d4; color: #fff; }
.pwpg-action-card-primary small { color: #dbe4ff; }
.pwpg-action-card-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.pwpg-action-card-disabled { color: #9ca3af; cursor: default; }

.pwpg-action-icon { font-size: 1.4rem; }

/* Panneau de génération */
.pwpg-panel {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(20, 30, 80, 0.12);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.pwpg-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pwpg-panel-header h2 { margin: 0; font-size: 1.1rem; }
.pwpg-panel-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #6b7280; }
.pwpg-panel-error { background: #fee2e2; color: #b91c1c; padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.85rem; }

/* Activité récente */
.pwpg-activity { background: #fff; border-radius: 14px; padding: 1.3rem; box-shadow: 0 1px 3px rgba(20, 30, 80, 0.05); }

.pwpg-activity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pwpg-activity-header h2 { margin: 0; font-size: 1.05rem; }

.pwpg-link-disabled { color: #9ca3af; font-size: 0.85rem; cursor: default; }

.pwpg-empty-state { color: #6b7280; text-align: center; padding: 2rem 0; }

.pwpg-table-desktop { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pwpg-table-desktop th { text-align: left; color: #6b7280; font-weight: 500; font-size: 0.78rem; text-transform: uppercase; padding: 0.5rem 0.6rem; border-bottom: 1px solid #f3f4f6; }
.pwpg-table-desktop td { padding: 0.7rem 0.6rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }

.pwpg-cell-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }

.pwpg-dot { width: 6px; height: 6px; border-radius: 50%; background: #1a44d4; flex-shrink: 0; }

.pwpg-cell-actions { text-align: right; }
.pwpg-icon-disabled { color: #d1d5db; margin-left: 0.4rem; cursor: default; }

.pwpg-activity-mobile { display: none; }

/* ---------- Mobile ---------- */

.pwpg-mobile-topbar,
.pwpg-mobile-tabbar,
.pwpg-mobile-sticky-cta,
.pwpg-mobile-menu-btn {
	display: none;
}

@media (max-width: 900px) {
	.pwpg-sidebar { display: none; }

	.pwpg-mobile-topbar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0.9rem 1rem;
		background: #fff;
		border-bottom: 1px solid #e5e7eb;
		position: sticky;
		top: 0;
		z-index: 10;
	}

	.pwpg-mobile-menu-btn { display: block; background: none; border: none; font-size: 1.3rem; cursor: pointer; }

	.pwpg-main { padding: 1rem; padding-bottom: 6rem; max-width: 100%; }

	.pwpg-stats-grid { grid-template-columns: repeat(2, 1fr); }

	.pwpg-actions-grid { grid-template-columns: 1fr; }

	.pwpg-table-desktop { display: none; }
	.pwpg-activity-mobile { display: flex; flex-direction: column; gap: 0.7rem; }

	.pwpg-activity-card { border: 1px solid #f3f4f6; border-radius: 10px; padding: 0.8rem; }
	.pwpg-activity-card-top { display: flex; align-items: flex-start; gap: 0.4rem; margin-bottom: 0.5rem; }
	.pwpg-activity-card-title { flex: 1; font-weight: 500; font-size: 0.9rem; }
	.pwpg-activity-card-bottom { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: #6b7280; }

	.pwpg-mobile-tabbar {
		display: flex;
		justify-content: space-around;
		align-items: center;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: #fff;
		border-top: 1px solid #e5e7eb;
		padding: 0.5rem 0;
		z-index: 20;
	}

	.pwpg-tab {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.15rem;
		font-size: 1.1rem;
		color: #6b7280;
		text-decoration: none;
		background: none;
		border: none;
	}

	.pwpg-tab small { font-size: 0.65rem; }
	.pwpg-tab-active { color: #1a44d4; }
	.pwpg-tab-disabled { color: #d1d5db; }

	.pwpg-tab-fab {
		background: #1a44d4;
		color: #fff;
		width: 44px;
		height: 44px;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 1.4rem;
		margin-top: -1.4rem;
		box-shadow: 0 4px 12px rgba(26, 68, 212, 0.4);
	}

	.pwpg-mobile-sticky-cta {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.5rem;
		position: fixed;
		left: 1rem;
		right: 1rem;
		bottom: 4.5rem;
		background: #1a44d4;
		color: #fff;
		border: none;
		border-radius: 12px;
		padding: 0.9rem;
		font-weight: 600;
		font-size: 0.95rem;
		z-index: 20;
		box-shadow: 0 8px 20px rgba(26, 68, 212, 0.3);
	}

	.pwpg-mobile-sticky-cta:disabled { opacity: 0.5; }

	.pwpg-field-row { flex-direction: column; gap: 1rem; }
}
