/* Cognix Skills - composants d'habillage (transposés du design Claude Design).
   Tokens définis dans colors_and_type.css (+ alias). Chargé APRÈS app.css. */

/* ---- Barre supérieure institutionnelle ---- */
.cx-top { display:flex; align-items:center; gap:28px; height:64px; padding:0 var(--space-8);
  background: var(--surface-inst); color: var(--text-on-dark); }
.cx-logo { display:flex; align-items:center; gap:12px; text-decoration:none; }
.cx-logo img { height:26px; display:block; }
.cx-logo .divider { width:1px; height:22px; background: rgba(255,255,255,.22); }
.cx-logo .sk { font-family: var(--font-corps); font-weight:800; font-size:12px; letter-spacing:.24em;
  text-transform:uppercase; color: var(--color-or); }
.cx-nav { display:flex; gap:22px; margin-left:8px; align-self:stretch; align-items:stretch; }
.cx-nav a { display:flex; align-items:center; color: rgba(255,255,255,.82); font-weight:600; font-size:14px;
  text-decoration:none; border-bottom:3px solid transparent; transition: color var(--transition), border-color var(--transition); }
.cx-nav a:hover { color:#fff; text-decoration:none; }
.cx-nav a.is-current { color:#fff; border-bottom-color: var(--color-or); }
.cx-top .cx-right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.cx-user { display:flex; align-items:center; gap:9px; font-size:13px; color: rgba(255,255,255,.9); }
.cx-avatar { width:30px; height:30px; border-radius: var(--radius-full); background: var(--color-or);
  color: var(--color-gris); display:grid; place-items:center; font-weight:800; font-size:13px; }
.cx-iconbtn { display:grid; place-items:center; width:34px; height:34px; border-radius: var(--radius-full);
  border:1px solid rgba(255,255,255,.18); background:transparent; color: rgba(255,255,255,.85);
  cursor:pointer; transition: background var(--transition), border-color var(--transition); }
.cx-iconbtn:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.32); }
.cx-iconbtn .sun { display:none; }
:root[data-theme="dark"] .cx-iconbtn .moon { display:none; }
:root[data-theme="dark"] .cx-iconbtn .sun { display:block; }
.cx-signout { color: rgba(255,255,255,.7); font-size:13px; font-weight:600; background:none; border:0; cursor:pointer; padding:0; }
.cx-signout:hover { color:#fff; }

/* ---- Page ---- */
.cx-main { max-width: var(--content-max); margin:0 auto; padding: var(--space-8) var(--space-8) 64px; }
.cx-page-head { margin-bottom: var(--space-6); }
.cx-label { font-family: var(--font-corps); font-weight:800; font-size: var(--fs-label);
  letter-spacing:.06em; text-transform:uppercase; color: var(--color-or); }
.cx-title { font-family: var(--font-titre); font-size: var(--fs-h2); font-weight:700; margin:6px 0 8px; color: var(--text-strong); }
.cx-sub { color: var(--text-muted); font-size: var(--fs-body); max-width:70ch; text-wrap:pretty; }

/* ---- Barre d'outils / filtres ---- */
.cx-toolbar { display:flex; flex-wrap:wrap; gap:var(--space-2); align-items:center; margin: var(--space-4) 0 0; }
/* Groupe des rangées de filtres : séparateur + respiration avant la 1re section (DS). */
.cx-filters { margin-top: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border); }
.cx-filters .cx-filter-row:last-child { margin-bottom: 0; }
.cx-search { flex:1; min-width:240px; display:flex; align-items:center; gap:8px; background: var(--surface-card);
  border:1px solid var(--border); border-radius: var(--radius-control); padding:10px 12px; color: var(--text-muted); }
.cx-search input { border:0; outline:0; font:inherit; flex:1; color: var(--text-primary); background:transparent; }
.cx-filter-row { display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin-bottom:14px; }
.cx-filter-lab { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); min-width:96px; }
.cx-chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius: var(--radius-full);
  border:1px solid var(--border); background: var(--surface-card); color: var(--text-primary); font-size: var(--fs-sm);
  font-weight:600; cursor:pointer; text-decoration:none; transition: all var(--transition); }
