/* The Continental — administration
   Palette extraite de la maquette : bleu nuit, corail, lavande. */
:root {
  --navy: #181D40;
  --navy-2: #222447;
  --navy-3: #2E3266;
  --coral: #F25462;
  --coral-deep: #D93C4B;
  --coral-soft: #FB8094;
  --coral-tint: #FDE8EB;
  --lav: #EAEBF8;
  --lav-2: #D0D0EA;
  --paper: #F5F7FC;
  --white: #fff;
  --ink: #181D40;
  --muted: #666C90;
  --line: #DEDFF1;
  --ok: #1F8A69;
  --ok-tint: #DAF2E9;
  --warn: #A96A0B;
  --warn-tint: #FBEED2;
  --info: #3B4BB5;
  --info-tint: #E3E6FA;
  --r: 22px;
  --r-sm: 14px;
  --shadow: 0 10px 30px rgba(24, 29, 64, .09);
  --font-display: 'Outfit', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--lav); color: var(--ink);
  font: 400 14px/1.55 var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
p { margin: 0 0 8px; }
a { color: var(--coral-deep); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------- connexion ---------- */
#login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(242, 84, 98, .35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(251, 128, 148, .22), transparent 55%),
    var(--navy);
}
.login-card {
  width: min(420px, 100%); background: var(--white); border-radius: 32px; padding: 36px 34px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-sub { color: var(--muted); margin: 6px 0 22px; }

/* ---------- marque ---------- */
.brand { display: flex; align-items: center; gap: 11px; font: 700 19px var(--font-display); color: #fff; letter-spacing: -.01em; }
.brand.big { color: var(--navy); font-size: 25px; }
.mark {
  width: 30px; height: 30px; border-radius: 10px; flex: none; position: relative;
  background: var(--coral);
}
.mark::after { /* un C ouvert, découpé dans le carré */
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  border: 3.5px solid #fff; border-right-color: transparent; transform: rotate(-20deg);
}

/* ---------- structure ---------- */
#app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--navy); color: #fff; padding: 26px 16px 18px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
}
.side .brand { padding: 0 10px 22px; }
#nav { flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-group > h5 {
  font: 600 11px var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: #8E94BF; margin: 0 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 99px; color: #D6D8EE; text-decoration: none;
  font-weight: 500; position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.on { background: var(--navy-3); color: #fff; }
.nav-item.on::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 5px; border-radius: 0 5px 5px 0; background: var(--coral); }
.nav-item .count {
  margin-left: auto; background: var(--coral); color: #fff; font: 700 11px var(--font-display);
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
}
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px 10px 0; display: grid; gap: 10px; }
.who { font-size: 13px; color: #B9BCDC; word-break: break-all; }
.who b { display: block; color: #fff; font-family: var(--font-display); font-size: 15px; }

.main { min-width: 0; }
.band {
  background: var(--navy); color: #fff; padding: 34px 44px 92px; border-radius: 0 0 60px 60px; position: relative; overflow: hidden;
}
.band::after { /* reflet corail discret, comme le halo de la maquette */
  content: ''; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 84, 98, .40), transparent 68%); pointer-events: none;
}
.band-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.band h1 { font-size: 32px; font-weight: 700; }
.band-sub { color: #AEB2D6; margin: 4px 0 0; max-width: 62ch; }
.band-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pills {
  display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 22px; background: rgba(255, 255, 255, .09); padding: 5px; border-radius: 99px;
  position: relative; z-index: 1;
}
.pills:empty { display: none; }
.pills a {
  color: #D0D3EE; text-decoration: none; padding: 8px 18px; border-radius: 99px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.pills a:hover { color: #fff; }
.pills a.on { background: #fff; color: var(--navy); }
.pills .n { font: 700 11px var(--font-display); background: var(--coral); color: #fff; border-radius: 99px; padding: 1px 7px; }

.content { margin: -60px 44px 48px; position: relative; z-index: 2; display: grid; gap: 20px; }
.card { background: var(--white); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- chiffres clés ---------- */
.stat { background: var(--white); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.stat-l { font: 600 12px var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-v { font: 700 30px/1.15 var(--font-display); margin: 6px 0 2px; }
.stat-s { color: var(--muted); font-size: 12.5px; }
.stat.hot { background: var(--coral); color: #fff; }
.stat.hot .stat-l, .stat.hot .stat-s { color: rgba(255, 255, 255, .85); }
.stat.dark { background: var(--navy-2); color: #fff; }
.stat.dark .stat-l, .stat.dark .stat-s { color: #B9BCDC; }

.todo { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.todo:hover { background: var(--paper); }
.todo .n { font: 700 13px var(--font-display); min-width: 28px; text-align: center; padding: 3px 9px; border-radius: 99px; background: var(--lav); }
.todo .n.hot { background: var(--coral); color: #fff; }
.bar { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; margin: 9px 0; }
.bar i { display: block; height: 10px; border-radius: 99px; background: var(--lav); overflow: hidden; }
.bar i b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--coral), var(--coral-soft)); }

/* ---------- tableaux ---------- */
.tblwrap { overflow-x: auto; border-radius: var(--r-sm); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  text-align: left; font: 600 11.5px var(--font-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  padding: 10px 14px; background: var(--paper); white-space: nowrap;
}
.tbl th:first-child { border-radius: 12px 0 0 12px; }
.tbl th:last-child { border-radius: 0 12px 12px 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFAFF; }
.tbl td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty::before { content: '✦'; display: block; font-size: 22px; color: var(--coral-soft); margin-bottom: 6px; }

/* ---------- pastilles & boutons ---------- */
.b { display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--lav); color: var(--navy); }
.b.ok { background: var(--ok-tint); color: var(--ok); }
.b.warn { background: var(--warn-tint); color: var(--warn); }
.b.bad { background: var(--coral-tint); color: var(--coral-deep); }
.b.info { background: var(--info-tint); color: var(--info); }
.b.mute { background: var(--lav); color: var(--muted); }

.btn {
  font: 600 13.5px var(--font-body); border: 0; border-radius: 99px; padding: 9px 18px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; text-decoration: none; background: var(--lav); color: var(--navy); transition: transform .08s, background .15s;
}
.btn:hover { background: var(--lav-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .pills a:focus-visible, .nav-item:focus-visible {
  outline: 3px solid rgba(242, 84, 98, .45); outline-offset: 2px;
}
.btn.primary { background: var(--coral); color: #fff; }
.btn.primary:hover { background: var(--coral-deep); }
.btn.dark { background: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-3); }
.btn.danger { background: var(--coral-tint); color: var(--coral-deep); }
.btn.danger:hover { background: #FAD2D8; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lav-2); }
.btn.ghost:hover { background: var(--paper); }
.btn.ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .1); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- formulaires ---------- */
.field { display: grid; gap: 5px; margin-bottom: 13px; }
.field > span { font-weight: 600; font-size: 12.5px; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea {
  font: 400 14px var(--font-body); color: var(--ink); border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: 10px 13px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--coral); outline: none; }
textarea { min-height: 84px; resize: vertical; }
textarea.json { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 96px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex: none; accent-color: var(--coral); }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; font-weight: 500; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 240px; }
.form-error { color: var(--coral-deep); min-height: 20px; font-weight: 500; }
.up { display: flex; gap: 8px; }
.up label.btn { flex: none; }

/* ---------- cartes de traitement ---------- */
.item { border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; background: var(--white); }
.item-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; }
.item-head b { font: 600 16px var(--font-display); }
.path { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.path span { background: var(--lav); border-radius: 99px; padding: 2px 11px; font-size: 12.5px; font-weight: 500; }
.path span:nth-last-child(-n+2) { background: var(--coral-tint); color: var(--coral-deep); }
.item ol, .item ul { margin: 0; padding-left: 20px; }
.item li { margin: 3px 0; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }
.quote { border-left: 4px solid var(--coral-soft); padding: 4px 0 4px 14px; color: #3B4070; margin: 8px 0 12px; white-space: pre-wrap; }
.thread { display: grid; gap: 8px; margin: 10px 0; }
.thread .msg { border-radius: 16px; padding: 10px 14px; max-width: 80%; background: var(--lav); }
.thread .msg.employer { background: var(--info-tint); justify-self: start; }
.thread .msg.candidate { background: var(--coral-tint); justify-self: end; }
.thread .msg b { font-weight: 600; }
.score-bars { display: grid; gap: 6px; }
.score-bars .bar { grid-template-columns: 110px 1fr 46px; margin: 2px 0; }

/* ---------- fenêtres ---------- */
dialog {
  border: 0; border-radius: 28px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--white);
  box-shadow: 0 40px 90px rgba(24, 29, 64, .4); color: var(--ink);
}
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(24, 29, 64, .55); backdrop-filter: blur(3px); }
.dlg { padding: 28px 30px 24px; overflow-y: auto; max-height: calc(100vh - 48px); }
.dlg h3 { font-size: 21px; margin-bottom: 6px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

#toasts { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 10px; z-index: 50; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 16px; box-shadow: var(--shadow); font-weight: 500; max-width: 380px;
  border-left: 6px solid var(--ok); animation: pop .22s ease-out;
}
.toast.err { border-left-color: var(--coral); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.menu-btn { display: none; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- petits écrans ---------- */
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(24, 29, 64, .5); }
  .menu-btn { display: grid; place-items: center; position: fixed; top: 14px; right: 14px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: 20px; }
  .band { padding: 78px 22px 84px; border-radius: 0 0 36px 36px; }
  .band-top { flex-direction: column; gap: 14px; }
  .band-actions .btn { padding: 9px 16px; }
  .content { margin: -56px 16px 32px; }
  .band h1 { font-size: 26px; }
}
@media (max-width: 560px) { .grid4 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.viewer { display: block; max-width: 100%; max-height: 68vh; margin: 14px auto 0; border-radius: var(--r-sm); background: var(--paper); }
.viewer-frame { display: block; width: 100%; height: 68vh; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.viewer-audio { display: block; width: 100%; margin-top: 16px; }

.qr { display: grid; place-items: center; margin: 14px 0 8px; }
.qr svg { width: 208px; height: 208px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.codes code { font: 600 15px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; text-align: center; letter-spacing: .04em; user-select: all; }
