@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f3f0;
  --surface: #ebe9e4;
  --card: #ffffff;
  --border: #d8d3c9;
  --text: #0d1b2a;
  --muted: #6b7280;
  --accent: #b8966c;
  --accent-d: #9a7a52;
  --ok: #3d6b4f;
  --ko: #a84845;
  --warn: #8a5a00;
  --radius: 12px;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(820px 380px at 8% -10%, #ebe6dc 0%, transparent 55%),
    radial-gradient(640px 320px at 100% 0%, #e8eef4 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
}
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 12px 40px; }
.wrap:has(.site-hero) { max-width: 820px; }
body.page-fiche .wrap {
  max-width: 1240px;
  padding-left: clamp(12px, 2vw, 24px);
  padding-right: clamp(12px, 2vw, 24px);
}
body.page-fiche .top {
  margin-bottom: 16px;
}
body.page-fiche .brand .sub {
  max-width: min(42vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Site public —— */
body.page-site .wrap {
  max-width: 920px;
  padding-top: 12px;
  padding-bottom: 28px;
}
body.page-site .top {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 211, 201, 0.7);
}
body.page-site .brand .sub { display: none; }
body.page-site .brand-logo { height: 28px; opacity: 0.92; }

.site-hero {
  padding: clamp(48px, 10vh, 96px) 8px clamp(52px, 9vh, 88px);
  text-align: center;
  position: relative;
}
.site-hero::before {
  content: "";
  position: absolute;
  inset: 0 -40px auto;
  height: min(58vh, 480px);
  background:
    radial-gradient(ellipse 90% 65% at 50% -10%, rgba(184, 150, 108, 0.16) 0%, transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.site-hero > * { position: relative; z-index: 1; }
.site-eyebrow {
  margin: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-d);
  font-family: var(--mono);
}
.site-hero-logo {
  height: clamp(56px, 8vw, 76px);
  width: auto;
  max-width: min(100%, 360px);
  object-fit: contain;
  margin: 0 auto 26px;
  display: block;
}
.site-hero-title {
  margin: 0 auto 16px;
  max-width: 14ch;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}
.site-hero-lead {
  margin: 0 auto 28px;
  max-width: 36rem;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #5a6573;
}
.site-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.site-band {
  padding: clamp(28px, 5vw, 40px) 4px;
  border-top: 1px solid var(--border);
}
.site-h2 {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.site-prose {
  margin: 0;
  max-width: 38rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #4a5563;
}
.site-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}
.site-approach {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}
.site-approach article {
  padding: 18px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.site-approach h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 650;
}
.site-approach p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.site-contact .site-mail {
  display: inline-block;
  margin-top: 10px;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--accent-d);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-contact .site-mail:hover {
  color: var(--accent);
  text-decoration: underline;
}
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 8px;
  padding: 20px 4px 4px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}
.site-foot span:first-child {
  color: var(--text);
  font-weight: 550;
}
@media (max-width: 740px) {
  .site-grid-2,
  .site-approach { grid-template-columns: 1fr; }
  .site-hero-title { max-width: 16ch; }
}
.site-section { margin-top: 8px; }
.dns-steps code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}