.chip:hover { border-color: var(--text-primary); text-decoration:none; }
.chip.is-active { background: var(--color-gris); color:#fff; border-color: var(--color-gris); }
:root[data-theme="dark"] .chip.is-active { background: var(--color-or); color: var(--color-gris); border-color: var(--color-or); }
.chip .n { color: var(--text-muted); font-weight:700; }
.chip.is-active .n { color: rgba(255,255,255,.72); }
:root[data-theme="dark"] .chip.is-active .n { color: rgba(69,75,87,.7); }
.chip .swatch { width:8px; height:8px; border-radius:50%; }

/* ---- Section ---- */
.cx-section-title { display:flex; align-items:center; gap:12px; font-family: var(--font-titre);
  font-weight:700; font-size:19px; color: var(--text-strong); margin: 0 0 var(--space-3); }
.cx-section-title + .cx-grid { margin-bottom: var(--space-6); }
.cx-section-title .count { color: var(--text-muted); font-weight:600; font-family: var(--font-corps); font-size:14px; }
.cx-section-title .rule { flex:1; height:1px; background: var(--border); }

/* ---- Grille de cartes de skills ---- */
.cx-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(360px,1fr)); gap: var(--space-6); }
.skill-card { position:relative; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 28px 28px 22px;
  border-top:5px solid var(--pole-color, var(--color-bleu)); transition: box-shadow var(--transition), transform var(--transition); }
.skill-card:hover { box-shadow: var(--shadow-modal); transform: translateY(-2px); }
.skill-card h3 { font-family: var(--font-corps); font-size:17px; font-weight:800; margin:0 0 8px; color: var(--text-strong); }
.skill-card p { margin:0 0 18px; color: var(--text-muted); font-size: var(--fs-sm); line-height:1.55; text-wrap:pretty; }
.skill-card .row { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }

/* Couleurs de pôle (barre d'accent) */
.pole-prospection { --pole-color: var(--color-bleu); }
.pole-website     { --pole-color: var(--color-vert); }
.pole-marketing   { --pole-color: var(--color-orange); }
.pole-bni         { --pole-color: var(--color-bleu-fonce); }
.pole-assistant   { --pole-color: var(--color-violet); }
.pole-fidelisation{ --pole-color: var(--color-vert-medium); }
.pole-reference   { --pole-color: var(--color-or); }
.pole-securite    { --pole-color: var(--color-rouge); }
.pole-monitoring  { --pole-color: var(--color-orange-fonce); }
.pole-util        { --pole-color: var(--color-ink-soft); }

/* ---- Pills & badges ---- */
.pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius: var(--radius-full);
  font-size: var(--fs-label); font-weight:800; line-height:1.6; }
.pill .dot { width:7px; height:7px; border-radius:50%; background: currentColor; }
.pill.is-bon   { background: var(--ok-bg);   color: var(--ok-fg); }
.pill.is-moyen { background: var(--warn-bg); color: var(--warn-fg); }
.pill.is-faible{ background: var(--err-bg);  color: var(--err-fg); }
.pill.is-na    { background: var(--surface-inline); color: var(--text-muted); }
.badge { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius: var(--radius-full);
  font-size: var(--fs-label); font-weight:800; }
.badge-type-agent { background: var(--warn-bg); color: var(--warn-fg); }
.badge-type-skill { background: var(--ok-bg); color: var(--ok-fg); }
.badge-type-util  { background: var(--surface-inline); color: var(--text-primary); }
.badge-pole   { background:transparent; border:1px solid var(--border); color: var(--text-primary); font-weight:700; }
.badge-miroir { background: var(--surface-inline); border:1px solid var(--border); color: var(--text-muted); font-weight:700; }
.badge-commun { background: var(--commun-bg); color: var(--commun-fg); }
.badge-det { background: var(--surface-card); border:1px solid var(--border); color: var(--text-primary); font-weight:700; }
.badge-det .d { width:8px; height:8px; border-radius:50%; display:inline-block; }

