/* Cookodiens Hub : styles (DA Odiens, inspirée du module Hébergement). */

:root {
	--acc: #df173d;
	--acc-dark: #c50f33;
	--ink: #18181b;
	--dark: #1c1c22;
	--muted: #6b7280;
	--line: #e7e7ea;
	--line-soft: #f1f1f3;
	--bg: #f4f4f5;
	--card: #ffffff;
	--field: #fafafa;
	--green: #10b981;
}

* { 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: 15px;
	line-height: 1.5;
}
a { color: var(--acc); }

/* ---------------------------------------------------- Barre supérieure sombre */

.cch-top {
	display: flex;
	align-items: center;
	gap: 13px;
	background: var(--dark);
	color: #fff;
	padding: 14px 28px;
}
.cch-logo {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--acc);
	color: #fff;
	font-weight: 800;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: Georgia, serif;
	flex: 0 0 auto;
}
.cch-brandwrap { line-height: 1.15; }
.cch-brand { font-size: 18px; font-weight: 700; color: #fff; }
.cch-sub { color: #a1a1aa; font-size: 12.5px; margin-top: 1px; }
.cch-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.cch-nav a {
	color: #e4e4e7;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	padding: 7px 12px;
	border-radius: 8px;
}
.cch-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.cch-main { max-width: 1080px; margin: 26px auto; padding: 0 20px; }

.cch-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1 { font-size: 23px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 24px 0 10px; color: var(--ink); font-weight: 700; }
h3 { font-size: 13.5px; margin: 22px 0 8px; color: var(--ink); font-weight: 700; border-top: 1px solid var(--line-soft); padding-top: 16px; }
h3:first-of-type { border-top: none; padding-top: 4px; }

.cch-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 24px 26px;
	box-shadow: 0 1px 2px rgba(24, 24, 27, .04);
}
.cch-narrow { max-width: 420px; margin: 56px auto; }

/* ------------------------------------------------------------------- Boutons */

.cch-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--acc);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.1;
	transition: background .15s ease;
}
.cch-btn:hover { background: var(--acc-dark); color: #fff; }
.cch-btn-ghost { background: #fff; color: #3f3f46; border: 1px solid #d4d4d8; }
.cch-btn-ghost:hover { background: var(--field); color: var(--ink); }
.cch-btn-danger { background: #fff; color: var(--acc); border: 1px solid var(--acc); }
.cch-btn-danger:hover { background: var(--acc); color: #fff; }

/* ------------------------------------------------------------------- Champs */

label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 5px; color: #3f3f46; }
input, textarea, select {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid var(--line);
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	background: var(--field);
	color: var(--ink);
}
input:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--acc);
	box-shadow: 0 0 0 3px rgba(223, 23, 61, .12);
	background: #fff;
}
select { cursor: pointer; }
.cch-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
form .cch-btn { margin-top: 16px; }

.cch-muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.cch-error { color: var(--acc); font-weight: 600; }
.cch-ok { color: var(--green); font-weight: 600; }
.cch-warn { background: #fff8e6; border: 1px solid #f5d98a; color: #7a5b00; border-radius: 10px; padding: 11px 16px; margin-bottom: 14px; font-size: 13.5px; font-weight: 500; }

/* -------------------------------------------------------------- Grille projets */

.cch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cch-tile {
	display: block;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 18px 20px;
	text-decoration: none;
	color: var(--ink);
	transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.cch-tile:hover { box-shadow: 0 10px 24px rgba(24, 24, 27, .09); transform: translateY(-2px); border-color: #d4d4d8; }
.cch-tile-name { font-weight: 700; font-size: 16px; }
.cch-tile-url { color: var(--muted); font-size: 13px; margin: 3px 0 14px; word-break: break-all; }
.cch-tile-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cch-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.cch-dot.on { background: var(--green); }
.cch-dot.off { background: #d4d4d8; }

/* -------------------------------------------------------------- Détail projet */

.cch-key-box { background: var(--dark); border-radius: 12px; padding: 16px 18px; margin: 16px 0; color: #e4e4e7; }
.cch-key-box strong { color: #fff; font-size: 13.5px; }
.cch-key { display: block; margin-top: 9px; background: #000; color: #ff8ba0; padding: 11px 13px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.cch-steps { line-height: 1.8; color: #3f3f46; }
.cch-kv { border-collapse: collapse; margin: 8px 0 4px; }
.cch-kv th { text-align: left; padding: 7px 16px 7px 0; vertical-align: top; color: var(--muted); font-weight: 600; font-size: 13px; }
.cch-kv td { padding: 7px 0; }
.cch-kv code, .cch-hosts code { background: var(--line-soft); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }
.cch-hosts { columns: 2; font-size: 13px; list-style: none; padding: 0; }
.cch-hosts li { margin-bottom: 5px; }

/* ------------------------------------------------ Éditeur de config visuel */

input[type="checkbox"] { width: auto; }
input[type="color"] { width: 46px; height: 34px; padding: 2px; cursor: pointer; background: #fff; }

.cch-editor { display: flex; gap: 24px; align-items: flex-start; }
.cch-editor-form { flex: 1 1 auto; min-width: 0; }
.cch-editor-preview { flex: 0 0 320px; position: sticky; top: 16px; align-self: flex-start; }
.cch-prev-label { font-weight: 600; color: var(--muted); margin-bottom: 8px; font-size: 13px; }
.cch-prev-banner {
	border-radius: 12px;
	padding: 16px 18px;
	box-shadow: 0 4px 16px rgba(24, 24, 27, .12);
	font-size: 13px;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #fff;
	color: #1f2937;
}
.cch-prev-title { font-weight: 700; font-size: 15px; }
.cch-prev-desc { opacity: .9; word-break: break-word; }
.cch-prev-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cch-prev-btn { border-radius: 8px; padding: 9px 14px; font-weight: 600; font-size: 13px; }

.cch-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.cch-colors { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.cch-color { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; font-weight: 500; font-size: 11px; color: var(--muted); text-align: center; width: 72px; }
.cch-check { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 9px 0; color: #3f3f46; }

.cch-cats-wrap { overflow-x: auto; }
.cch-cats { width: 100%; border-collapse: collapse; font-size: 13px; }
.cch-cats th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; font-size: 12px; }
.cch-cats td { padding: 4px 6px; vertical-align: middle; }
.cch-cats input, .cch-cats select { padding: 7px 8px; font-size: 13px; }
.cch-cat-on { text-align: center; }
.cch-cat-del { background: none; border: none; color: var(--acc); cursor: pointer; font-size: 16px; padding: 4px 8px; width: auto; }
.cch-cat-del:hover { color: var(--acc-dark); }

.cch-advanced { margin-top: 22px; }
.cch-advanced summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }

/* ------------------------------------------------------ Registre de consentement */

.cch-consents { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.cch-consents th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 8px; font-size: 12px; border-bottom: 1px solid var(--line); }
.cch-consents td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.cch-consents code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* --------------------------------------------------------------- Zone dangereuse */

.cch-danger { border: 1px solid #f3c6c2; background: #fff7f6; border-radius: 12px; padding: 18px 20px; margin-top: 24px; }
.cch-danger h2 { color: var(--acc); margin: 0 0 6px; border: none; padding: 0; }

/* --------------------------------------------------------------- Lecture seule */

.cch-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cch-fieldset[disabled] { opacity: .7; }

/* -------------------------------------------------- Statistiques de consentement */

.cch-stats { display: flex; gap: 14px; margin: 6px 0 16px; flex-wrap: wrap; }
.cch-stat { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; min-width: 130px; }
.cch-stat-n { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.cch-stat-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cch-bars { display: flex; flex-direction: column; gap: 8px; max-width: 540px; }
.cch-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cch-bar-lbl { width: 110px; color: #3f3f46; flex: 0 0 auto; }
.cch-bar-track { flex: 1; height: 9px; background: var(--line); border-radius: 6px; overflow: hidden; }
.cch-bar-fill { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.cch-bar-val { width: 96px; text-align: right; color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
	.cch-editor { flex-direction: column; }
	.cch-editor-preview { position: static; flex-basis: auto; width: 100%; }
	.cch-2col { grid-template-columns: 1fr; }
	.cch-top { padding: 12px 18px; }
	.cch-main { margin: 18px auto; }
}
