/* Carnet de chantier */
.cdc { --cdc-accent: #8a4b1f; --cdc-ink: #2b2118; --cdc-soft: #f7f1ea; --cdc-line: #e6dccf; color: var(--cdc-ink); }
.cdc * { box-sizing: border-box; }
.cdc-head h3 { margin: 0 0 .3em; }
.cdc-desc { color: #5a4c40; }
.cdc-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #eee; font-size: .85em; }
.cdc-msg { margin: 10px 0; padding: 10px 14px; border-radius: 8px; }
.cdc-msg.is-ok { background: #e7f5ec; color: #1e5a33; }
.cdc-msg.is-err { background: #fdecea; color: #8a1c12; }

/* Onglets avec compteur */
.cdc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; padding-bottom: 8px; border-bottom: 2px solid var(--cdc-line); }
.cdc-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; background: var(--cdc-soft); color: var(--cdc-ink); text-decoration: none; font-weight: 600; font-size: .95em; border: 1px solid transparent; }
.cdc-tabs a:hover { border-color: var(--cdc-line); }
.cdc-tabs a.is-active { background: var(--cdc-accent); color: #fff; }
.cdc-count { min-width: 1.6em; padding: 0 6px; border-radius: 10px; background: rgba(0,0,0,.08); font-size: .85em; text-align: center; }
.cdc-tabs a.is-active .cdc-count { background: rgba(255,255,255,.25); }
.cdc-new { padding: 0 6px; border-radius: 10px; background: #d63638; color: #fff; font-size: .78em; }

/* Boutons */
.cdc-btn { display: inline-block; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--cdc-accent); color: #fff !important; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; list-style: none; }
.cdc-btn::-webkit-details-marker { display: none; }
.cdc-btn.cdc-light { background: #fff; color: var(--cdc-accent) !important; border: 1px solid var(--cdc-accent); }
.cdc-btn.cdc-danger { background: #b32d2e; }
.cdc-btn[disabled] { opacity: .5; cursor: wait; }
.cdc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 10px 0 16px; }
.cdc-actions > details { flex: 0 1 auto; }
.cdc-actions > details[open] { flex: 1 1 100%; }
.cdc-actions details > summary { cursor: pointer; }

/* Formulaire */
.cdc-form, .cdc-propose form { margin-top: 10px; padding: 14px; border: 1px solid var(--cdc-line); border-radius: 12px; background: #fffdfa; }
.cdc-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cdc-grow { flex: 1 1 260px; }
.cdc-field { display: block; margin: 0 0 12px; }
.cdc-field > span { display: block; font-weight: 600; margin-bottom: 4px; }
.cdc-field input[type=text], .cdc-field select, .cdc-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #cfc3b4; border-radius: 8px; font: inherit; background: #fff; }
.cdc small { display: block; color: #6b5d50; font-size: .85em; margin-top: 3px; }
.cdc-media { margin: 0 0 12px; padding: 10px 12px; border: 1px dashed #d8cbbb; border-radius: 10px; }
.cdc-media legend { font-weight: 600; padding: 0 4px; }
.cdc-previews, .cdc-keep { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cdc-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.cdc-thumb { display: inline-flex; flex-direction: column; align-items: center; font-size: .85em; }
.cdc-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.cdc-keepline { display: block; margin: 4px 0; }
.cdc-upload { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9em; }
.cdc-upload progress { flex: 1 1 120px; height: 10px; }
.cdc-upload.is-done .cdc-up-pc { color: #1e5a33; font-weight: 600; }
.cdc-upload.is-error .cdc-up-pc { color: #b32d2e; }
.cdc-wait { color: #8a4b1f; font-size: .9em; }

/* Notes */
.cdc-note { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--cdc-line); border-radius: 12px; background: #fff; }
.cdc-note-head { display: flex; align-items: center; gap: 10px; }
.cdc-note-head .cdc-avatar { border-radius: 50%; }
.cdc-date { margin-left: 8px; color: #7a6b5d; font-size: .88em; }
.cdc-chip { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 10px; background: var(--cdc-soft); color: var(--cdc-accent); font-size: .82em; text-decoration: none; }
.cdc-edited { color: #8c8f94; font-size: .8em; font-style: italic; }
.cdc-note-title { margin: 10px 0 4px; }
.cdc-body { margin-top: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.cdc-body ul, .cdc-body ol { margin: .4em 0 .6em 1.4em; }
.cdc-gallery { display: grid; gap: 6px; margin-top: 10px; grid-template-columns: repeat(2, 1fr); }
.cdc-gallery.cdc-g1 { grid-template-columns: 1fr; }
.cdc-gallery.cdc-g3, .cdc-gallery.cdc-g4 { grid-template-columns: repeat(3, 1fr); }
.cdc-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--cdc-soft); }
.cdc-gallery.cdc-g1 a { aspect-ratio: auto; max-height: 520px; }
.cdc-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cdc-gallery.cdc-g1 img { height: auto; max-height: 520px; object-fit: contain; }
.cdc-video { position: relative; margin-top: 10px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.cdc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cdc-video-wait { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--cdc-soft); }
.cdc-video-wait.is-error { background: #fdecea; }
.cdc-note-foot { margin-top: 10px; font-size: .9em; }
.cdc-del { color: #b32d2e; }
.cdc-empty { padding: 18px; text-align: center; color: #7a6b5d; background: var(--cdc-soft); border-radius: 12px; }
.cdc-pages { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.cdc-pages a, .cdc-pages span { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--cdc-line); text-decoration: none; }
.cdc-pages .is-current { background: var(--cdc-accent); color: #fff; }

/* Confirmation, modération */
.cdc-confirm { margin: 12px 0; padding: 14px 16px; border-left: 4px solid #b32d2e; background: #fdecea; border-radius: 8px; }
.cdc-moder { margin: 12px 0; padding: 12px 14px; border-left: 4px solid #e0a72e; background: #fdf6e3; border-radius: 8px; }
.cdc-moder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cdc-moder-row input[type=text] { padding: 6px 8px; border: 1px solid #cfc3b4; border-radius: 6px; }
.cdc-moder-row small { display: inline; }
.cdc-note-pending { color: #8a4b1f; font-size: .9em; }
.cdc-closed { padding: 18px; background: var(--cdc-soft); border-radius: 12px; }

/* Agrandissement */
.cdc-lightbox { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; border-radius: 8px; background: #000; }
.cdc-lightbox::backdrop { background: rgba(0,0,0,.85); }
.cdc-lightbox img { display: block; max-width: 96vw; max-height: 92vh; }
.cdc-lb-close { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 22px; cursor: pointer; }

@media (max-width: 600px) {
	.cdc-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.cdc-tabs a { flex: 0 0 auto; }
	.cdc-gallery.cdc-g3, .cdc-gallery.cdc-g4 { grid-template-columns: repeat(2, 1fr); }
	.cdc-note { padding: 12px; }
}

/* Page des carnets */
.cdc-back { margin: 0 0 8px; }
.cdc-index .cdc-newcarnet { margin: 0 0 16px; }
.cdc-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cdc-card { display: flex; flex-direction: column; border: 1px solid var(--cdc-line); border-radius: 14px; overflow: hidden; background: #fff; color: var(--cdc-ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cdc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(60, 40, 20, .12); }
.cdc-card.is-closed { opacity: .8; }
.cdc-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cdc-soft); }
.cdc-card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cdc-card-ico { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 48px; }
.cdc-card-cover .cdc-new { position: absolute; top: 8px; right: 8px; padding: 2px 8px; font-size: .85em; }
.cdc-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.cdc-card-body strong { font-size: 1.05em; }
.cdc-card-link { color: var(--cdc-accent); font-size: .85em; font-weight: 600; }
.cdc-card-desc { color: #5a4c40; font-size: .92em; }
.cdc-card-meta { color: #7a6b5d; font-size: .85em; margin-top: 2px; }