/* ---- Boutons (skin Cognix) ---- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px;
  border-radius: var(--radius-control); font:inherit; font-weight:800; font-size:14px; cursor:pointer;
  border:1px solid transparent; text-decoration:none; transition: background var(--transition), border-color var(--transition); }
.btn--primary { background: var(--color-gris); color:#fff; }
.btn--primary:hover { background: var(--color-gris-fonce); }
:root[data-theme="dark"] .btn--primary { background: var(--color-or); color: var(--color-gris); }
:root[data-theme="dark"] .btn--primary:hover { background: #e8c874; }
.btn--cta { background: var(--color-orange); color:#fff; }
.btn--cta:hover { background: var(--color-orange-fonce); }
.btn--ghost { background: var(--surface-card); border-color: var(--border); color: var(--text-primary); }
.btn--ghost:hover { background: var(--surface-inline); }

/* ---- Carte générique ---- */
.card { background: var(--surface-card); border:1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card__head { padding:18px 24px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card__head h3 { margin:0; font-family: var(--font-corps); font-size:15px; font-weight:800; color: var(--text-strong); }
.card__body { padding:24px; }

/* ---- Fiche technique ---- */
.spec { display:grid; grid-template-columns: 150px 1fr; gap:12px 18px; font-size: var(--fs-sm); margin:0; }
.spec dt { color: var(--text-muted); font-weight:700; }
.spec dd { margin:0; color: var(--text-primary); }

/* ---- Login ---- */
.cx-login-wrap { min-height:100vh; display:grid; place-items:center; background: var(--surface-inst);
  position:relative; overflow:hidden; padding:24px; }
.cx-login-veil { position:absolute; width:560px; height:560px; border-radius:50%; background: var(--or-veil-12);
  top:-180px; right:-140px; pointer-events:none; }
.cx-login-veil.two { width:360px; height:360px; top:auto; right:auto; bottom:-160px; left:-120px; }
.cx-login { position:relative; width:410px; max-width:100%; background: var(--surface-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); padding: 40px 36px; border-top:5px solid var(--color-or); }
.cx-login .brandline { display:flex; align-items:center; gap:12px; margin-bottom:26px; }
.cx-login .brandline img { height:30px; }
.cx-login .brandline .sk { font-weight:800; font-size:12px; letter-spacing:.24em; text-transform:uppercase; color: var(--color-or); }
.cx-login .brandline .divider { width:1px; height:24px; background: var(--border); }
.cx-login h1 { font-family: var(--font-titre); font-size:24px; font-weight:700; margin:0 0 6px; }
.field { display:block; margin:16px 0; }
.field label { display:block; font-size: var(--fs-sm); font-weight:700; margin-bottom:6px; color: var(--text-primary); }
.field input { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); }
.field input::placeholder { color: var(--text-muted); }
.field input:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-or { display:flex; align-items:center; gap:10px; color: var(--text-muted); font-size:12px; font-weight:700; margin:18px 0; }
.cx-or span.line { flex:1; height:1px; background: var(--border); }

/* ---- Exploration 3D (re-teinte) ---- */
.cx-explore { position:relative; height: calc(100vh - 64px); background: var(--surface-inst); overflow:hidden; }
.cx-explore canvas { display:block; width:100%; height:100%; }
.cx-explore .legend { position:absolute; top:20px; left:20px; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-modal); padding:16px 18px; min-width:200px; }
.cx-explore .legend h4 { margin:0 0 12px; font-family: var(--font-corps); font-size:12px; font-weight:800;
  letter-spacing:.06em; text-transform:uppercase; color: var(--text-muted); }
.cx-explore .legend .lg-row { display:flex; align-items:center; gap:10px; font-size:13px; padding:4px 0; color: var(--text-primary); }
.cx-explore .legend .lg-row .swatch { width:12px; height:12px; border-radius:50%; }
.cx-explore .preview { position:absolute; top:20px; right:20px; width:300px; background: var(--surface-card);
  border:1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-modal);
  border-top:5px solid var(--pole-color, var(--color-bleu)); padding:22px; }

/* ---- Accueil (hero + cartes d'action) - transposé du DS ---- */
.cx-hero { padding: var(--space-5) 0 var(--space-4); }
.cx-hero h1 { font-family: var(--font-titre); font-size: var(--fs-h1); font-weight:700; margin:8px 0 12px;
  color: var(--text-strong); letter-spacing:-0.02em; }
.cx-hero p { color: var(--text-muted); font-size:17px; max-width:64ch; margin:0; text-wrap:pretty; }
.cx-actions { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: var(--space-3); }
.action-card { display:flex; flex-direction:column; gap:12px; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding:28px; text-decoration:none;
  border-top:5px solid var(--pole-color, var(--color-bleu)); transition: box-shadow var(--transition), transform var(--transition); }
