/* COM MANIA — PROD — styles du shortcode [prod]
   Palette reprise des maquettes validées (violet COM MANIA), toutes les
   règles sont scopées sous #prod-app pour ne pas déborder sur le thème. */

#prod-app {
	--bg: #F6F4FA;
	--surface: #FFFFFF;
	--surface-2: #F0ECF8;
	--border: #E1DAEF;
	--ink: #241C33;
	--ink-soft: #544B69;
	--muted: #8B82A3;
	--brand: #5B2E8E;
	--brand-dark: #3B2C54;
	--brand-soft: #8A76AE;
	--brand-tint: #EFE8FA;
	--good: #2A7A45;
	--good-tint: #E4F4E8;
	--warn: #A6650C;
	--warn-tint: #FBF0DA;
	--bad: #B33B3B;
	--bad-tint: #FBEAEA;
	--shadow: 0 1px 2px rgba(59, 44, 84, .06), 0 8px 24px -12px rgba(59, 44, 84, .18);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--ink);
	max-width: 1180px;
	margin: 0 auto;
}
#prod-app *, #prod-app *::before, #prod-app *::after { box-sizing: border-box; }
#prod-app .mono { font-family: "SFMono-Regular", Consolas, monospace; }
#prod-app button { font-family: inherit; }

#prod-app .prod-topbar {
	background: linear-gradient(135deg, var(--brand-dark), var(--brand));
	border-radius: 16px; padding: 16px 22px; display: flex; align-items: center; gap: 14px;
	box-shadow: var(--shadow); color: #fff; margin-bottom: 16px;
}
#prod-app .prod-topbar .logo {
	width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.18);
	display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none;
}
#prod-app .prod-topbar .titles { flex: 1; min-width: 0; }
#prod-app .prod-topbar .eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
#prod-app .prod-topbar h1 { font-size: 19px; font-weight: 800; margin: 0; }
#prod-app .prod-topbar .who { font-size: 12.5px; opacity: .85; text-align: right; }
#prod-app .prod-topbar .who strong { display: block; font-size: 13.5px; }

#prod-app .tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
#prod-app .tab {
	border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
	padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
#prod-app .tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

#prod-app .card {
	background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
	padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 14px;
}
#prod-app .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
#prod-app .card-head h2 { font-size: 16.5px; font-weight: 700; margin: 0; }
#prod-app .card-head p.hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

#prod-app .btn {
	border: 1px solid var(--border); background: var(--surface); color: var(--ink);
	padding: 9px 15px; border-radius: 9px; font-size: 13.5px; font-weight: 600; cursor: pointer;
	display: inline-flex; align-items: center; gap: 7px;
}
#prod-app .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
#prod-app .btn-ghost { background: transparent; }
#prod-app .btn-danger { background: var(--bad-tint); border-color: transparent; color: var(--bad); }
#prod-app .btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
#prod-app .btn:disabled { opacity: .5; cursor: not-allowed; }

#prod-app .table-wrap { overflow-x: auto; }
#prod-app table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
#prod-app th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 0 12px 8px; border-bottom: 1px solid var(--border); }
#prod-app td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#prod-app tbody tr:hover td { background: var(--surface-2); cursor: pointer; }
#prod-app tbody tr:last-child td { border-bottom: none; }
#prod-app .code { font-weight: 600; color: var(--brand); }

#prod-app .badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
#prod-app .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#prod-app .badge-good { background: var(--good-tint); color: var(--good); }
#prod-app .badge-warn { background: var(--warn-tint); color: var(--warn); }
#prod-app .badge-muted { background: var(--surface-2); color: var(--muted); }

#prod-app .toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
#prod-app .search, #prod-app select.filter {
	border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
	border-radius: 9px; padding: 9px 13px; font-size: 13.5px;
}
#prod-app .search { flex: 1; min-width: 180px; }

#prod-app .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 640px) { #prod-app .grid { grid-template-columns: 1fr; } }
#prod-app .field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
#prod-app .field .opt { font-weight: 500; color: var(--muted); }
#prod-app .field input, #prod-app .field select, #prod-app .field textarea {
	width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
	border-radius: 9px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
}
#prod-app .field input:disabled { background: var(--surface-2); color: var(--muted); }
#prod-app .field .suggest { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
#prod-app .field .suggest button { border: none; background: none; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; font-size: 11.5px; }
#prod-app .section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-soft); margin: 22px 0 12px; }
#prod-app .section-title:first-of-type { margin-top: 0; }

