/* Tableau de bord de prospection — s'appuie sur style.css (couleurs, boutons, champs) */
body.pdash { font-size: 16px; }
.top .brand { color: var(--teal); font-size: 18px; }
.top .brand b { font-weight: 900; }
.top-links { display: flex; gap: 14px; align-items: center; }
.link { background: none; border: 0; color: var(--teal); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.muted { color: var(--muted); }
.small-print { font-size: 13px; margin: 10px 0 0; }

main.dash { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 8px; }
#app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#app > * { min-width: 0; }

#app[hidden] { display: none !important; }
.login { max-width: 380px; margin: 40px auto; }
.login h1 { margin: 0; }
.panel h2 { margin: 0 0 12px; font-size: 19px; }
.panel h2 small { font-weight: 400; font-size: 14px; }

.hello h1 { margin: 10px 0 0; font-size: 28px; }
.hello p { margin: 2px 0 0; }

/* Chiffres clés */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); border-top: 4px solid var(--lagoon); }
.tile b { display: block; font-size: 32px; line-height: 1.1; color: var(--teal); }
.tile span { color: var(--muted); font-size: 14px; }
.tile.green { border-top-color: var(--green); }
.tile.orange { border-top-color: var(--orange); }
.tile.coral { border-top-color: var(--coral); }
.tiles.mini .tile { box-shadow: none; border: 1px solid var(--line); border-top-width: 4px; padding: 10px 12px; }
.tiles.mini .tile b { font-size: 24px; }

/* Robot */
.robot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.robot-head h2 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: #eef3f3; color: var(--teal); }
.pill.busy { background: #fff2d9; color: #8a5400; }
.pill.busy::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); animation: pulse 1.2s infinite; }
.pill.off { background: #f6e3df; color: #8a2a22; }
@keyframes pulse { 50% { opacity: .25; } }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.choice { border: 2px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; align-content: start; background: #fffdf9; }
.choice h3 { margin: 0; font-size: 17px; }
.choice p { margin: 0; color: var(--muted); font-size: 15px; }
.choice label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.choice.real { border-color: #bfe7e5; background: #f4fbfb; }
.choice .btn { margin-top: 4px; }

.run-title { font-weight: 700; margin: 4px 0 8px; }
.progress { height: 16px; background: var(--sand-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--lagoon), var(--teal-2)); border-radius: 999px; transition: width .6s ease; }
.run-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; font-size: 15px; }
.run-stats b { color: var(--teal); font-size: 18px; }
.feed-box summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.feed { list-style: none; margin: 0 0 12px; padding: 10px 12px; background: #f7f3ec; border-radius: 12px; max-height: 220px; overflow-y: auto;
  font-size: 13px; line-height: 1.45; display: grid; gap: 3px; }
.feed li { word-break: break-word; }
.feed li.warn { color: #8a2a22; }

/* Secteurs */
.sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.sector { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.sector h3 { margin: 0; font-size: 16px; }
.sector .progress { height: 10px; }
.sector .nums { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.sector .nums b { color: var(--ink); }

/* Tableau d'essai */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; white-space: nowrap; }
.tbl a { color: var(--teal); }

/* Liste */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h2 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--lagoon); background: #fff; color: var(--teal);
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--lagoon); color: #fff; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.filters input, .filters select { min-height: 44px; font-size: 15px; }

.plist { display: grid; gap: 10px; }
.fiche { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; background: #fff; }
.fiche.off { opacity: .6; }
.fiche .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.fiche h3 { margin: 0; font-size: 16px; }
.fiche .sub { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.fiche .ext { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fiche .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fiche .acts a { text-decoration: none; font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 10px; border: 2px solid var(--line); color: var(--teal); }
.fiche .acts a.wa { background: #25d366; border-color: #25d366; color: #fff; }
.fiche .acts a.call { border-color: var(--lagoon); }
.fiche .edit { display: grid; grid-template-columns: 180px 1fr; gap: 8px; }
.fiche .edit select, .fiche .edit input { min-height: 40px; font-size: 14px; padding: 6px 10px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef3f3; color: var(--teal); white-space: nowrap; }
.tag.todo { background: #fff2d9; color: #8a5400; }
.tag.ok { background: #dcf3e4; color: #17673a; }
.tag.no { background: #f6e3df; color: #8a2a22; }
.more { margin: 12px auto 0; display: block; }
.empty { color: var(--muted); text-align: center; padding: 20px; }

/* Derniers passages */
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.runs li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.runs li button { background: none; border: 0; color: var(--teal); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .fiche .edit { grid-template-columns: 1fr; }
  .tile b { font-size: 26px; }
  .hello h1 { font-size: 24px; }
  .top-links .link:first-child { display: none; }
}
