/* App Acquisition — Waly Cash
   Palette relevée sur les visuels de Walycash Pro (Play Store) :
   violet profond #4c1979 -> #6c1ca4, violet vif #7c4cd9, nuit #161933. */

:root {
  --brand-900: #2a0f4d;
  --brand-800: #4c1979;
  --brand-700: #6c1ca4;
  --brand-600: #7c4cd9;
  --brand-400: #a98ee8;
  --brand-100: #ece3fa;
  --night:     #161933;
  --night-2:   #23264a;
  --night-3:   #33375f;

  --bg:      #f5f4f8;
  --surface: #ffffff;
  --surface-2: #faf9fc;
  --ink:   #181528;
  --ink-2: #575170;
  --ink-3: #8a84a0;
  --line:  #e6e3ee;
  --line-2:#d7d2e4;

  --ok:      #1a7a3c;  --ok-bg:     #e3f7e8;
  --urgent:  #8a5a00;  --urgent-bg: #fff1d6;  --urgent-solid: #c77d12;
  --retard:  #c0302c;  --retard-bg: #fbeaea;
  --neutre:  #575170;  --neutre-bg: #f0eef5;

  --r-card: 16px;
  --r-ctl:  12px;
  --r-chip: 8px;
  --gutter: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }

.num { font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif; font-weight: 600; letter-spacing: -0.02em; }

