/* ============================================================
   Tessi KYC-Form — Design System
   Reconstructed faithfully from the starter-kit screenshots.
   ============================================================ */

/* Poppins est heberge avec le portail (voir poppins.css), et non appele chez
   Google : le portail tourne chez le client, et une requete vers un tiers y
   ferait fuiter l'adresse IP de chaque visiteur. */
@import url('poppins.css');

:root {
  /* Brand */
  --navy:        #1b2a4d;   /* sidebar, card headers, headings */
  --navy-700:    #233562;
  --navy-900:    #14213d;
  --accent:      #e6007e;   /* tessi magenta */
  --accent-soft: #fdeaf4;

  /* Neutrals */
  --bg:          #eef0f3;   /* app background */
  --surface:     #ffffff;
  --line:        #e3e6ea;
  --line-strong: #d2d7de;
  --ink:         #1f2734;   /* primary text */
  --ink-soft:    #5b6573;   /* secondary text */
  --ink-faint:   #939ba8;   /* placeholder / meta */

  /* Status (en_attente=gris, sollicite=bleu, en_cours=orange, soumis=vert) */
  --gray:        #6b7280;  --gray-bg:   #eef0f2;  --gray-bd:   #d6dae0;
  --blue:        #2563d6;  --blue-bg:   #e8f0fd;  --blue-bd:   #b9d2f7;
  --orange:      #c2710c;  --orange-bg: #fdf0dd;  --orange-bd: #f3d2a0;
  --green:       #2e8b4f;  --green-bg:  #e6f4ec;  --green-bd:  #b3ddc4;
  --red:         #d83a56;  --red-bg:    #fdeaee;  --red-bd:    #f6c4cd;

  --link:        #2f6bdf;

  --radius:      10px;
  --radius-sm:   7px;
  --shadow-card: 0 1px 2px rgba(20,33,61,.05), 0 1px 3px rgba(20,33,61,.06);
  --shadow-pop:  0 12px 32px rgba(20,33,61,.16);

  --sidebar-w:   56px;
  --topbar-h:    52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- App shell */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 14px; gap: 6px;
  z-index: 40;
}
.sidebar .side-toggle {
  position: absolute; top: 44px; left: calc(var(--sidebar-w) - 12px);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); color: var(--navy);
  border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-card); z-index: 41;
}
.sidebar .nav-ico {
  width: 40px; height: 40px; border-radius: 9px;
  display: grid; place-items: center; color: #cdd5e4;
  cursor: pointer; transition: background .15s, color .15s;
}
.sidebar .nav-ico:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-ico.active { background: var(--accent); color: #fff; }
.sidebar .nav-ico svg { width: 21px; height: 21px; }

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 26px;
  padding: 0 22px; z-index: 30;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand .wm {
  font-weight: 700; font-size: 21px; color: var(--navy);
  letter-spacing: -.5px; position: relative; width: max-content;
}
.brand .wm::after {
  content: ''; position: absolute; left: 1px; right: 5px; bottom: -3px;
  height: 2.5px; background: var(--accent); border-radius: 2px;
}
.brand .sub { font-size: 10.5px; color: var(--ink-soft); margin-top: 5px; font-weight: 400; }

.crumbs { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.crumbs a, .crumbs span { color: var(--ink-soft); }
.crumbs a:hover { color: var(--navy); }
.crumbs .sep { color: var(--accent); display: grid; place-items: center; }
.crumbs .sep svg { width: 14px; height: 14px; }
.crumbs .here { color: var(--navy); font-weight: 600; }
.crumbs a.root { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.topbar .burger {
  margin-left: auto; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; color: var(--accent); cursor: pointer;
}
.topbar .burger:hover { background: var(--accent-soft); }

.content {
  margin-left: var(--sidebar-w);
  padding: 30px 34px 60px;
  padding-top: calc(var(--topbar-h) + 26px);
  max-width: 1500px;
}

/* ---------------------------------------------------------- Typography */
.page-title { font-size: 27px; font-weight: 600; color: var(--navy); margin: 0 0 22px; letter-spacing: -.3px; }
.section-title { font-size: 19px; font-weight: 600; color: var(--navy); margin: 0 0 12px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; color: var(--ink-faint); }
.muted { color: var(--ink-soft); }
.meta { color: var(--ink-faint); font-size: 13px; }

/* ---------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: none; line-height: 1;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: #f4f6f9; }
.btn-outline .plus { color: var(--accent); display: inline-flex; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: #f4f6f9; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.94); }
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--red-bd); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-link { color: var(--link); padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; background: none; }

/* ---------------------------------------------------------- Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 22px 24px; }

/* counter card: navy header + white number body */
.counter {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.counter .head { background: var(--navy); color: #fff; padding: 15px 20px; font-size: 17px; font-weight: 500; }
.counter .body { padding: 18px 20px 22px; }
.counter .num { font-size: 38px; font-weight: 600; color: var(--ink); line-height: 1; }

/* colored stat card (contacts counters) */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 16px 18px; cursor: pointer; position: relative;
  border-left: 4px solid var(--c, var(--gray));
  transition: box-shadow .15s, transform .1s;
}
.stat:hover { box-shadow: var(--shadow-pop); }
.stat.active { outline: 2px solid var(--c); outline-offset: -1px; }
.stat .label { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.stat .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.stat .num { font-size: 30px; font-weight: 600; color: var(--ink); margin-top: 8px; line-height: 1; }
.stat--gray   { --c: var(--gray); }
.stat--blue   { --c: var(--blue); }
.stat--orange { --c: var(--orange); }
.stat--green  { --c: var(--green); }

/* ---------------------------------------------------------- Tables */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 16px 18px; flex-wrap: wrap; }
.search {
  position: relative; flex: 0 1 320px; min-width: 200px;
}
.search input {
  width: 100%; padding: 9px 12px 9px 36px; border-radius: 8px;
  border: 1px solid var(--line-strong); font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
}
.search input:focus { outline: none; border-color: var(--navy); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-faint); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 13px; font-weight: 700; color: var(--navy);
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line); background: #fbfcfd;
}
.tbl td { padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .num-col { text-align: right; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; gap: 14px; flex-wrap: wrap; }
.pager .rows { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 13px; }
.pager .count { color: var(--ink-soft); font-size: 13px; flex: 1; text-align: center; min-width: 120px; }
.pager .nav { display: flex; align-items: center; gap: 7px; }
.pg-btn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.pg-btn:hover { background: #f4f6f9; }
.pg-num { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--navy); background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--navy); }

.mini-select {
  position: relative; display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface);
  padding: 5px 9px; font-size: 13px; gap: 8px; cursor: pointer; color: var(--ink);
}
.mini-select svg { width: 13px; height: 13px; color: var(--ink-soft); }

/* ---------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid transparent; line-height: 1.5; white-space: nowrap;
}
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--gray   { color: var(--gray);   background: var(--gray-bg);   border-color: var(--gray-bd); }
.badge--blue   { color: var(--blue);   background: var(--blue-bg);   border-color: var(--blue-bd); }
.badge--orange { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-bd); }
.badge--green  { color: var(--green);  background: var(--green-bg);  border-color: var(--green-bd); }
.badge--red    { color: var(--red);    background: var(--red-bg);    border-color: var(--red-bd); }
.badge--navy   { color: var(--navy);   background: #eaeef6;          border-color: #cdd6e6; }

/* tiny type badge for fields editor */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; font-family: 'SFMono-Regular', ui-monospace, monospace; background: #eef1f5; color: var(--ink-soft); border: 1px solid var(--line); }

/* ---------------------------------------------------------- Forms */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }
.input, .select, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,42,77,.08); }
textarea.input { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6573' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; padding-right: 34px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .18s; flex: none; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* checkbox / radio */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }

/* ---------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab {
  padding: 12px 18px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------- Alerts */
.alert { display: flex; gap: 13px; padding: 15px 17px; border-radius: var(--radius); border: 1px solid; font-size: 14px; align-items: flex-start; }
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert .a-body { flex: 1; }
.alert .a-title { font-weight: 600; margin-bottom: 3px; }
.alert--warning { background: #fff6e6; border-color: #f3d79a; color: #8a5a00; }
.alert--info    { background: var(--blue-bg); border-color: var(--blue-bd); color: #1c4f9c; }
.alert--success { background: var(--green-bg); border-color: var(--green-bd); color: #1f6b3b; }

/* ---------------------------------------------------------- Modal */
.overlay { position: fixed; inset: 0; background: rgba(20,33,61,.45); display: none; align-items: flex-start; justify-content: center; z-index: 80; padding: 70px 20px; overflow-y: auto; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 540px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal .m-head h3 { margin: 0; font-size: 18px; color: var(--navy); font-weight: 600; }
.modal .m-body { padding: 22px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfcfd; }
.x-btn { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); border: 0; background: none; }
.x-btn:hover { background: #f0f2f5; }

/* dropzone */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-soft); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--navy); background: #fafbfc; }
.dropzone svg { width: 30px; height: 30px; color: var(--ink-faint); }

/* progress */
.progress { height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }

/* ---------------------------------------------------------- Utility */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.items-center { align-items: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb24 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 12px 20px; font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.mono { font-family: ui-monospace, 'SFMono-Regular', monospace; }
.icon-btn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.icon-btn:hover { background: #f4f6f9; color: var(--navy); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red-bd); background: var(--red-bg); }
.icon-btn svg { width: 16px; height: 16px; }

/* screen switcher (prototype nav) */
.proto-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: var(--navy); color: #fff; border: none; border-radius: 999px; padding: 11px 18px; font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 8px; }
.proto-fab:hover { background: var(--navy-700); }
.proto-panel { position: fixed; right: 18px; bottom: 64px; z-index: 60; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 8px; display: none; }
.proto-panel.open { display: block; }
.proto-panel .ph { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 4px; }
.proto-panel a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--ink); font-size: 13.5px; }
.proto-panel a:hover { background: #f4f6f9; text-decoration: none; }
.proto-panel a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

@media (max-width: 880px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .row2 { grid-template-columns: 1fr; }
  .content { padding-left: 18px; padding-right: 18px; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dt { margin-top: 10px; }
}
