:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #dbe2ee;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --success: #0f9d58;
  --warning: #c98a00;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, system-ui, sans-serif; background:var(--bg); color:var(--text); }
.layout { display:grid; grid-template-columns: 240px 1fr; min-height:100vh; }
.sidebar { background:#111827; color:white; padding:24px; }
.brand { font-weight:700; font-size:1.2rem; margin-bottom:24px; }
.sidebar nav { display:flex; flex-direction:column; gap:10px; }
.sidebar a { color:#e5e7eb; text-decoration:none; padding:10px 12px; border-radius:10px; }
.sidebar a:hover { background:rgba(255,255,255,.08); }
.content { padding:24px; }
.panel { background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:20px; box-shadow:0 10px 30px rgba(17,24,39,.04); }
.grid { display:grid; gap:16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; gap:16px; flex-wrap:wrap; }
.btn, button { border:0; background:var(--accent); color:white; padding:10px 14px; border-radius:10px; text-decoration:none; cursor:pointer; }
.btn.secondary { background:#374151; }
.btn.ghost { background:#eef2ff; color:#1e40af; }
.btn.warning { background:#92400e; }
form .row { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:14px; margin-bottom:14px; }
label { display:block; font-size:.9rem; font-weight:600; margin-bottom:6px; }
input, select, textarea { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:white; }
textarea { min-height: 100px; resize: vertical; }
table { width:100%; border-collapse: collapse; background:white; }
th, td { padding:12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
th { background:#f8fafc; font-size:.9rem; }
.badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:.78rem; background:#e5edff; color:#1e40af; }
.flash { padding:12px 14px; border-radius:10px; margin-bottom:16px; }
.flash.success { background:#e8f7ef; color:#0f7a43; }
.flash.error { background:#fcebea; color:#a52714; }
.kpi { display:flex; flex-direction:column; gap:6px; }
.kpi .label { color:var(--muted); font-size:.85rem; }
.kpi .value { font-size:1.5rem; font-weight:700; }
.muted { color:var(--muted); }
.card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.attribute-row { display:grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap:10px; margin-bottom:10px; align-items:end; }
.attribute-value-box { background:#f8fafc; border:1px dashed var(--border); padding:12px; border-radius:10px; }
.toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.toolbar-search{flex:1 1 420px;}
.badge.gray{background:#eef2f7;color:#334155;}
.clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.subtle{background:#f8fafc;}
.quote-line{margin-bottom:16px;}
.line-header{margin-bottom:12px;}
.line-header h3{margin:0;}
.icon-delete{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border-radius:999px;background:#fff1f2;color:#be123c;border:1px solid #fecdd3;font-size:1.35rem;line-height:1;font-weight:700;}
.icon-delete:hover{background:#ffe4e6;color:#9f1239;}
.icon-delete:focus-visible{outline:2px solid #fb7185;outline-offset:2px;}
.data-hidden{display:none !important;}
.table-compact td,.table-compact th{padding:10px;}
.print-config div{margin:2px 0;}
.metric-note{font-size:.85rem;color:var(--muted);}
.stat-positive{color:#0f9d58;}
.stat-negative{color:#c0392b;}
@media (max-width: 980px) {
  .layout { grid-template-columns:1fr; }
  .sidebar { padding:16px; }
  form .row, .grid.cols-2, .grid.cols-3, .grid.cols-4, .attribute-row { grid-template-columns:1fr; }
}
@media print {
  .sidebar, .topbar, .no-print { display:none !important; }
  .content { padding:0; }
  .panel { box-shadow:none; border:0; padding:0; }
  body { background:white; font-size:12px; }
  table { font-size:12px; }
  th, td { padding:8px; }
}
.danger-soft{background:#fff1f2;color:#be123c;border:1px solid #fecdd3;text-decoration:none;}
.danger-soft:hover{background:#ffe4e6;}
.comparison-inline{grid-template-columns:1fr 1fr 44px;align-items:end;gap:12px;}
.comparison-action-cell{display:flex;align-items:flex-end;justify-content:center;padding-bottom:2px;}
.btn-link-inline{font-size:.85rem;margin-left:8px;text-decoration:none;color:#1e40af;}
.comparison-print-row{margin-bottom:4px;}

.icon-delete {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:999px;
  background:#fee2e2;
  color:#991b1b;
  font-size:1.2rem;
  line-height:1;
  padding:0;
}
.icon-delete:hover { background:#fecaca; }
.line-header-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.line-title-wrap { display:flex; align-items:center; gap:10px; min-width:0; }
.line-title-text { margin:0; font-size:1.1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.line-collapse-toggle {
  width:34px; height:34px; border-radius:999px; padding:0;
  background:#eef2ff; color:#1e3a8a; font-size:1rem;
}
.quote-line.collapsed { padding-bottom:14px; }
.comparative-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.comparison-inline {
  display:grid;
  grid-template-columns: auto minmax(110px, 140px) auto minmax(130px, 160px) 40px;
  gap:10px;
  align-items:end;
  margin-bottom:10px;
}
.comparison-label {
  font-size:.9rem;
  font-weight:600;
  color:var(--text);
  padding-bottom:10px;
}
.comparison-action-cell { display:flex; align-items:flex-end; justify-content:flex-end; padding-bottom:1px; }
.btn-link-inline { color:#1d4ed8; text-decoration:none; font-size:.9rem; }
.btn-link-inline:hover { text-decoration:underline; }
.calendar-week {
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.calendar-week th, .calendar-week td { border:1px solid var(--border); vertical-align:top; }
.calendar-week .hour-col { width:70px; background:#f8fafc; font-weight:600; }
.calendar-cell { min-height:68px; background:#fff; }
.calendar-slot { min-height:68px; }
.calendar-event {
  display:block;
  background:#eef2ff;
  border:1px solid #c7d2fe;
  border-radius:10px;
  padding:6px 8px;
  margin-bottom:6px;
  font-size:.82rem;
}
.calendar-event strong { display:block; }
.calendar-day-head { font-size:.9rem; }
.history-products { margin-top:6px; padding-top:6px; border-top:1px dashed var(--border); }
.history-products div { font-size:.9rem; margin-bottom:4px; }
.pagination { display:flex; gap:8px; align-items:center; justify-content:flex-end; margin-top:16px; }
.pagination .btn[aria-current="page"] { background:#1e3a8a; }
@media (max-width: 1100px) {
  .comparison-inline { grid-template-columns: 1fr; }
  .comparison-label { padding-bottom:0; }
}


main.content { min-width: 0; }
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  overflow-y: auto;
  z-index: 40;
}
.content {
  margin-left: 240px;
  min-width: 0;
}
.brand-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mobile-menu-toggle,
.mobile-menu-close { display:none; }
.comparison-inline {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 40px;
  align-items:end;
}
.comparison-inline-field { display:flex; align-items:end; gap:8px; min-width:0; }
.comparison-inline-field input { min-width:0; }
.comparison-label-inline { font-size:.9rem; font-weight:600; white-space:nowrap; }
.comparison-action-cell { padding-bottom:0; }
@media (max-width: 980px) {
  .layout { display:block; }
  .mobile-menu-toggle {
    display:inline-flex;
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 12px;
    width: calc(100% - 24px);
    justify-content:center;
  }
  .mobile-menu-close {
    display:inline-flex;
    width:34px;
    height:34px;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#1f2937;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: min(82vw, 320px);
    box-shadow: 0 12px 40px rgba(15,23,42,.28);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .content {
    margin-left: 0;
    padding: 16px;
  }
  .comparison-inline {
    grid-template-columns: 1fr;
  }
  .comparison-inline-field {
    display:grid;
    grid-template-columns: 110px 1fr;
    align-items:center;
  }
}

.table-scroll{overflow:auto;}


/* v7.2 layout + quote line refinements */
.layout { display:block; min-height:100vh; }
.sidebar { position:fixed; top:0; left:0; bottom:0; width:240px; overflow-y:auto; z-index:50; }
.content { margin-left:240px; min-width:0; padding:24px; }
.main-table-wrap, .table-scroll { overflow:auto; }
.quote-line { overflow:hidden; }
.line-header-bar { align-items:flex-start; }
.line-title-wrap { flex:1 1 auto; min-width:0; }
.line-summary { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.line-pill { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; background:#f3f4f6; color:#374151; font-size:.78rem; }
.line-body .row > div, .line-body > div { min-width:0; }
.line-body textarea { max-width:100%; }
.mobile-menu-overlay { display:none; }
body.sidebar-open { overflow:hidden; }
@media (min-width: 981px) {
  body.sidebar-open { overflow:auto; }
  .mobile-menu-toggle, .mobile-menu-close, .mobile-menu-overlay { display:none !important; }
}
@media (max-width: 980px) {
  .content { margin-left:0; padding:16px; }
  .mobile-menu-overlay {
    display:block;
    position:fixed; inset:0; background:rgba(15,23,42,.38);
    opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:45;
  }
  body.sidebar-open .mobile-menu-overlay { opacity:1; pointer-events:auto; }
  .mobile-menu-toggle { display:inline-flex; }
}

.nav-badge {
  display:inline-flex;
  min-width:20px;
  height:20px;
  margin-left:6px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#dc2626;
  color:#fff;
  font-size:.75rem;
  font-weight:700;
  padding:0 6px;
}
.alerts-list {
  display:grid;
  gap:12px;
}
.alerts-list.compact { gap:10px; }
.alert-card {
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid var(--border);
  border-left-width:5px;
  border-radius:14px;
  padding:14px 16px;
  background:#fff;
}
.alert-card-title {
  font-weight:700;
  margin-bottom:4px;
}
.alert-info { border-left-color:#2563eb; background:#eff6ff; }
.alert-warning { border-left-color:#d97706; background:#fffbeb; }
.alert-danger { border-left-color:#dc2626; background:#fef2f2; }
.quote-product-selectors { align-items:end; }
@media (max-width: 980px) {
  .alert-card { padding:12px 14px; }
}

input[type="checkbox"] { width:auto; margin-right:8px; }

.badge.success{background:#e8f7ef;color:#0f7a43;}
.badge.warning{background:#fff7ed;color:#9a3412;}
.badge.danger{background:#fcebea;color:#a52714;}

.prospecting-filters {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}
.prospecting-filters input,
.prospecting-filters select { min-width: 0; }
@media (max-width: 1100px) {
  .prospecting-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .prospecting-filters { grid-template-columns: 1fr; }
}

/* Prospection B2B - pagination et affichage compact */
.prospecting-page-size,
.prospecting-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.prospecting-page-size label {
  margin: 0;
  font-weight: 600;
}

.prospecting-page-size select {
  max-width: 110px;
}

.prospecting-pagination {
  justify-content: space-between;
  border-top: 1px solid rgba(148, 163, 184, .25);
  padding-top: 14px;
  margin-top: 14px;
}

.btn.disabled,
.btn:disabled {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
}

/* Prospection B2B v13 - interface simplifiée */
.prospecting-workflow-grid {
  display:grid;
  grid-template-columns:minmax(0, 2.15fr) minmax(300px, .85fr);
  gap:16px;
  align-items:start;
}
.prospecting-treatment h2,
.prospecting-actions-panel h2,
.prospecting-console-panel h2 { margin-top:0; }
.prospecting-step-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  margin-top:14px;
}
.prospecting-step-heading {
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}
.prospecting-step-heading h3 {
  margin:0 0 4px;
  font-size:1.05rem;
}
.prospecting-step-number {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:28px;
  height:28px;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-weight:800;
}
.prospecting-control-grid {
  display:grid;
  gap:12px;
  align-items:start;
}
.prospecting-control-grid.cols-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.prospecting-control-grid.cols-3 { grid-template-columns:repeat(3, minmax(0, 1fr)); }
.prospecting-control-grid.cols-5 { grid-template-columns:repeat(5, minmax(0, 1fr)); }
.small-help { font-size:.8rem; margin-top:6px; }
.prospecting-step-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid rgba(148, 163, 184, .28);
}
.prospecting-main-button {
  min-width:230px;
  text-align:center;
  font-weight:700;
}
.prospecting-target-box {
  margin-top:14px;
  padding:14px;
  border:1px solid #bfdbfe;
  border-radius:14px;
  background:#eff6ff;
}
.prospecting-target-box h4 { margin:0 0 12px; }
.prospecting-actions-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.prospecting-actions-grid form { margin:0; }
.prospecting-actions-grid .btn,
.prospecting-actions-grid button {
  width:100%;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.prospecting-console-panel {
  background:#0f172a;
  color:#e5e7eb;
  border-color:#1e293b;
}
.prospecting-console-panel h2 { color:#fff; }
.prospecting-console-panel .muted { color:#94a3b8; }
.prospecting-console-panel pre {
  white-space:pre-wrap;
  max-height:280px;
  overflow:auto;
  background:#111827;
  color:#e5e7eb;
  border:1px solid #334155;
  border-radius:12px;
  padding:14px;
  margin:0;
  font-size:.86rem;
}
.prospecting-console-panel pre::first-line { color:#86efac; }
@media (max-width: 1200px) {
  .prospecting-workflow-grid { grid-template-columns:1fr; }
  .prospecting-control-grid.cols-5 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .prospecting-control-grid.cols-2,
  .prospecting-control-grid.cols-3,
  .prospecting-control-grid.cols-5,
  .prospecting-actions-grid { grid-template-columns:1fr; }
  .prospecting-main-button { width:100%; min-width:0; }
}

/* Prospection B2B v19 - décision, fiche prospect et aperçu */
.prospecting-review-cell { min-width: 135px; }
.prospecting-row-actions {
  min-width: 230px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.prospecting-row-actions .btn,
.prospecting-row-actions button {
  padding:6px 8px;
  font-size:.78rem;
  min-height:30px;
  border-radius:8px;
}
.prospecting-modal[hidden] { display:none !important; }
body.prospecting-modal-open { overflow:hidden; }
.prospecting-modal {
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:stretch;
  justify-content:center;
  padding:18px;
}
.prospecting-modal-backdrop {
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.62);
  backdrop-filter:blur(3px);
}
.prospecting-modal-dialog {
  position:relative;
  width:min(1500px, 100%);
  height:calc(100vh - 36px);
  overflow:hidden;
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 24px 80px rgba(15,23,42,.35);
  display:flex;
  flex-direction:column;
}
.prospecting-modal-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:16px 18px;
  border-bottom:1px solid var(--border);
}
.prospecting-modal-header h2 { margin:0 0 4px; }
.prospecting-modal-grid {
  display:grid;
  grid-template-columns:minmax(320px, .8fr) minmax(520px, 1.6fr);
  gap:0;
  min-height:0;
  flex:1;
}
.prospecting-lead-detail-card,
.prospecting-preview-card {
  min-height:0;
  overflow:auto;
  padding:18px;
}
.prospecting-lead-detail-card {
  border-right:1px solid var(--border);
  background:#f8fafc;
}
.prospecting-lead-detail-card h3,
.prospecting-preview-card h3 { margin-top:0; }
.prospecting-detail-list {
  display:grid;
  grid-template-columns:110px 1fr;
  gap:8px 12px;
  margin:0 0 16px;
  font-size:.92rem;
}
.prospecting-detail-list dt { font-weight:700; color:#334155; }
.prospecting-detail-list dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.prospecting-review-form {
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
}
.prospecting-review-form label { margin-top:10px; }
.prospecting-preview-card {
  display:flex;
  flex-direction:column;
  background:#fff;
}
.prospecting-preview-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:12px;
}
.prospecting-preview-empty {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:360px;
  border:1px dashed var(--border);
  border-radius:14px;
  color:var(--muted);
  background:#f8fafc;
}
#prospectingLeadIframe {
  width:100%;
  flex:1;
  min-height:560px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}
@media (max-width: 980px) {
  .prospecting-modal { padding:0; }
  .prospecting-modal-dialog { height:100vh; border-radius:0; }
  .prospecting-modal-grid { grid-template-columns:1fr; }
  .prospecting-lead-detail-card { border-right:0; border-bottom:1px solid var(--border); }
  #prospectingLeadIframe { min-height:420px; }
}

.prospecting-proposal-box {
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--border);
}
.prospecting-proposal-box h3 { margin:0 0 6px; }
#prospectingProposalSummary { min-height:110px; }
#prospectingProposalBody { min-height:260px; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:.88rem; line-height:1.5; }
#prospectingProposalSubject { background:#f8fafc; }
#prospectingProposalMockupLink { margin-top:8px; display:inline-flex; width:fit-content; }
.prospecting-row-actions .prospecting-proposal-open { border-color:#bfdbfe; color:#1d4ed8; }

/* v21 - Préparation GPT assistée */
.prospecting-gpt-box{
  margin-top:18px;
  padding:16px;
  border:1px solid #dbe7ff;
  border-radius:18px;
  background:linear-gradient(180deg,#f8fbff 0%,#ffffff 100%);
}
.prospecting-gpt-box h3{margin-top:0;}
.prospecting-gpt-box textarea{
  min-height:120px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  font-size:.82rem;
  line-height:1.45;
}
.prospecting-capture-preview{
  margin:12px 0;
  padding:12px;
  border:1px dashed #c9d8f4;
  border-radius:14px;
  background:#f6f9ff;
}
.prospecting-capture-preview img{
  display:block;
  max-width:100%;
  max-height:320px;
  object-fit:contain;
  margin-top:10px;
  border-radius:12px;
  border:1px solid #d8e2f2;
  background:#fff;
}
.prospecting-row-actions .prospecting-prepare-gpt{
  border-color:#b8cdfd;
  color:#0b4de8;
}

/* v24 - capture téléchargeable et tri de travail */
.prospecting-lead-row.is-processed{
  opacity:.58;
  background:#f8fafc;
}
.prospecting-lead-row.is-processed td{
  color:#64748b;
}
.prospecting-lead-row.is-processed strong{
  color:#475569;
}
.prospecting-row-actions .prospecting-review-ok{
  border-color:#cbd5e1;
  background:#f8fafc;
  color:#334155;
  font-weight:700;
}
#prospectingCaptureDownload{
  text-decoration:none;
}
