/* ProMind Marketing Studio — feuille de style (aucune ressource externe) */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --border: #dfe3e8;
  --text: #1c2430; --muted: #5d6877; --primary: #1f5eff; --primary-ink: #ffffff;
  --primary-soft: #e6eeff; --danger: #c62828; --danger-soft: #fdecec; --warn: #9a6200;
  --warn-soft: #fff4dc; --ok: #1b7f4b; --ok-soft: #e3f5ea; --info: #245fa8; --info-soft: #e7f0fb;
  --bar: #1f5eff; --radius: 10px; --shadow: 0 1px 2px rgb(16 24 40 / 6%);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --surface: #1a2028; --surface-2: #222a34; --border: #2e3844;
    --text: #e6eaf0; --muted: #9aa5b3; --primary: #6b95ff; --primary-ink: #0d1320;
    --primary-soft: #1d2a47; --danger: #ff7b7b; --danger-soft: #3a1f22; --warn: #f0b85a;
    --warn-soft: #3a2f1a; --ok: #5ccf8f; --ok-soft: #173326; --info: #7fb2ff; --info-soft: #1a2a40;
    --bar: #6b95ff; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* Mise en page */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 800; }
.brand-lg { padding: 0 0 1rem; }
.sidebar nav ul { list-style: none; margin: 0; padding: .25rem .5rem; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; padding: .45rem .65rem; border-radius: 8px;
  color: var(--text); font-size: .92rem; }
.sidebar nav a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar nav a.soon { color: var(--muted); }
.sidebar nav a span { flex: 1; }
.phase { font-style: normal; font-size: .68rem; border: 1px solid var(--border); border-radius: 6px; padding: 0 .3rem; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: .75rem 1.1rem; color: var(--muted); font-size: .75rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.global-search { flex: 1; min-width: 200px; max-width: 520px; display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 .6rem; color: var(--muted); }
.global-search input { border: 0; background: transparent; padding: .45rem 0; width: 100%; color: var(--text); font: inherit; outline: none; }
.topbar-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex-wrap: wrap; }
.topbar-right form { margin: 0; }
.who { font-size: .9rem; }
.who small { color: var(--muted); margin-left: .25rem; }
.menu-toggle { display: none; }
.content { padding: 1.5rem; max-width: 1400px; width: 100%; }