/* --- ossature ---------------------------------------------------------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.shell.large { max-width: 1280px; }

/* Mode « voir comme » : collé en haut de l'écran, impossible à oublier. */
.bandeau-comme {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  padding: 9px var(--gutter);
  background: #1d1a26; color: #fff;
  font-size: 12.5px; line-height: 1.35;
}
.bandeau-comme svg { flex-shrink: 0; }
.bandeau-comme span { flex-grow: 1; color: rgba(255,255,255,.82); }
.bandeau-comme b { color: #fff; }
.bandeau-comme a {
  flex-shrink: 0; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.15); color: #fff; font-weight: 600; font-size: 12px;
}
.bandeau-comme a:hover { background: rgba(255,255,255,.28); color: #fff; }
.page { padding: 22px var(--gutter) 96px; display: flex; flex-direction: column; gap: 22px; flex-grow: 1; }

.topbar { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  background: var(--brand-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px;
}
.topbar .who { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar .who b { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .who span { font-size: 12.5px; color: var(--ink-3); }

.bell { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bell .dot { position: absolute; top: 9px; right: 9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--retard); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 25px; font-weight: 600; letter-spacing: -0.02em; }
h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); font-size: 12.5px; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Sur un téléphone, un titre et son explication côte à côte se retrouvent
   chacun sur deux lignes et se lisent mal : on les empile. */
@media (max-width: 480px) {
  .section > header { flex-direction: column; align-items: flex-start; gap: 3px; }
}

/* --- cartes ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.card.flat { padding: 0; overflow: hidden; }
.card.brand { background: linear-gradient(135deg, var(--brand-800), var(--brand-600)); border: none; color: #fff; }

/* Fiche client — le contact : photo de la devanture, numéro, boutons. */
.contact .devanture { display: block; background: var(--surface-2); line-height: 0; }
.contact .devanture img { width: 100%; height: 190px; object-fit: cover; }
.contact .corps { padding: 15px 16px; display: flex; flex-direction: column; gap: 11px; }
.contact .ligne { display: flex; align-items: center; gap: 10px; min-width: 0; }
.contact .ligne svg { flex-shrink: 0; }
.contact .ligne .num { font-size: 16px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.contact .boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.contact .boutons .btn { flex: 1 1 130px; }

/* Les mêmes actions, en raccourci, sur la liste « reçus des chasseurs » :
   le commercial appelle sans avoir à ouvrir la fiche. */
.actions-contact { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.actions-contact .btn { flex: 1 1 auto; height: 38px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.card.night { background: var(--night); border: none; color: #fff; }
.card.retard { border: 1.5px solid #f0cfce; }
.card.urgent { border: 1.5px solid #f2ddb4; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
@media (max-width: 720px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tile .label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.tile.brand .label, .tile.night .label { color: var(--brand-400); }
.tile .value { margin-top: 8px; font-family: 'Space Grotesk', sans-serif; font-size: 31px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.tile .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.tile.brand .value small, .tile.night .value small { color: var(--brand-400); }
.tile .sub { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.tile.brand .sub, .tile.night .sub { color: var(--brand-400); }

/* --- listes et lignes -------------------------------------------------- */
.rows { display: flex; flex-direction: column; gap: 9px; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 68px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px;
  color: inherit;
}
a.row:hover { border-color: var(--brand-400); color: inherit; }
.row.retard { border: 1.5px solid #f0cfce; }
.row.urgent { border: 1.5px solid #f2ddb4; }
.row .main { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row .main b { font-size: 14.5px; font-weight: 600; }
.row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.stack { display: flex; flex-direction: column; }
.stack > * { border-bottom: 1px solid var(--line); }
.stack > *:last-child { border-bottom: none; }
.stack .row { border: none; border-radius: 0; }

/* --- pastilles --------------------------------------------------------- */
.chip { padding: 4px 9px; border-radius: var(--r-chip); font-size: 11.5px; font-weight: 600; white-space: nowrap; display: inline-block; }
.chip.ok     { background: var(--ok-bg);     color: var(--ok); }
.chip.urgent { background: var(--urgent-bg); color: var(--urgent); }
.chip.retard { background: var(--retard-bg); color: var(--retard); }
.chip.neutre { background: var(--neutre-bg); color: var(--neutre); }
.chip.brand  { background: var(--brand-100); color: var(--brand-700); }

.t-ok { color: var(--ok); } .t-urgent { color: var(--urgent-solid); }
.t-retard { color: var(--retard); } .t-neutre { color: var(--ink-3); }

.count { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--neutre-bg); color: var(--ink-3);
  font-family: 'Space Grotesk', sans-serif; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.count.retard { background: var(--retard); color: #fff; }
.count.urgent { background: var(--urgent-solid); color: #fff; }

/* --- contrôles --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; padding: 0 22px; border: none; border-radius: var(--r-ctl); cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600;
  background: var(--brand-700); color: #fff;
}
.btn:hover { background: var(--brand-800); color: #fff; }
.btn:disabled { background: var(--line); color: var(--ink-3); cursor: default; }
.btn.block { width: 100%; }
.btn.small { height: 44px; padding: 0 18px; font-size: 14px; }
.btn.ghost { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand-400); }
.btn.danger { background: var(--retard-bg); border: 1.5px solid #eccbc9; color: var(--retard); }
.btn.late { background: var(--retard); }
.btn.warn { background: var(--urgent-solid); }

.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; color: var(--ink); }
.icon-btn:hover { border-color: var(--brand-400); }

input[type="text"], input[type="tel"], textarea, select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 14px 15px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-600); }
textarea { min-height: 104px; resize: vertical; }
/* Dans la file des plaintes, le champ est un mot d'explication, pas un
   récit : il ne doit pas écraser la carte qu'il conclut. */
.rows textarea[rows="2"] { min-height: 62px; font-size: 13.5px; padding: 10px 12px; }

/* Les preuves d'un marchand écarté : jamais de montant, seulement le rythme
   et les dates — la GMV antérieure à l'acquisition ne s'affiche nulle part. */
.preuves {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.preuves > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.preuves .eyebrow { font-size: 10.5px; }
.preuves b { font-size: 13.5px; font-weight: 600; }

/* La réponse du manager, telle que l'auteur du signalement la lira. */
.reponse {
  margin-top: 12px; padding: 11px 13px;
  background: var(--surface-2); border-radius: 12px;
  border-left: 3px solid var(--brand-400);
  display: flex; flex-direction: column; gap: 4px;
}
.reponse .eyebrow { font-size: 10.5px; }
.reponse p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
label.field { display: flex; flex-direction: column; gap: 9px; }

.seg { display: flex; background: #eae7f1; border-radius: var(--r-ctl); padding: 4px; gap: 4px; }
.seg a, .seg button {
  flex-grow: 1; height: 44px; border: none; border-radius: 9px; cursor: pointer; background: transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
}
.seg a.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24, 21, 40, 0.10); }

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding-bottom: 11px; display: flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 14px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
/* Quatre onglets ne tiennent plus sur un écran de téléphone : ils défilent,
   mais autant resserrer pour que le dernier reste visible. */
@media (max-width: 480px) { .tabs { gap: 15px; } .tabs a { font-size: 13.5px; } }

.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 15px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-family: inherit; color: inherit; }
.choice:hover { border-color: var(--brand-400); }
.choice.on { border-color: var(--brand-600); background: #f8f5fe; }
.choice .radio { width: 19px; height: 19px; border-radius: 50%; border: 1.8px solid var(--line-2); background: #fff; flex-shrink: 0; }
.choice.on .radio { border: 6px solid var(--brand-600); }
.choice input { display: none; }

/* --- jauges ------------------------------------------------------------ */
.bar { height: 8px; border-radius: 4px; background: #eae7f1; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-600); }
.bar > i.ok { background: var(--ok); }
.bar > i.urgent { background: var(--urgent-solid); }
.bar > i.retard { background: var(--retard); }

.split { display: flex; height: 9px; border-radius: 5px; overflow: hidden; gap: 2px; }
.split > i { display: block; }

/* --- timeline ---------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; }
.step { display: flex; gap: 13px; }
.step .rail { display: flex; flex-direction: column; align-items: center; width: 26px; flex-shrink: 0; }
.step .bullet { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--brand-700); color: #fff; flex-shrink: 0; }
.step .bullet.todo { background: #fff; border: 2px solid var(--line-2); }
.step .bullet.late { background: var(--retard); }
.step .line { width: 2px; flex-grow: 1; background: var(--line-2); }
.step .line.done { background: var(--brand-700); }
.step .body { flex-grow: 1; padding-bottom: 20px; display: flex; flex-direction: column; gap: 3px; }
.step:last-child .body { padding-bottom: 0; }
.step .body b { font-size: 14.5px; font-weight: 600; }

/* --- barre de navigation ---------------------------------------------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; max-width: 560px; margin: 0 auto;
}
.nav a { flex-grow: 1; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 500; border-radius: 10px; }
.nav a.on { color: var(--brand-700); font-weight: 600; }
.nav a:hover { background: var(--surface-2); }

/* --- alerte ------------------------------------------------------------ */
.alert { border-radius: var(--r-card); padding: 15px 16px; display: flex; align-items: center; gap: 13px; }
.alert.retard { background: var(--retard-bg); border: 1px solid #f0cfce; color: var(--retard); }
.alert.urgent { background: var(--urgent-bg); border: 1px solid #f2ddb4; color: var(--urgent); }
.alert.ok     { background: var(--ok-bg);     border: 1px solid #c9ecd3; color: var(--ok); }
.alert.info   { background: var(--brand-100); border: 1px solid #ddd0f3; color: var(--brand-800); }
.alert .grow { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.alert b { font-size: 14.5px; font-weight: 600; }
.alert small { font-size: 12.5px; }

/* --- tableau (desktop) -------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
tbody td { padding: 13px 14px; border-bottom: 1px solid #f2f0f7; }
tbody tr:last-child td { border-bottom: none; }
td.n, th.n { text-align: right; font-family: 'Space Grotesk', sans-serif; font-weight: 600; }

/* --- connexion --------------------------------------------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; padding: 56px var(--gutter) 32px; max-width: 440px; margin: 0 auto; }
.mark { display: flex; align-items: center; gap: 11px; }
.mark .logo { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--brand-800), var(--brand-600)); color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; }
.mark b { font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.grow { flex-grow: 1; }

.otp { display: flex; gap: 9px; }
.otp input { flex-grow: 1; width: 0; height: 62px; text-align: center; padding: 0;
  font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 600; }

.prefix { display: flex; align-items: stretch; border: 1.5px solid var(--line-2); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.prefix:focus-within { border-color: var(--brand-600); }
.prefix span { display: flex; align-items: center; padding: 0 14px; background: var(--surface-2); border-right: 1px solid var(--line);
  font-family: 'Space Grotesk', sans-serif; font-weight: 500; color: var(--ink); }
.prefix input { border: none; border-radius: 0; }
.prefix input:focus { outline: none; }

.erreur { background: var(--retard-bg); border: 1px solid #f0cfce; color: var(--retard); border-radius: var(--r-ctl); padding: 13px 15px; font-size: 13.5px; }

/* --- performance -------------------------------------------------------
   Une seule teinte, du clair au foncé : les barres mesurent une quantité et
   sa part convertie, pas des catégories. Le violet clair passe sous 3:1 sur
   fond blanc — d'où la légende écrite et les tableaux juste en dessous, qui
   portent l'information sans dépendre de la couleur. */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 176px; }
.chart .col { flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart .stack { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; gap: 2px; }
.chart .stack i { display: block; width: 100%; }
.chart .stack i.acquis { background: var(--brand-800); border-radius: 0 0 4px 4px; }
.chart .stack i.reste  { background: var(--brand-400); border-radius: 4px 4px 0 0; }
.chart .stack i.acquis:only-child { border-radius: 4px; }
.chart .x { font-size: 10px; color: var(--ink-3); white-space: nowrap; height: 13px; }
.chart .v { font-size: 10.5px; color: var(--ink-2); font-weight: 600; height: 13px; }

.legende { display: flex; flex-wrap: wrap; gap: 16px; }
.legende span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.legende i { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

.entonnoir { display: flex; flex-direction: column; gap: 14px; }
.entonnoir .etape { display: flex; flex-direction: column; gap: 6px; }
.entonnoir .tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 9px; }
.entonnoir .tete b { font-size: 13.5px; }
.entonnoir .piste { height: 26px; border-radius: 6px; background: #eae7f1; overflow: hidden; }
.entonnoir .piste i { display: block; height: 100%; background: var(--brand-700); border-radius: 6px; }

/* Sélecteur qui défile au lieu de s'écraser : sept périodes ne tiennent pas
   côte à côte sur un téléphone. */
.seg.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seg.defile a { flex: 0 0 auto; padding: 0 16px; }

/* Barre de filtres : les raccourcis et les dates libres sur la même ligne,
   qui se scinde d'elle-même quand l'écran rétrécit. */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.filtres .seg { flex: 1 1 340px; min-width: 0; }
.filtres .dates {
  display: flex; align-items: center; gap: 7px; flex: 0 1 auto;
  background: #eae7f1; border-radius: var(--r-ctl); padding: 4px 8px;
}
.filtres .dates.on { background: var(--brand-100); box-shadow: inset 0 0 0 1.5px var(--brand-400); }
.filtres .dates .eyebrow { font-size: 11px; }
.filtres .dates input[type="date"] {
  height: 36px; width: auto; padding: 0 9px; font-size: 12.5px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface);
  font-family: inherit; color: var(--ink);
}
.filtres .dates .btn { height: 36px; padding: 0 13px; }
.filtres .dates .icon-btn { width: 30px; height: 30px; flex-shrink: 0; }
@media (max-width: 560px) {
  .filtres .dates { flex: 1 1 100%; gap: 5px; padding: 4px 6px; }
  .filtres .dates input[type="date"] { flex: 1 1 0; min-width: 0; padding: 0 5px; font-size: 12px; }
  .filtres .dates .btn { padding: 0 9px; }
  /* Sur téléphone la croix ne tient pas : cliquer un raccourci efface déjà
     les dates, puisque ces liens ne les transportent pas. */
  .filtres .dates .icon-btn { display: none; }
}