#prod-app .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); gap: 12px; }
#prod-app .toggle-row:last-child { border-bottom: none; }
#prod-app .toggle-row .label { font-size: 13.5px; font-weight: 600; }
#prod-app .toggle-row .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
#prod-app .switch { position: relative; width: 42px; height: 24px; flex: none; }
#prod-app .switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; }
#prod-app .switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s; pointer-events: none; }
#prod-app .switch .thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; pointer-events: none; }
#prod-app .switch input:checked + .track { background: var(--good); }
#prod-app .switch input:checked ~ .thumb { transform: translateX(18px); }

#prod-app .statut-banner {
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
	background: var(--brand-tint); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 14px;
}
#prod-app .statut-banner .left { display: flex; align-items: center; gap: 12px; }
#prod-app .dots { display: inline-flex; gap: 6px; }
#prod-app .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
#prod-app .dot.on { background: var(--good); }

#prod-app .ref-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
#prod-app .ref-tab { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-soft); padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
#prod-app .ref-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

#prod-app .inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
#prod-app .inline-form .field { flex: 1; min-width: 140px; margin: 0; }
#prod-app .msg { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
#prod-app .msg-error { background: var(--bad-tint); color: var(--bad); }
#prod-app .msg-ok { background: var(--good-tint); color: var(--good); }
#prod-app .empty { color: var(--muted); font-size: 13px; padding: 18px 4px; text-align: center; }
#prod-app footer.note { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------
   v0.2.0 — Tableau des actions : vue simple / vue détaillée, filtres
   --------------------------------------------------------------- */
#prod-app .badge-bad { background: var(--bad-tint); color: var(--bad); }
#prod-app .card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

#prod-app .vue-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
#prod-app .vue-switch button { border: none; background: var(--surface); color: var(--ink-soft); font-weight: 600; font-size: 13px; padding: 8px 14px; cursor: pointer; }
#prod-app .vue-switch button + button { border-left: 1px solid var(--border); }
#prod-app .vue-switch button.active { background: var(--brand); color: #fff; }

#prod-app .filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
#prod-app .filtres input, #prod-app .filtres select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--surface); color: var(--ink); }
#prod-app .filtres input[type="search"] { flex: 1 1 260px; min-width: 200px; }

/* Avancement libellé I · R · D · F (vue simple) */
#prod-app .etapes { display: inline-flex; gap: 4px; }
#prod-app .etape { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
#prod-app .etape.on { background: var(--good-tint); color: var(--good); }

/* Valeurs dans les cellules */
#prod-app .val-ok { color: var(--good); font-weight: 600; }
#prod-app .val-non { color: var(--muted); }
#prod-app .val-vide { color: var(--border); }
#prod-app tr.annulee td { color: var(--muted); }
#prod-app tr.annulee td:not(.fixe) { text-decoration: line-through; text-decoration-color: rgba(139, 130, 163, .5); }
#prod-app tr.annulee td .badge { text-decoration: none; }
#prod-app .pct { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
#prod-app .pct span { display: block; height: 100%; background: var(--good); }

/* Vue détaillée : défilement horizontal, en-têtes regroupés, 1re colonne figée */
#prod-app .table-detail { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
#prod-app .table-detail table { min-width: 0; font-size: 12.5px; }
#prod-app .table-detail th, #prod-app .table-detail td { white-space: nowrap; padding: 8px 10px; }
#prod-app .table-detail td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#prod-app .table-detail thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; padding-top: 8px; }
#prod-app .table-detail thead tr:nth-child(2) th { top: 31px; }
#prod-app .table-detail tr.groupes th { text-align: center; font-size: 11px; color: var(--brand-dark); border-bottom: 2px solid var(--border); }
#prod-app .table-detail tr.groupes th.g0 { background: var(--brand-tint); }
#prod-app .table-detail tr.groupes th.g1 { background: var(--surface-2); }
#prod-app .table-detail .fixe { position: sticky; left: 0; background: var(--surface); z-index: 1; border-right: 1px solid var(--border); }
#prod-app .table-detail thead .fixe { z-index: 3; vertical-align: bottom; }
#prod-app .table-detail tbody tr:hover td.fixe { background: var(--surface-2); }
#prod-app .table-detail tfoot td { font-weight: 700; border-top: 2px solid var(--border); background: var(--surface); position: sticky; bottom: 0; }