/* Composants */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 720px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head-actions { display: flex; gap: .5rem; }
.crumbs { margin: 0; font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2 > .card { margin-bottom: 1.25rem; }

.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .25rem .6rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { background: none; border: 1px solid var(--border); border-radius: 8px; padding: .3rem .55rem; color: var(--text); cursor: pointer; }

.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-succes { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.alert-erreur { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.alert-avertissement { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

.pill { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.tag { font-size: .68rem; padding: .05rem .4rem; border-radius: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.tag-mesure { background: var(--ok-soft); color: var(--ok); }
.tag-estimation { background: var(--warn-soft); color: var(--warn); }
.tag-indispo { background: var(--surface-2); color: var(--muted); }
.tag-demo { background: var(--warn-soft); color: var(--warn); }
.status { font-size: .78rem; padding: .1rem .5rem; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.status-ok, .status-v-verifiee_technique, .status-v-confirmee_source { background: var(--ok-soft); color: var(--ok); }
.status-erreur, .status-v-invalide, .status-v-ne_plus_utiliser { background: var(--danger-soft); color: var(--danger); }
.status-avertissement, .status-v-incertaine { background: var(--warn-soft); color: var(--warn); }
.status-info, .status-v-trouvee, .status-v-en_cours { background: var(--info-soft); color: var(--info); }
.status-non_verifie, .status-non_disponible, .status-v-non_recherche { background: var(--surface-2); color: var(--muted); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.kpi header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.kpi h2 { font-size: .85rem; color: var(--muted); font-weight: 600; margin: 0; }
.kpi-value { font-size: 1.9rem; font-weight: 700; margin: .35rem 0 .1rem; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .9rem; color: var(--muted); }
.kpi footer { display: flex; flex-direction: column; gap: .1rem; font-size: .8rem; }
.kpi-off .kpi-value { color: var(--muted); }
.delta { color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented a { padding: .35rem .75rem; color: var(--text); font-size: .85rem; border-right: 1px solid var(--border); }
.segmented a:last-child { border-right: 0; }
.segmented a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.segmented a:hover { text-decoration: none; background: var(--surface-2); }

/* Graphiques SVG */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--bar); }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .lbl, .chart .val { text-anchor: middle; }
.chart .val, .chart .val-left { fill: var(--text); font-weight: 600; }
.chart .lbl-left { fill: var(--text); }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.quick-item { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; color: var(--text); font-size: .9rem; }
.quick-item:hover { background: var(--surface-2); text-decoration: none; }
.quick-item span { flex: 1; }
.quick-item em { font-style: normal; font-size: .72rem; color: var(--muted); }
.quick-item.soon { color: var(--muted); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table-compact td { padding: .35rem .6rem; }
.table .empty { text-align: center; color: var(--muted); padding: 2rem; }
.table .actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: flex-start; }
.table .actions form { margin: 0; }
.sort { color: inherit; }
.sort.on { color: var(--primary); }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1rem 0; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: .75rem; max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; max-width: none; align-items: end; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.form-inline { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .45rem .6rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.filters input[type=search] { min-width: 260px; }
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] > form { position: absolute; z-index: 10; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; box-shadow: 0 8px 24px rgb(0 0 0 / 18%); width: 340px; margin-top: .35rem; right: 0; top: 100%; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .5rem 0 .5rem .9rem; border-left: 2px solid var(--border); }
.timeline time { color: var(--muted); font-size: .8rem; display: block; }
.timeline p { margin: .2rem 0 0; }
.contact { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.log { font-family: var(--mono); font-size: .78rem; white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 70vh; overflow: auto; }

/* Connexion */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card .form { max-width: none; }

/* Responsive */
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgb(0 0 0 / 25%); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-block; }
  .content { padding: 1rem; }
  .who small { display: none; }
  .dl { grid-template-columns: 1fr; }
  .filters input[type=search] { min-width: 0; flex: 1; }
  .inline-details[open] > form { left: 1rem; right: 1rem; width: auto; position: fixed; }
}

/* --- Phases 2 à 7 --- */
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; margin: 0; }
legend { font-size: .85rem; font-weight: 600; padding: 0 .3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; }
.narrow-input { width: 5.5rem; }
.grow { flex: 1; min-width: 180px; }
.full { width: 100%; }
.inline { display: inline; margin: 0; }
label.inline { display: inline-flex; gap: .4rem; align-items: center; }
.pre { white-space: pre-wrap; font-family: var(--font); margin: .3rem 0 0; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.row-known td { background: var(--ok-soft); }
.row-late td { background: var(--danger-soft); }
.block-details { margin-top: .75rem; }
.block-details[open] > form { margin-top: .5rem; border: 1px solid var(--border); border-radius: 8px; padding: .75rem; }
.block-details summary, details > summary { list-style: none; cursor: pointer; }
.email-preview { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; background: var(--surface-2); }
.email-subject { font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .4rem; }
.steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.steps form { margin-top: .35rem; }
.branch-buttons { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.branch-panel { border: 1px solid var(--primary); border-radius: 8px; padding: .75rem 1rem; margin-top: .75rem; background: var(--primary-soft); }
.branch-panel h3 { margin-top: 0; }
textarea { width: 100%; }
.form-inline textarea { width: auto; }

/* Pipeline (vue tableau) */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .75rem; margin-bottom: 1.25rem; }
.kanban-col { flex: 0 0 230px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; }
.kanban-col header { display: flex; justify-content: space-between; align-items: baseline; }
.kanban-col h2 { font-size: .9rem; margin: 0 0 .5rem; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; margin-bottom: .45rem; font-size: .88rem; }
.kanban-move { display: flex; gap: .25rem; margin-top: .35rem; }
.kanban-move select { flex: 1; min-width: 0; font-size: .78rem; padding: .2rem; }

/* Calendrier */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: .78rem; font-weight: 600; color: var(--muted); text-align: center; padding: .25rem; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; min-height: 92px; padding: .3rem; font-size: .78rem; overflow: hidden; }
.cal-day.empty { background: transparent; border: 0; }
.cal-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day.overload { background: var(--warn-soft); }
.cal-num { font-weight: 700; margin-bottom: .2rem; }
.cal-item { background: var(--primary-soft); border-radius: 4px; padding: .1rem .3rem; margin-bottom: 2px; }
.cal-task { background: var(--surface-2); }
@media (max-width: 800px) {
  .calendar { grid-template-columns: 1fr; }
  .cal-head, .cal-day.empty { display: none; }
  .span-2 { grid-column: auto; }
}

/* Recherche d'entreprises : formulaire simple, puces de taille, barre d'actions */
.finder-main { display: grid; grid-template-columns: 2fr 2fr 1.6fr auto; gap: .75rem; align-items: end; }
.finder-field { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 600; }
.finder-field input, .finder-field select { width: 100%; font-weight: 400; }
.finder-main .finder-field input, .finder-main .finder-field select { padding: .6rem .7rem; font-size: 1rem; }
.finder-go { padding: .62rem 1.3rem; font-size: 1rem; }
.finder-hint { margin: .5rem 0 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .85rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: .25rem .75rem; border: 1px solid var(--border); border-radius: 999px;
  font-size: .85rem; background: var(--surface); }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.finder-more { margin-top: .85rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.finder-more summary { color: var(--primary); font-weight: 600; font-size: .9rem; }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; margin-top: .75rem; align-items: end; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .75rem; margin-bottom: .75rem;
  background: var(--surface-2); border-radius: 8px; }
.toolbar label.inline { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; }
.finder-results td { vertical-align: top; }
.finder-results td strong { font-weight: 600; }
.finder-results .status + .status { margin-left: .25rem; }
.add-panel { margin-top: 1rem; padding: 1rem; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary-soft); }
.add-panel h3 { margin-top: 0; }
.add-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1rem; margin-bottom: .75rem; }
.add-options { display: flex; flex-direction: column; gap: .45rem; }
.add-options label.inline { display: inline-flex; align-items: center; gap: .4rem; margin-left: 1.6rem; font-size: .88rem; }
.list-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .6rem .75rem;
  background: var(--primary-soft); border-radius: 8px; }
.list-bar form { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
@media (max-width: 800px) {
  .finder-main, .add-grid { grid-template-columns: 1fr; }
}
