/* Moon Hub — feuille de styles */

:root {
	--bg: #f4f5f8;
	--ink: #1d2230;
	--muted: #6b7280;
	--line: #e3e5ea;
	--card: #fff;
	--accent: #3b4ee0;
	--green: #1a7f3c;
	--amber: #9a6400;
	--red: #b3261e;
	--indigo: #3730a3;
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.55;
}
a { color: var(--accent); }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 26px 0 10px; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ok { color: var(--green); }
.ko { color: var(--red); }

/* Barre supérieure */
.topbar {
	display: flex; align-items: center; gap: 24px;
	background: #fff; border-bottom: 1px solid var(--line);
	padding: 0 22px; height: 56px;
}
.brand { font-weight: 700; font-size: 16px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
	padding: 8px 13px; border-radius: 7px; text-decoration: none;
	color: var(--muted); font-weight: 600;
}
.mainnav a:hover { color: var(--ink); }
.mainnav a.active { background: var(--accent); color: #fff; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.logout { text-decoration: none; }

.content { max-width: 1100px; margin: 22px auto; padding: 0 22px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash-success { background: #e3f3e7; color: var(--green); }
.flash-error { background: #fbe3e1; color: var(--red); }
.flash-warn { background: #fbeecb; color: var(--amber); }

/* Cartes */
.cards { display: flex; flex-wrap: wrap; gap: 14px; }
.card {
	flex: 1; min-width: 150px; background: var(--card);
	border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
	display: flex; flex-direction: column;
}
.card .n { font-size: 27px; font-weight: 700; }
.card .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; }
.pstep {
	flex: 1; min-width: 110px; background: #fff;
	border: 1px solid var(--line); border-top: 3px solid #c3c4c7;
	border-radius: 8px; padding: 12px; text-align: center;
}
.pn { display: block; font-size: 22px; font-weight: 700; }
.pl { font-size: 12px; color: var(--muted); }
.pstep-pending { border-top-color: #6b7280; }
.pstep-generating { border-top-color: #9a6400; }
.pstep-generated { border-top-color: var(--indigo); }
.pstep-publishing { border-top-color: #2271b1; }
.pstep-published { border-top-color: var(--green); }
.pstep-error { border-top-color: var(--red); }

/* Panneaux & formulaires */
.panel {
	background: var(--card); border: 1px solid var(--line);
	border-radius: 10px; padding: 16px 18px; margin-bottom: 14px;
}
.panel.inline, .inline { display: inline-flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
form.inline { margin: 0; }
.form label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.form .row { display: flex; gap: 16px; flex-wrap: wrap; }
.form .row > label { flex: 1; min-width: 220px; }
input[type=text], input[type=url], input[type=password], input[type=search],
input[type=number], select, textarea {
	width: 100%; font-family: inherit; font-size: 13px;
	padding: 8px 10px; border: 1px solid #c3c4c7; border-radius: 7px; background: #fff;
}
textarea { resize: vertical; }
.chk { display: flex; align-items: center; gap: 7px; font-weight: 400 !important;
	color: var(--ink) !important; font-size: 13px !important; margin: 6px 0 !important; }
.chk input { width: auto; }
.checks { display: flex; flex-direction: column; justify-content: center; }
.themegrid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 2px 12px; margin: 6px 0 4px;
}
.actions { display: flex; gap: 8px; margin-top: 14px; }

/* Boutons */
.btn {
	display: inline-block; border: 1px solid var(--line); background: #fff;
	color: var(--ink); padding: 7px 13px; border-radius: 8px; font-size: 13px;
	cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2f3fc4; color: #fff; }
.btn.primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.ghost { color: var(--muted); }

/* Tableaux */
.grid { width: 100%; border-collapse: collapse; background: #fff;
	border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grid th {
	text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
	color: var(--muted); padding: 9px 11px; border-bottom: 1px solid var(--line);
}
.grid td { padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:last-child td { border-bottom: none; }
.grid tr.dim { opacity: .55; }
.grid .num { text-align: right; }
.barcell { width: 38%; }
.bar { display: block; height: 11px; min-width: 2px; border-radius: 6px;
	background: linear-gradient(90deg, #2271b1, var(--accent)); }

/* Étiquettes */
.tag { display: inline-block; padding: 2px 8px; border-radius: 11px; font-size: 11px; font-weight: 600; }
.tag-ok, .tag-info { background: #e3f3e7; color: var(--green); }
.tag-error { background: #fbe3e1; color: var(--red); }
.tag-warn { background: #fbeecb; color: var(--amber); }
.tag-prio-haute { background: #e3f3e7; color: var(--green); }
.tag-prio-moyenne { background: #fbeecb; color: var(--amber); }
.tag-prio-basse { background: #eef0f3; color: var(--muted); }
.tag-art-pending { background: #eef0f3; color: var(--muted); }
.tag-art-generating { background: #fbeecb; color: var(--amber); }
.tag-art-generated { background: #e6e6fb; color: var(--indigo); }
.tag-art-publishing { background: #e6f0fb; color: #2271b1; }
.tag-art-published { background: #e3f3e7; color: var(--green); }
.tag-art-error { background: #fbe3e1; color: var(--red); }

/* Aperçu d'article */
.article-preview {
	background: #fff; border: 1px solid var(--line); border-radius: 10px;
	padding: 20px 26px; max-width: 760px;
}
.article-preview h2 { font-size: 19px; }
.article-preview h3 { font-size: 16px; }

/* Page de connexion */
.loginpage { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.loginbox {
	background: #fff; border: 1px solid var(--line); border-radius: 12px;
	padding: 30px 32px; width: 340px;
}
.loginbox .brand { font-size: 20px; }
.loginbox form { margin-top: 16px; }
.loginbox label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.loginbox button {
	width: 100%; margin-top: 18px; background: var(--accent); color: #fff;
	border: 0; padding: 10px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