.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
}
.brand .sub {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.navlink { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.navlink:hover { color: var(--accent); }

.admin-menu {
  position: relative;
}
.admin-menu-btn {
  cursor: pointer;
  font: inherit;
}
.admin-menu-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-d);
}
.admin-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(13, 27, 42, 0.12);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-menu-panel[hidden] { display: none; }
.admin-menu-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.admin-menu-panel a:hover {
  background: var(--surface);
  text-decoration: none;
  color: var(--accent-d);
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.stat b { color: var(--text); font-weight: 650; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.offer {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: inherit;
  box-shadow: 0 1px 0 rgba(44, 36, 22, 0.03);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.offer:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(44, 36, 22, 0.08);
}
.offer h2 { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.3; }
.offer .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }
.offer .nums { display: flex; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.offer .nums b { color: var(--accent); font-family: var(--mono); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  align-items: center;
}
.toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
input[type="search"], input[type="text"], input[type="password"],
input[type="datetime-local"], input[type="date"], input[type="time"], select, textarea {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  line-height: 1.25;
  box-sizing: border-box;
}
input[type="search"] { min-width: 220px; flex: 1; }
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  margin-left: 4px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.9;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
  min-height: 42px;
}
textarea { width: 100%; min-height: 110px; resize: vertical; }
label { color: var(--muted); font-size: 0.9rem; }

button, .btn {
  background: var(--text);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 650;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
button:hover, .btn:hover { filter: brightness(0.97); text-decoration: none; }
button.icon, .btn.icon {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}
button.icon:hover, .btn.icon:hover { border-color: var(--accent); color: var(--accent); }
.table-wrap {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

/* Liste candidats : lignes basses, colonnes secondaires au plus juste */
table.cand-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}
table.cand-table th,
table.cand-table td {
  padding: 5px 8px;
  font-size: 0.86rem;
  line-height: 1.25;
}
table.cand-table th {
  font-size: 0.68rem;
  padding: 6px 8px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  position: sticky;
  top: 0;
  font-family: var(--mono);
  text-align: center;
}
table.cand-table .cell-tel,
table.cand-table .cell-statut,
table.cand-table .cell-annonce,
table.cand-table .cell-cv {
  width: 1%;
  white-space: nowrap;
}
table.cand-table .cell-name {
  text-align: left;
}
table.cand-table th.cell-name {
  text-align: center;
}
table.cand-table .cell-tel,
table.cand-table .cell-statut,
table.cand-table .cell-annonce,
table.cand-table .cell-cv,
table.cand-table th.cell-tel,
table.cand-table th.cell-statut,
table.cand-table th.cell-annonce,
table.cand-table th.cell-cv {
  text-align: center;
}
table.cand-table .cell-cv {
  padding-left: 4px;
  padding-right: 6px;
}
table.cand-table .cell-statut .chip,
table.cand-table .cell-annonce .chip {
  margin: 0 auto;
}

table.cand-table .cell-name {
  width: 1%;
  max-width: 200px;
  white-space: nowrap;
}
table.cand-table .name-ellip {
  display: inline-block;
  max-width: 188px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-weight: 600;
}
table.cand-table .chip-offre {
  color: var(--accent-d);
  border-color: #d4c4a8;
  background: #f3ebe0;
  text-decoration: none;
}
table.cand-table .chip-offre:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
table.cand-table .annonce-ellip {
  display: none;
}
code.pwd {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.users-page .panel-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.users-create {
  display: flex;
  gap: 8px;
  align-items: center;
}
.users-create input {
  flex: 1;
  min-width: 0;
}
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.user-main { min-width: 0; }
.user-id {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.user-edit-dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  width: min(380px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(13, 27, 42, 0.18);
}
.user-edit-dialog::backdrop {
  background: rgba(13, 27, 42, 0.35);
}
.user-edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.user-edit-form h3 {
  margin: 0;
  font-size: 1.05rem;
}
.user-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
.user-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.user-edit-extra {
  display: flex;
  gap: 8px;
  padding: 0 20px 18px;
  border-top: 1px solid var(--border);
  margin-top: -4px;
  padding-top: 14px;
}
button.danger, .btn.danger {
  background: #b85450;
  color: #fff;
  border: 0;
}
button.danger:hover, .btn.danger:hover { filter: brightness(0.95); }
table.cand-table .chip {
  padding: 1px 6px;
  font-size: 0.7rem;
  white-space: nowrap;
}
table.cand-table .icon,
table.cand-table a.icon {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
}
table.cand-table .icon:hover,
table.cand-table a.icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
table.cand-table .icon.wa img { display: block; }
.cv-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 1px 0 rgba(13, 27, 42, 0.04);
}
.cv-ico:hover {
  text-decoration: none !important;
  border-color: var(--accent);
  background: #f7f3ec;
}
.missed-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 32px;
  height: 24px;
  padding: 0 7px;
  margin-left: 4px;
  border-radius: 8px;
  border: 1px solid #e5d3a8;
  background: #f8f1df;
  color: #8a5a00;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.btn-sm { padding: 4px 9px; font-size: 0.8rem; font-weight: 600; }

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  position: sticky;
  top: 0;
  font-family: var(--mono);
}
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #faf7f1; }
.no-row-nav { cursor: default; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.list-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.list-total {
  font-size: 0.9rem;
  color: var(--muted);
}
.list-total b { color: var(--text); }

.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none !important;
}
a.chip:hover { color: var(--accent-d); border-color: var(--accent); }
.chip.ok { color: var(--ok); border-color: #c5d9cb; background: #eef6f0; }
.chip.bad { color: var(--ko); border-color: #e5c4c2; background: #f8eceb; }
.chip.warn { color: var(--warn); border-color: #e5d3a8; background: #f8f1df; }

.chip-statut.statut-a_traiter,
.statut-btn.statut-a_traiter {
  color: #1d4f91;
  border-color: #b7cce8;
  background: #e8f0fa;
}
.chip-statut.statut-traite,
.statut-btn.statut-traite {
  color: #2f6b45;
  border-color: #b9d8c4;
  background: #e7f5ec;
}
.chip-statut.statut-a_rappeler,
.statut-btn.statut-a_rappeler {
  color: #8a5a00;
  border-color: #e5d3a8;
  background: #f8f1df;
}
.chip-statut.statut-blacklist,
.statut-btn.statut-blacklist {
  color: #8f3431;
  border-color: #e5c4c2;
  background: #f8eceb;
}

.statut-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.statut-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.2;
}
.statut-btn:hover { filter: brightness(0.98); }
.statut-btn.is-on {
  box-shadow: inset 0 0 0 1px currentColor;
  font-weight: 700;
}

.logs-panel { margin-top: 16px; padding-top: 14px; padding-bottom: 14px; }
.logs-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.logs-toggle:hover { color: var(--accent-d); }
.logs-toggle-hint {
  font-size: 0.8rem;
  font-weight: 500;
}
.logs-body { margin-top: 14px; }
.user-last-seen {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}
.user-last-seen b {
  color: var(--text);
  font-weight: 650;
}
.logs-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: visible;
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.logs-table th,
.logs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.logs-table th {
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.logs-table tr:last-child td { border-bottom: 0; }
.log-ua {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.panel h1 { margin: 0 0 6px; font-size: 1.45rem; }
.panel .muted, .muted { color: var(--muted); }

.cand-head {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-bottom: 4px;
}
.cand-head-text { min-width: 0; flex: 1; }
.cand-head-text h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cand-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.cand-ft { color: var(--muted); }

.photo-slot {
  flex: 0 0 auto;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.photo-drop {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px solid #d5cfc4;
  background: #f3efe8 !important;
  background-image: none !important;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  user-select: none;
}
.photo-drop:hover,
.photo-drop:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px rgba(184, 150, 108, 0.16);
  transform: translateY(-1px);
}
.photo-drop.dragover {
  border-color: var(--accent-d);
  box-shadow: 0 0 0 5px rgba(184, 150, 108, 0.22);
}
.photo-drop.busy { opacity: 0.55; pointer-events: none; }
.photo-drop.has-photo {
  border-color: #cfc8bc;
  background: #1a2330 !important;
  box-shadow: 0 2px 10px rgba(13, 27, 42, 0.12);
}
.photo-drop.has-photo:hover,
.photo-drop.has-photo:focus-visible {
  border-color: var(--accent);
}
.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview:not([src]),
.photo-preview[src=""] {
  display: none !important;
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 8px;
  text-align: center;
  color: var(--muted);
  background: transparent;
}
.photo-placeholder[hidden] { display: none !important; }
.photo-icon {
  display: block;
  opacity: 0.55;
  flex: 0 0 auto;
}
.photo-missing-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  letter-spacing: 0.02em;
}
.photo-drop:hover .photo-missing-label,
.photo-drop:hover .photo-icon {
  color: var(--accent-d);
  opacity: 1;
}
.photo-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 42, 0.55);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.photo-veil-label {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.photo-drop:hover .photo-veil,
.photo-drop:focus-visible .photo-veil,
.photo-drop.dragover .photo-veil {
  opacity: 1;
}
.photo-drop:not(.has-photo).dragover .photo-veil {
  background: rgba(154, 122, 82, 0.72);
}
.photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: rgba(13, 27, 42, 0.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.photo-drop.has-photo:hover .photo-remove,
.photo-drop.has-photo:focus-within .photo-remove,
.photo-remove:focus-visible {
  opacity: 1;
}
.photo-remove:hover { background: rgba(168, 72, 69, 0.95); }
.photo-remove[hidden] { display: none; }
.photo-status {
  font-size: 0.68rem;
  color: var(--muted);
  min-height: 0.95em;
  line-height: 1.2;
  text-align: center;
  width: 100%;
}
.photo-status.bad { color: var(--ko); }

/* Fiche 2 colonnes : identité + suivi | activité (sticky) */
.fiche-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.18fr);
  grid-template-areas: "side activity";
  gap: 18px;
  align-items: start;
}
.fiche-activity {
  grid-area: activity;
  min-width: 0;
}
.fiche-side {
  grid-area: side;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fiche-side > .panel { margin-bottom: 0; }
.identity-panel { padding: 16px 18px; }
.motivation-panel .panel-title,
.suivi-block .panel-title,
.activity-head .panel-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 650;
}
.activity-head .panel-title { margin: 0; }
.motivation-body {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.92rem;
  color: var(--text);
  max-height: 220px;
  overflow: auto;
}
.activity-panel {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 760px);
  max-height: calc(100vh - 96px);
  position: sticky;
  top: 12px;
}
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 160px;
  overflow: auto;
  padding: 2px 4px 8px 0;
  margin-bottom: 0;
}
.tl-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #faf9f6;
}
.tl-mail.tl-out {
  border-color: #d4c4a8;
  background: #f7f1e6;
  align-self: flex-end;
  max-width: 92%;
}
.tl-mail.tl-in {
  border-color: #c9d2dc;
  background: #f3f6f9;
  align-self: flex-start;
  max-width: 92%;
}
.tl-rdv {
  border-style: dashed;
  text-align: center;
  background: #fff;
  align-self: center;
  max-width: 85%;
}
.tl-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.tl-kind { font-weight: 650; color: var(--accent-d); text-transform: uppercase; letter-spacing: 0.03em; }
.tl-subject { font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.tl-body {
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}
.compose-box {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
  flex: 0 0 auto;
}
.compose-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.compose-form .field { margin-bottom: 10px; }
.compose-hint { margin: 0; font-size: 0.86rem; line-height: 1.4; }
.tiny { font-size: 0.78rem; }
.email-link {
  word-break: break-all;
  font-size: 0.9rem;
}
.addr {
  line-height: 1.35;
}
.nd-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.nd-actions { margin-top: 8px; }

@media (max-width: 980px) {
  body.page-fiche .wrap { max-width: 680px; }
  .fiche-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "side" "activity";
  }
  .activity-panel {
    position: static;
    max-height: none;
    min-height: 420px;
  }
  .timeline { max-height: 42vh; }
  .kv {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px 10px;
  }
}

.kv {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 9px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.kv dt {
  color: var(--muted);
  font-size: 0.8rem;
  padding-top: 2px;
}
.kv dd { margin: 0; min-width: 0; }
.kv dd strong { font-weight: 600; }
.annonce-toggle { margin-top: 6px; }
.field-hint {
  margin-top: 3px;
  font-size: 0.75rem;
  line-height: 1.3;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.back { color: var(--muted); font-size: 0.9rem; }
.back:hover { color: var(--text); }

.phone-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.phone-num {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--accent-d);
  font-weight: 500;
  white-space: nowrap;
}
.phone-num:hover { text-decoration: underline; }

.empty { padding: 28px; text-align: center; color: var(--muted); }

.login-box { max-width: 420px; margin: 28px auto; }
.login-brand {
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.login-logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}
.login-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text);
}
.login-hint { margin: 0 0 16px; font-size: 0.9rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; }
.flash {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.flash.ok { background: #eef6f0; border-color: #c5d9cb; color: var(--ok); }
.flash.bad { background: #f8eceb; border-color: #e5c4c2; color: var(--ko); }

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
}
.counter .val {
  font-family: var(--mono);
  min-width: 1.6rem;
  text-align: center;
  font-weight: 600;
}

.annonce-toggle {
  margin-top: 8px;
}
.annonce-texte {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  max-height: none;
}

.suivi-block label { display: block; margin-bottom: 6px; }
.suivi-block .field { margin-bottom: 14px; }
.rdv-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.rdv-field { margin: 0 !important; display: block; position: relative; }
.rdv-pickers .rdv-control {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  line-height: 1.25;
  box-sizing: border-box;
  cursor: pointer;
}
.rdv-pickers input[type="date"].rdv-control {
  min-height: 42px;
  color-scheme: light;
  position: relative;
}
.rdv-pickers input[type="date"].rdv-control::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.rdv-pickers select.rdv-control {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.horaires-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.horaires-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.jour-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
}
.jour-check input { width: auto; margin: 0; }
@media (min-width: 720px) {
  .horaires-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .jours-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.rdv-counter {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.rdv-counter b { color: var(--text); }
.rdv-clear {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}
.rdv-clear input { width: auto; margin: 0; }

/* Calendrier RDV (jours fermés grisés) */
.rdv-field .flatpickr-input[readonly] {
  cursor: pointer;
  background: #fff;
}
.flatpickr-calendar {
  font-family: var(--sans);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(13, 27, 42, 0.12);
  overflow: hidden;
}
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays {
  background: #f7f5f1;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 600;
  color: var(--text);
}
.flatpickr-weekday {
  color: var(--muted);
  font-weight: 600;
}
.flatpickr-day {
  border-radius: 8px;
  color: var(--text);
}
.flatpickr-day:hover,
.flatpickr-day:focus {
  background: #efe8dc;
  border-color: #efe8dc;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--accent-d);
  border-color: var(--accent-d);
  color: #fff;
}
.flatpickr-day.today {
  border-color: var(--accent);
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay.flatpickr-disabled,
.flatpickr-day.nextMonthDay.flatpickr-disabled {
  color: #b9b3a8 !important;
  background: #f0eeea !important;
  border-color: transparent !important;
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: 0.55;
}
.flatpickr-day.prevMonthDay:not(.flatpickr-disabled),
.flatpickr-day.nextMonthDay:not(.flatpickr-disabled) {
  color: #9a948a;
}

@media (max-width: 800px) {
  .kv { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .brand-logo { height: 34px; }
  .login-logo { height: 56px; }
  .cand-head { gap: 14px; align-items: flex-start; }
  .photo-slot { width: 88px; }
  .photo-drop { width: 88px; height: 88px; border-radius: 10px; }
}