.action-card:hover { box-shadow: var(--shadow-modal); transform: translateY(-2px); }
.action-card .ico { width:40px; height:40px; display:grid; place-items:center; border-radius: var(--radius-control);
  background: var(--surface-inline); color: var(--pole-color, var(--color-bleu)); }
.action-card h3 { font-family: var(--font-corps); font-size:17px; font-weight:800; margin:0; color: var(--text-strong); }
.action-card p { margin:0; color: var(--text-muted); font-size: var(--fs-sm); line-height:1.55; text-wrap:pretty; flex:1; }
.action-card .go { font-weight:800; font-size:13px; color: var(--text-link); display:inline-flex; align-items:center; gap:6px; }
.action-card:hover .go { gap:9px; }

/* ---- Formulaire (grille équilibrée) - transposé du DS ---- */
.cx-form { display:grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-4); }
.cx-form .field { margin:0; }
.cx-form .field.full { grid-column: 1 / -1; }
.cx-form textarea { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); resize:vertical; min-height:110px; }
.cx-form textarea:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-form select { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); }
.cx-form select:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-cat-row { display:flex; gap:10px; align-items:stretch; }
.cx-cat-row select { flex:1; }

/* ---- Champ d'upload (charte Cognix) - transposé du DS ---- */
.cx-upload { display:block; }
.cx-upload input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.cx-dropzone { display:flex; align-items:center; gap:14px; padding:20px; border:1.5px dashed var(--border);
  border-radius: var(--radius-card); background: var(--surface-inline); cursor:pointer;
  transition: border-color var(--transition), background var(--transition); }
.cx-dropzone:hover, .cx-dropzone.is-drag { border-color: var(--color-or); background: var(--or-veil-12); }
.cx-dropzone .ico { flex:none; width:40px; height:40px; display:grid; place-items:center; border-radius: var(--radius-control);
  background: var(--surface-card); color: var(--color-bleu); border:1px solid var(--border); }
.cx-dropzone .txt { font-size:13px; color: var(--text-muted); line-height:1.5; }
.cx-dropzone .txt strong { color: var(--text-primary); font-weight:800; }
.cx-dropzone .pick { color: var(--text-link); font-weight:800; }
.cx-file { display:none; align-items:center; gap:10px; margin-top:10px; padding:10px 14px; border:1px solid var(--border);
  border-radius: var(--radius-control); background: var(--surface-card); font-size:13px; }
.cx-file.show { display:flex; }
.cx-file .name { font-weight:800; color: var(--text-primary); }
.cx-file .size { color: var(--text-muted); }
.cx-file .rm { margin-left:auto; background:none; border:0; color: var(--text-muted); cursor:pointer; font-weight:800; font-size:16px; line-height:1; }
.cx-file .rm:hover { color: var(--color-rouge); }

/* ---- Exploration 3D : bouton plein écran - transposé du DS ---- */
.cx-explore .fsbtn { position:absolute; bottom:20px; right:20px; display:inline-flex; align-items:center; gap:8px;
  padding:9px 14px; border-radius: var(--radius-control); border:1px solid var(--border); background: var(--surface-card);
  color: var(--text-primary); font:inherit; font-weight:800; font-size:13px; cursor:pointer; box-shadow: var(--shadow-card);
  transition: background var(--transition); }
.cx-explore .fsbtn:hover { background: var(--surface-inline); }
.cx-explore .fsbtn .exit { display:none; }
.cx-explore:fullscreen .fsbtn .exit, .cx-explore:-webkit-full-screen .fsbtn .exit { display:inline; }
.cx-explore:fullscreen .fsbtn .enter, .cx-explore:-webkit-full-screen .fsbtn .enter { display:none; }
.cx-explore:fullscreen, .cx-explore:-webkit-full-screen { height: 100vh !important; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .cx-top { gap:16px; padding:8px var(--space-4); height:auto; flex-wrap:wrap; }
  .cx-nav { order:3; width:100%; margin-left:0; gap:16px; overflow-x:auto; }
  .cx-nav a { padding:8px 0; border-bottom-width:2px; }
  .cx-main { padding: var(--space-6) var(--space-4) 48px; }
  .cx-grid { grid-template-columns: 1fr; }
  .cx-form { grid-template-columns: 1fr; }
}
