/* Intranet EDP — charte du client : Josefin Sans, fond blanc, or pour mettre en évidence,
   noir en fond secondaire (menu, barre du haut). */

:root {
  --edp-gold: #b8965a;
  --edp-gold-light: #d8c4a0;
  --edp-gold-soft: #f5efe4;
  --edp-gold-text: #7d6234;      /* or lisible sur fond clair (contraste > 5:1) */
  --edp-ink: #1c1a17;
  --edp-ink-soft: #2b2824;
  --edp-text: #25221e;
  --edp-muted: #6b665e;
  --edp-line: #e6e0d6;
  --edp-bg: #ffffff;
  --edp-danger: #b3261e;
  --sidebar-width: 17rem;

  --bs-body-font-family: "Josefin Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Josefin Sans a un petit œil : un peu plus grand que 16 px pour rester lisible. */
  --bs-body-font-size: 1.0625rem;
  --bs-body-color: var(--edp-text);
  --bs-body-bg: var(--edp-bg);
  --bs-border-color: var(--edp-line);
  --bs-link-color: var(--edp-gold-text);
  --bs-link-color-rgb: 125, 98, 52;
  --bs-link-hover-color: var(--edp-ink);
  --bs-link-hover-color-rgb: 28, 26, 23;
  --bs-secondary-color: var(--edp-muted);
  --bs-focus-ring-color: rgba(184, 150, 90, .35);
}

h1, h2, h3, h4, .page-title, .auth-title, .card-title-lg, .section-title { letter-spacing: .01em; }

a { text-underline-offset: .15em; }
.text-gold { color: var(--edp-gold) !important; }
.text-muted { color: var(--edp-muted) !important; }

/* ── Boutons et formulaires ─────────────────────────────────────────────── */
.btn { border-radius: .5rem; font-weight: 600; }
.btn-primary {
  --bs-btn-color: var(--edp-ink);
  --bs-btn-bg: var(--edp-gold);
  --bs-btn-border-color: var(--edp-gold);
  --bs-btn-hover-color: var(--edp-ink);
  --bs-btn-hover-bg: #c7a86e;
  --bs-btn-hover-border-color: #c7a86e;
  --bs-btn-active-color: var(--edp-ink);
  --bs-btn-active-bg: #a88649;
  --bs-btn-active-border-color: #a88649;
  --bs-btn-disabled-color: var(--edp-ink);
  --bs-btn-disabled-bg: var(--edp-gold-light);
  --bs-btn-disabled-border-color: var(--edp-gold-light);
  --bs-btn-focus-shadow-rgb: 184, 150, 90;
}
.btn-outline-primary {
  --bs-btn-color: var(--edp-gold-text);
  --bs-btn-border-color: var(--edp-gold);
  --bs-btn-hover-color: var(--edp-ink);
  --bs-btn-hover-bg: var(--edp-gold-soft);
  --bs-btn-hover-border-color: var(--edp-gold);
  --bs-btn-active-color: var(--edp-ink);
  --bs-btn-active-bg: var(--edp-gold-light);
  --bs-btn-active-border-color: var(--edp-gold);
  --bs-btn-focus-shadow-rgb: 184, 150, 90;
}
.btn-link { --bs-btn-color: var(--edp-gold-text); --bs-btn-hover-color: var(--edp-ink); font-weight: 600; }
.btn-group .btn { min-width: 6rem; }

.form-control, .form-select { border-radius: .5rem; border-color: #d9d2c6; min-height: 2.75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--edp-gold);
  box-shadow: 0 0 0 .25rem rgba(184, 150, 90, .25);
}
.form-check-input:checked { background-color: var(--edp-gold); border-color: var(--edp-gold); }
.form-label { font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.form-text { color: var(--edp-muted); }
.required { color: var(--edp-danger); }
.form-section {
  font-size: 1.05rem; font-weight: 700; color: var(--edp-gold-text);
  border-bottom: 1px solid var(--edp-line); padding-bottom: .4rem; margin: 1rem 0 1rem;
}
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.form-card { max-width: 46rem; }
.form-card-wide { max-width: 64rem; }
.danger-zone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--edp-line);
}

/* ── Structure : barre latérale, barre du haut, contenu ─────────────────── */
.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 2000;
  background: var(--edp-gold); color: var(--edp-ink); padding: .5rem 1rem; border-radius: .5rem;
}
.skip-link:focus { left: .5rem; }

.env-banner {
  background: #fff4d6; color: #5c4712; border-bottom: 1px solid #ecd9a0;
  font-size: .85rem; padding: .4rem 1rem; text-align: center;
}

.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { width: 100%; max-width: 78rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.app-content:focus { outline: none; }

#sidebar {
  --bs-offcanvas-width: 17.5rem;
  --bs-offcanvas-bg: var(--edp-ink);
  --bs-offcanvas-color: #ece6dc;
}
#sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-body {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; padding: 1.25rem .85rem 1rem;
}

/* Logo officiel du client (app/static/img) : or sur fond sombre, noir sur fond clair. */
.sidebar-brand {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  text-decoration: none; padding: .25rem .4rem 1.25rem; margin-bottom: .5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-logo { display: block; width: 8.5rem; height: auto; }
.brand-emblem { display: block; height: 2rem; width: auto; }
.brand-sub { font-size: .72rem; color: var(--edp-gold-light); text-transform: uppercase; letter-spacing: .16em; }
.sidebar-brand-small { color: #fff; font-weight: 600; display: flex; align-items: center; gap: .6rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .75rem; min-height: 2.75rem;
  color: #cfc8bc; border-radius: .5rem; padding: .5rem .75rem; font-size: .95rem;
}
.sidebar-nav .nav-link .bi { font-size: 1.05rem; color: #a59d90; }
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(184, 150, 90, .18); color: #fff; box-shadow: inset 3px 0 0 var(--edp-gold); }
.sidebar-nav .nav-link.active .bi { color: var(--edp-gold); }
.sidebar-nav .nav-link:focus-visible { outline: 2px solid var(--edp-gold); outline-offset: 1px; }
.nav-text { flex: 1 1 auto; }
.nav-soon {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--edp-gold-light); border: 1px solid rgba(216, 196, 160, .35); border-radius: 1rem; padding: .05rem .45rem;
}
.sidebar-heading {
  margin: 1.1rem .75rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #8f877a;
}

.sidebar-user { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user-link { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; padding: .4rem; border-radius: .5rem; }
.sidebar-user-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .78rem; color: #a59d90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-sidebar { margin-top: .6rem; color: #cfc8bc; border: 1px solid rgba(255, 255, 255, .14); font-weight: 500; }
.btn-sidebar:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .24); }

.app-topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
  background: var(--edp-ink); color: #fff; padding: .5rem .75rem; min-height: 3.5rem;
}
.btn-topbar { color: #fff; font-size: 1.5rem; line-height: 1; padding: .35rem .55rem; border: 0; }
.btn-topbar:hover, .btn-topbar:focus-visible { color: var(--edp-gold); }
.topbar-brand { color: #fff; text-decoration: none; font-weight: 600; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.topbar-brand > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { color: var(--edp-gold-light); font-weight: 400; }
@media (max-width: 399.98px) { .topbar-sub { display: none; } }
.topbar-brand:hover { color: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.btn-bell {
  position: relative; color: inherit; font-size: 1.3rem; line-height: 1; padding: .45rem .55rem; border: 0;
}
.btn-bell:hover, .btn-bell:focus-visible, .btn-bell[aria-expanded="true"] { color: var(--edp-gold); }
.bell-badge {
  position: absolute; top: .1rem; right: .05rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  border-radius: 1rem; background: #d62c1f; color: #fff; font-size: .7rem; font-weight: 700;
  line-height: 1.15rem; text-align: center; box-shadow: 0 0 0 2px var(--edp-ink);
}
.notif-menu { width: min(22rem, calc(100vw - 1.5rem)); padding: .5rem; border-color: var(--edp-line); box-shadow: 0 12px 32px -12px rgba(28, 26, 23, .35); }
.notif-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--edp-muted); margin: .25rem .5rem .5rem; }
.notif-item { display: flex; gap: .6rem; align-items: flex-start; white-space: normal; border-radius: .5rem; padding: .6rem .6rem; }
.notif-item .bi { color: var(--edp-gold-text); font-size: 1.1rem; }
.notif-item:hover, .notif-item:focus { background: var(--edp-gold-soft); color: var(--edp-ink); }
.notif-empty { color: var(--edp-muted); font-size: .9rem; margin: .25rem .5rem .5rem; }
.nav-badge {
  min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 1rem; background: #d62c1f;
  color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}

@media (min-width: 768px) {
  .app-content { padding: 2rem 2rem 3rem; }
}
@media (min-width: 992px) {
  .app-sidebar {
    flex: 0 0 var(--sidebar-width); width: var(--sidebar-width);
    position: sticky; top: 0; height: 100vh; background: var(--edp-ink); color: #ece6dc;
  }
  #sidebar { height: 100%; display: flex; flex-direction: column; }
  .app-topbar {
    background: #fff; color: var(--edp-ink); border-bottom: 1px solid var(--edp-line);
    min-height: 3.25rem; padding: .35rem 2.5rem;
  }
  .bell-badge { box-shadow: 0 0 0 2px #fff; }
  .app-content { padding: 2.25rem 2.5rem 3rem; }
}

/* ── Composants ─────────────────────────────────────────────────────────── */
.card { border: 1px solid var(--edp-line); border-radius: .85rem; box-shadow: 0 1px 2px rgba(28, 26, 23, .04); }
.card-footer { background: transparent; border-top: 1px solid var(--edp-line); }
.card-soft { background: var(--edp-gold-soft); border-color: #eadfca; }
.card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-title-lg { font-size: 1.15rem; font-weight: 700; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.card-heading .card-title-lg { margin-bottom: 0; }
.section-title { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 1rem; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { font-size: 1.75rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--edp-muted); margin: .35rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 768px) { .page-title { font-size: 2rem; } }

.breadcrumb { font-size: .88rem; margin-bottom: .75rem; }

.badge { font-weight: 600; border-radius: 1rem; padding: .35em .7em; }
.badge-gold { background: var(--edp-gold-soft); color: var(--edp-gold-text); border: 1px solid #e6d7bb; }
.badge-target { background: #f1eee9; color: var(--edp-muted); }
.badge-na { background: #f1eee9; color: #5f5a52; border: 1px dashed #cfc7ba; }
.badge-role { background: #f1eee9; color: var(--edp-ink-soft); }
.badge-role-full_admin { background: var(--edp-ink); color: #fff; }
.badge-role-superadmin { background: #13309a; color: #fff; }
.badge-role-admin_bureau { background: var(--edp-gold-soft); color: var(--edp-gold-text); }
.badge-status-actif { background: #e5f3ea; color: #1f6b3a; }
.badge-status-invite { background: #fff4d6; color: #6b5213; }
.badge-status-desactive { background: #f3e3e2; color: var(--edp-danger); }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initials { background: var(--edp-gold); color: var(--edp-ink); font-weight: 700; }
.avatar-sm { width: 2rem; height: 2rem; font-size: .75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: .85rem; }
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.2rem; }
.avatar-xl { width: 5.5rem; height: 5.5rem; font-size: 1.6rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--edp-muted); }
.empty-state > .bi { font-size: 2rem; color: var(--edp-gold); }
.empty-title { font-weight: 600; color: var(--edp-text); margin: .75rem 0 .25rem; }
.empty-text { margin: 0; font-size: .92rem; }
.empty-actions { margin-top: 1rem; }

.notice {
  display: flex; gap: .85rem; align-items: flex-start; background: #fff; border: 1px solid var(--edp-line);
  border-left: 4px solid var(--edp-gold); border-radius: .75rem; padding: 1rem 1.15rem; margin: 1.5rem 0;
}
.notice > .bi { font-size: 1.25rem; color: var(--edp-gold-text); line-height: 1.3; }
.notice-warning { background: #fffaf0; border-left-color: #d9a441; }
.notice-title { font-weight: 700; margin-bottom: .25rem; }
.notice-list { margin: 0; padding-left: 1.1rem; }
.notice-list li + li { margin-top: .25rem; }
.notice-inline { display: flex; gap: .5rem; align-items: center; color: var(--edp-muted); font-size: .9rem; }

.table { --bs-table-hover-bg: #faf8f4; margin: 0; }
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--edp-muted); font-weight: 600; background: #fbfaf7; }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.user-cell { display: flex; align-items: center; gap: .75rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.filter-bar > * { flex: 1 1 11rem; }
.filter-bar > .filter-search { flex: 2 1 16rem; }
.filter-bar > .btn { flex: 0 0 auto; }

.search-bar { position: relative; display: flex; gap: .5rem; margin-bottom: 1.75rem; max-width: 46rem; }
.search-bar > .bi-search { position: absolute; left: .95rem; top: .8rem; color: var(--edp-muted); pointer-events: none; }
.search-bar .form-control { padding-left: 2.5rem; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: .55rem 0; border-top: 1px solid var(--edp-line); display: flex; align-items: center; gap: .4rem; }
.link-list li:first-child { border-top: 0; }
.result-list .list-group-item { padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; }
.result-title { font-weight: 600; color: var(--edp-text); }
.result-meta { font-size: .82rem; color: var(--edp-muted); }
.result-excerpt { font-size: .9rem; color: var(--edp-text); }

.prose { font-size: 1.02rem; line-height: 1.7; max-width: 48rem; }
.prose p:last-child { margin-bottom: 0; }

.detail-list { display: grid; gap: .9rem; margin: 1.5rem 0; }
.detail-list > div { display: grid; gap: .1rem; }
.detail-list dt { font-size: .8rem; font-weight: 600; color: var(--edp-muted); text-transform: uppercase; letter-spacing: .05em; }
.detail-list dd { margin: 0; }
@media (min-width: 768px) { .detail-list { grid-template-columns: repeat(2, 1fr); } }

.credential-box { display: grid; gap: 1rem; background: var(--edp-gold-soft); border-radius: .75rem; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.credential-box dt { font-size: .8rem; font-weight: 600; color: var(--edp-muted); }
.credential-box dd { margin: .2rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.credential-box code { font-size: 1.15rem; color: var(--edp-ink); background: #fff; padding: .25rem .6rem; border-radius: .4rem; letter-spacing: .05em; }

/* Accueil */
.welcome { margin-bottom: 1.75rem; }
.welcome-date { color: var(--edp-gold-text); font-weight: 600; margin-bottom: .25rem; }
.announcement-list { margin: 0; }
.announcement-list li + li { border-top: 1px solid var(--edp-line); }
.announcement-link { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 0; color: inherit; text-decoration: none; }
.announcement-link:hover .announcement-title { color: var(--edp-gold-text); text-decoration: underline; }
.announcement-title { font-weight: 600; }
.announcement-meta { font-size: .82rem; color: var(--edp-muted); margin: 0; }
.announcement-excerpt { font-size: .92rem; color: #4a463f; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .6rem; }
.shortcut {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center;
  padding: .85rem .5rem; border: 1px solid var(--edp-line); border-radius: .75rem;
  color: var(--edp-text); text-decoration: none; background: #fff; min-height: 5.5rem;
}
a.shortcut[href]:hover { border-color: var(--edp-gold); background: var(--edp-gold-soft); color: var(--edp-ink); }
.shortcut.is-disabled { opacity: .55; cursor: not-allowed; }
.shortcut-mark, .programme-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
  border-radius: .6rem; background: var(--edp-ink); color: var(--edp-gold);
  font-weight: 700; font-size: .9rem;
}
.shortcut-name { font-size: .85rem; font-weight: 600; }
.soon-list { margin: 0; padding-left: 1.1rem; color: #4a463f; }
.soon-list li + li { margin-top: .35rem; }

/* Programmes */
.programme-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.programme-name { font-size: 1.2rem; font-weight: 700; margin: 0; }
.programme-desc { color: #4a463f; margin: 0; }
.programme-actions { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; }
.programme-card.is-inactive { opacity: .7; border-style: dashed; }

/* Annonces */
.announcement-feed { display: grid; gap: 1rem; }
.announcement-card.is-pinned { border-color: #e2cfa9; box-shadow: inset 4px 0 0 var(--edp-gold); }
.announcement-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.announcement-card-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 .2rem; }
.announcement-card-title a { color: var(--edp-text); text-decoration: none; }
.announcement-card:hover .announcement-card-title a { color: var(--edp-gold-text); }
.pagination { --bs-pagination-color: var(--edp-gold-text); --bs-pagination-hover-color: var(--edp-ink); --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(184, 150, 90, .25); }

/* Tableau de bord */
.period-label { font-weight: 600; margin: 0 0 1rem; }
.kpi-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: .55rem; background: var(--edp-gold-soft); color: var(--edp-gold-text); }
.kpi-label { font-size: 1rem; font-weight: 700; margin: 0; }
.kpi-value { font-size: 2.2rem; font-weight: 700; color: #bdb6aa; margin: 0 0 .25rem; line-height: 1.1; }
.kpi-note { font-size: .85rem; color: var(--edp-muted); margin: .75rem 0 .35rem; }
.kpi-question { font-size: .82rem; color: #5f5a52; margin: 0; }

/* Documents */
.journey { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
@media (min-width: 768px) { .journey { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .journey { grid-template-columns: repeat(4, 1fr); } }
.journey-step { display: flex; gap: .75rem; background: #fff; border: 1px solid var(--edp-line); border-radius: .75rem; padding: .9rem 1rem; }
.journey-number { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--edp-ink); color: var(--edp-gold); font-weight: 700; font-size: .9rem; }
.journey-title { font-weight: 700; margin: 0 0 .15rem; }
.journey-text { font-size: .86rem; color: #4a463f; margin: 0; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { padding: .75rem 0; border-top: 1px solid var(--edp-line); }
.doc-list li:first-child { border-top: 0; padding-top: 0; }
.doc-name { font-weight: 600; margin-bottom: .3rem; }
.doc-star { color: var(--edp-gold-text); margin-left: .15rem; cursor: help; }
.doc-note { font-size: .82rem; color: var(--edp-muted); margin: .35rem 0 0; }

/* Modules en préparation */
.coming-card { max-width: 46rem; }
.coming-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .75rem; background: var(--edp-gold-soft); color: var(--edp-gold-text); font-size: 1.4rem; margin-bottom: 1rem; }

/* Profil */
.profile-card { max-width: 52rem; }
.profile-head { display: flex; align-items: center; gap: 1.25rem; }
.profile-name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.profile-job { color: var(--edp-muted); margin: .15rem 0 .5rem; }
.photo-field { display: flex; align-items: center; gap: 1rem; }

/* ── Pages de connexion ─────────────────────────────────────────────────── */
.auth-page {
  background: #fff;
  min-height: 100vh;
}
.auth-main { display: flex; justify-content: center; padding: 6vh 1rem 3rem; }
.auth-card {
  width: 100%; max-width: 27rem; background: #fff; border: 1px solid var(--edp-line);
  border-top: 4px solid var(--edp-gold); border-radius: 1rem; padding: 2rem 1.5rem;
  box-shadow: 0 18px 50px -30px rgba(28, 26, 23, .35);
}
.auth-card-wide { max-width: 44rem; }
@media (min-width: 576px) { .auth-card { padding: 2.25rem 2.5rem; } }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-logo { display: block; width: 9.5rem; height: auto; margin: 0 auto .75rem; }
.auth-brand-sub { color: var(--edp-gold-text); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; margin: .2rem 0 0; }
.auth-title { font-size: 1.45rem; font-weight: 700; margin-bottom: 1rem; }
.auth-lead { color: var(--edp-muted); }

/* ── Erreurs ────────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 3rem 1rem; max-width: 36rem; margin: 0 auto; }
.error-page-compact { padding: 0; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--edp-gold-light); line-height: 1; margin: 0 0 .5rem; }
.error-title { font-size: 1.5rem; font-weight: 700; }
.error-text { color: var(--edp-muted); margin-bottom: 1.5rem; }
.error-details { text-align: left; margin: 0 0 1.5rem; }
.error-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.error-details pre { background: #1e1c19; color: #f0e9dd; border-radius: .5rem; padding: 1rem; font-size: .75rem; max-height: 22rem; overflow: auto; white-space: pre-wrap; word-break: break-word; margin-top: .75rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Synchronisation des agences WHISE */
.sync-status { display: flex; gap: .5rem; align-items: baseline; font-size: .9rem; color: var(--edp-muted); margin: -.5rem 0 1.25rem; }
.sync-status .bi { color: var(--edp-gold-text); }
.review-tabs { --bs-nav-pills-link-active-bg: var(--edp-ink); --bs-nav-pills-link-active-color: #fff; --bs-nav-link-color: var(--edp-text); --bs-nav-link-hover-color: var(--edp-gold-text); gap: .25rem; }
.row-review > td { background: #fffaf0; }
.badge-review-nouvelle { background: var(--edp-gold-soft); color: var(--edp-gold-text); border: 1px solid #e6d7bb; }
.badge-review-retiree { background: #f3e3e2; color: var(--edp-danger); }
.review-note { color: #5f5a52; margin-top: .25rem; }
.review-notice p:last-of-type { margin-bottom: .5rem; }

/* Nos services : cartes horizontales sur ordinateur, empilées sur mobile */
.service-list { display: grid; gap: .85rem; }
.service-card {
  display: grid; gap: .75rem 1.25rem; padding: 1.1rem 1.25rem;
  grid-template-columns: auto 1fr; grid-template-areas: "mark main" "audience audience" "actions actions" "note note";
  align-items: center;
}
.service-card.is-inactive { opacity: .7; border-style: dashed; }
.service-mark {
  grid-area: mark; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem;
  border-radius: .7rem; background: var(--edp-ink); color: var(--edp-gold); font-weight: 700; font-size: 1rem;
}
.service-main { grid-area: main; min-width: 0; }
.service-name { font-size: 1.2rem; font-weight: 700; margin: 0 0 .15rem; display: flex; align-items: center; gap: .5rem; }
.service-desc { margin: 0; color: #4a463f; }
.service-audience { grid-area: audience; display: flex; flex-direction: column; gap: .3rem; }
.service-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--edp-muted); }
.badge-audience { background: var(--edp-gold-soft); color: var(--edp-gold-text); border: 1px solid #e6d7bb; font-weight: 600; }
.service-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.service-note { grid-area: note; margin: 0; font-size: .88rem; color: var(--edp-muted); }
.access-individual {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600;
  color: var(--edp-ink-soft); background: #f1eee9; border-radius: .5rem; padding: .45rem .75rem;
}
@media (min-width: 992px) {
  .service-card {
    grid-template-columns: auto minmax(0, 1fr) minmax(9rem, 13rem) auto;
    grid-template-areas: "mark main audience actions" "mark note note note";
  }
  .service-actions { justify-content: flex-end; }
}
.password-reveal { display: inline-block; }
.password-reveal summary { cursor: pointer; color: var(--edp-gold-text); font-weight: 600; }
.password-reveal code { display: inline-block; margin-top: .4rem; }

/* Documents : démarrage d'un document et statuts */
.doc-start { display: grid; gap: .85rem; }
.doc-start-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--edp-line);
  border-left: 4px solid var(--edp-gold); border-radius: .85rem; padding: 1rem 1.25rem;
}
.doc-start-card > div { flex: 1 1 16rem; }
.doc-start-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: .7rem;
  background: var(--edp-ink); color: var(--edp-gold); font-size: 1.3rem; }
.doc-start-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.doc-start-text { margin: 0; color: var(--edp-muted); font-size: .92rem; }
.badge-doc-brouillon { background: #f1eee9; color: var(--edp-ink-soft); }
.badge-doc-a_signer { background: #fdecec; color: #a3261c; }
.badge-doc-signe { background: #e5f3ea; color: #1f6b3a; }
.badge-doc-abandonne { background: #fff1db; color: #8a4b00; }
.badge-doc-annule, .badge-doc-abandonne { background: #eceae6; color: #6b665e; text-decoration: line-through; }
.badge-doc-archive { background: #e9eef3; color: #3d5466; }
.dept-tabs { --bs-nav-tabs-link-active-color: var(--edp-ink); --bs-nav-tabs-link-active-border-color: var(--edp-line) var(--edp-line) #fff;
  --bs-nav-link-color: var(--edp-muted); --bs-nav-link-hover-color: var(--edp-gold-text); }
.dept-tabs .nav-link { font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.dept-tabs .nav-link.active { box-shadow: inset 0 3px 0 var(--edp-gold); }
/* Rappels sur les documents */
.reminder-menu { width: 17rem; padding: .75rem; }
.reminder-quick { display: flex; flex-wrap: wrap; gap: .35rem; }
.btn-reminder-due { background: #d62c1f; border-color: #d62c1f; color: #fff; font-weight: 600; }
.btn-reminder-due:hover, .btn-reminder-due:focus { background: #b3261e; border-color: #b3261e; color: #fff; }

/* Assistant rendez-vous */
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.cal-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 0 .5rem; }
.cal-week { display: grid; gap: 1rem; }
@media (min-width: 1200px) { .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; } }
.cal-day { background: #fff; border: 1px solid var(--edp-line); border-radius: .75rem; padding: .75rem; min-width: 0; }
.cal-day.is-today { border-color: var(--edp-gold); box-shadow: inset 0 3px 0 var(--edp-gold); }
.cal-day-title { font-size: .95rem; font-weight: 700; margin: 0 0 .6rem; }
.cal-empty { color: var(--edp-muted); margin: 0; }
.cal-day .appt-card { grid-template-columns: 1fr; gap: .35rem; padding: .7rem; }
.cal-day .appt-card + .appt-card { margin-top: .5rem; }
.appt-list { display: grid; gap: .75rem; }
.appt-card {
  display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 1rem; align-items: start; background: #fff;
  border: 1px solid var(--edp-line); border-left: 4px solid var(--edp-gold-light); border-radius: .75rem; padding: 1rem 1.1rem;
}
.appt-card.appt-visite { border-left-color: var(--edp-gold); }
.appt-card.appt-estimation { border-left-color: var(--edp-ink); }
.appt-time { font-weight: 700; font-size: 1.05rem; color: var(--edp-ink); }
.appt-time span { font-weight: 400; color: var(--edp-muted); font-size: .9rem; }
.appt-main { min-width: 0; }
.appt-main p { margin: 0; }
.appt-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--edp-gold-text); font-weight: 700; }
.appt-subject { font-weight: 600; margin: .1rem 0 .25rem !important; }
.appt-meta { font-size: .88rem; color: #4a463f; overflow-wrap: anywhere; }
.appt-action { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.cal-day .appt-action { justify-content: flex-start; }
@media (max-width: 575.98px) { .appt-card { grid-template-columns: 1fr; gap: .5rem; } }
.report-block { padding: .75rem 0; border-top: 1px solid var(--edp-line); }
.report-block:first-of-type { border-top: 0; padding-top: 0; }
.report-block-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--edp-gold-text); font-weight: 700; margin-bottom: .35rem; }
.detail-list-1 { grid-template-columns: 1fr !important; }

@media print {
  .app-sidebar, .app-topbar, .env-banner, .no-print, .alert { display: none !important; }
  .app-content { padding: 0 !important; max-width: none !important; }
}


/* Home: today's appointments */
.home-appts { margin: 0; }
.home-appts li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--edp-line); }
.home-appts li:first-child { border-top: 0; padding-top: 0; }
.home-appt-time { flex: none; width: 3.4rem; font-weight: 700; color: var(--edp-ink); }
.home-appt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.home-appt-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-appt-main small { color: var(--edp-muted); }

/* Home: « Ma semaine » and pending documents */
.week-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.week-figure { background: #fff; border: 1px solid var(--edp-line); border-top: 3px solid var(--edp-gold); border-radius: .75rem; padding: .9rem 1.1rem; }
.week-figure.is-late { border-top-color: #d97706; }
.week-figure.is-done { border-top-color: #2e8b4f; }
.week-label { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--edp-gold-text); }
.week-label span { font-weight: 400; color: var(--edp-muted); text-transform: none; letter-spacing: 0; }
.week-value { margin: .2rem 0 .35rem; font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--edp-ink); }
.week-value small { font-size: 1rem; font-weight: 400; color: var(--edp-muted); }
.week-bar { height: 5px; border-radius: 999px; background: #e9e6df; overflow: hidden; }
.week-bar > div { height: 100%; background: linear-gradient(to right, #a3824a, #b8965a); }
.week-figure.is-late .week-bar > div { background: #d97706; }
.week-figure.is-done .week-bar > div { background: #2e8b4f; }
.week-note { margin: .4rem 0 0; font-size: .8rem; color: #92400e; }
@media (max-width: 575.98px) { .week-figures { grid-template-columns: 1fr; } }
.pending-alert { margin: 0 0 .6rem; padding: .5rem .75rem; border-radius: .5rem; background: #fff7ed; color: #92400e; font-size: .9rem; }
.pending-list { margin: 0; }
.pending-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--edp-line); }
.pending-list li:first-child { border-top: 0; }
.pending-list a { font-weight: 600; margin-right: auto; }
.form-section-title { margin: .5rem 0 .25rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--edp-gold-text); }

/* Job profiles */
.profile-checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.profile-check { position: relative; cursor: pointer; margin: 0; }
.profile-check input { position: absolute; opacity: 0; pointer-events: none; }
.profile-check span { display: inline-block; padding: .35rem .75rem; border: 1px solid var(--edp-line); border-radius: 999px;
  font-size: .85rem; background: #fff; color: var(--edp-ink); transition: all .15s; }
.profile-check input:checked + span { background: var(--edp-gold); border-color: var(--edp-gold); color: #fff; }
.profile-check input:focus-visible + span { outline: 2px solid var(--edp-ink); outline-offset: 2px; }
.profile-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.profile-filter .badge { text-decoration: none; font-weight: 500; }
.for-you { border-left: 4px solid var(--edp-gold); }

/* Procedure editor (Quill) and formatted text */
.editor { min-height: 320px; background: #fff; font-size: 1rem; }
.ql-toolbar.ql-snow { border-radius: .5rem .5rem 0 0; border-color: var(--edp-line); }
.ql-container.ql-snow { border-radius: 0 0 .5rem .5rem; border-color: var(--edp-line); font-family: inherit; font-size: 1rem; }
.prose h2 { font-size: 1.35rem; margin: 1.2rem 0 .5rem; }
.prose h3 { font-size: 1.12rem; margin: 1rem 0 .4rem; }
.prose img { max-width: 100%; height: auto; border-radius: .4rem; margin: .5rem 0; }
.prose blockquote { border-left: 3px solid var(--edp-gold); padding-left: .9rem; color: #4a463f; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }

/* Events */
.event-list { display: grid; gap: .6rem; }
.event-row { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--edp-line);
  border-radius: .75rem; color: inherit; text-decoration: none; }
.event-row:hover { border-color: var(--edp-gold); }
.event-list.is-past .event-row { opacity: .7; }
.event-date { flex: none; width: 3.4rem; text-align: center; text-transform: uppercase; font-size: .72rem; letter-spacing: .08em;
  color: var(--edp-gold-text); line-height: 1.1; }
.event-date strong { display: block; font-size: 1.5rem; color: var(--edp-ink); letter-spacing: 0; }
.event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.event-main small { color: var(--edp-muted); }
.event-kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--edp-gold-text); }
.event-kind-formation { color: #2e6b8b; }
/* Polls and suggestions */
.poll-option { padding: .45rem 0; border-bottom: 1px solid var(--edp-line); }
.poll-result { margin-bottom: .8rem; }
.poll-bar { height: 8px; border-radius: 999px; background: #e9e6df; overflow: hidden; margin-top: .25rem; }
.poll-bar > div { height: 100%; background: linear-gradient(to right, #a3824a, #b8965a); }
.suggestion-list li { padding: .55rem 0; border-top: 1px solid var(--edp-line); }
.suggestion-list li:first-child { border-top: 0; padding-top: 0; }
.suggestion-nouvelle { background: var(--edp-gold); color: #fff; }
.suggestion-lue { background: #e9e6df; color: var(--edp-ink); }
.suggestion-traitee { background: #2e8b4f; color: #fff; }
.suggestion-answer { border-left: 4px solid var(--edp-gold); }

.agency-photo { max-width: 260px; max-height: 160px; border-radius: .5rem; object-fit: cover; }

/* Dashboard */
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .75rem; }
.dash-nav { display: flex; align-items: center; gap: .5rem; }
.dash-tiles { margin-top: .5rem; }
.dash-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; height: 180px; align-items: end; margin: .5rem 0 .75rem; }
.dash-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.dash-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.dash-b { width: 28%; min-height: 2px; border-radius: 3px 3px 0 0; display: block; }
.dash-b-v, .dash-key.dash-b-v { background: #b8965a; }
.dash-b-e, .dash-key.dash-b-e { background: #1c1a17; }
.dash-b-m, .dash-key.dash-b-m { background: #2e8b4f; }
.dash-month { margin-top: .3rem; font-size: .72rem; color: var(--edp-muted); }
.dash-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -1px; margin: 0 .2rem 0 .6rem; }
.dash-ranking { margin: 0; padding-left: 1.4rem; }
.dash-ranking li { padding: .35rem 0; border-bottom: 1px solid var(--edp-line); }
.dash-ranking li small { color: var(--edp-muted); margin-left: .3rem; }
.dash-ranking li span { display: block; font-size: .85rem; color: #4a463f; }
@media (max-width: 575.98px) { .dash-chart { gap: .15rem; } }

/* ---------- Guide d'utilisation (/aide) ---------- */
.guide-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.guide-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.guide-search { position: relative; }
.guide-search .bi-search { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--edp-muted); }
.guide-search .form-control { padding-left: 2.25rem; }
.guide-chapters { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--edp-line); }
.guide-chapters a { display: block; padding: .3rem .75rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--edp-text); text-decoration: none; font-size: .95rem; line-height: 1.35; }
.guide-chapters a span { color: var(--edp-gold-text); }
.guide-chapters a:hover { color: var(--edp-gold-text); }
.guide-chapters a.active { border-left-color: var(--edp-gold); color: var(--edp-ink); font-weight: 600; background: var(--edp-gold-soft); }
.guide-main { min-width: 0; max-width: 56rem; }
.guide-number { color: var(--edp-gold); }
.guide-local { background: var(--edp-gold-soft); border-radius: .5rem; padding: .9rem 1.2rem; margin: 1rem 0 1.5rem; }
.guide-local p { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--edp-gold-text); margin: 0 0 .4rem; font-weight: 600; }
.guide-local ul { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }
.guide-local li { break-inside: avoid; }
.guide-prose { font-size: 1.02rem; line-height: 1.7; }
.guide-prose h2 { font-size: 1.45rem; margin: 2.4rem 0 .8rem; padding-top: .6rem; border-top: 1px solid var(--edp-line); scroll-margin-top: 1rem; }
.guide-prose h3 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; color: var(--edp-gold-text); scroll-margin-top: 1rem; }
.guide-prose img { display: block; max-width: 100%; height: auto; margin: 1rem 0 .4rem; border: 1px solid var(--edp-line); border-radius: .5rem; box-shadow: 0 6px 22px rgba(28, 26, 23, .08); }
.guide-prose img + em, .guide-prose p > em:only-child { display: block; font-size: .88rem; color: var(--edp-muted); margin-bottom: 1rem; }
.guide-prose blockquote { background: var(--edp-gold-soft); border-left: 4px solid var(--edp-gold); border-radius: .4rem; padding: .8rem 1.1rem; margin: 1.2rem 0; }
.guide-prose blockquote p:last-child { margin-bottom: 0; }
.guide-prose table { font-size: .95rem; }
.guide-prose th { background: var(--edp-gold-soft); }
.guide-prose code { color: var(--edp-ink); background: #f4f1ec; padding: .05rem .3rem; border-radius: .25rem; }
.guide-prose ul li::marker, .guide-prose ol li::marker { color: var(--edp-gold-text); }
.guide-prose li > input[type="checkbox"] { margin-right: .4rem; }
.guide-pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--edp-line); }
.guide-toc { padding-left: 0; list-style: none; margin: 0; columns: 2; column-gap: 2.5rem; }
.guide-toc > li { break-inside: avoid; margin-bottom: 1.3rem; }
.guide-toc-chapter { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--edp-ink); }
.guide-toc-intro { font-size: .88rem; color: var(--edp-muted); margin: .2rem 0 .3rem; }
.guide-toc ul { padding-left: 1.1rem; font-size: .93rem; margin: 0; }
.guide-results-title { font-size: 1.2rem; margin-bottom: 1rem; }
.guide-results { list-style: none; padding: 0; margin: 0 0 2rem; }
.guide-results li { padding: .9rem 0; border-bottom: 1px solid var(--edp-line); }
.guide-result-title { font-weight: 700; font-size: 1.08rem; }
.guide-result-where { font-size: .82rem; color: var(--edp-gold-text); margin: .1rem 0 .3rem; text-transform: uppercase; letter-spacing: .05em; }
.guide-result-excerpt { margin: 0; color: var(--edp-text); font-size: .95rem; }
.guide-results mark, .guide-result-title mark { background: #f3e2b8; padding: 0 .1rem; border-radius: .15rem; }
@media (max-width: 991.98px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav { position: static; max-height: none; }
  .guide-chapters { columns: 2; }
  .guide-toc, .guide-local ul { columns: 1; }
}

/* ---------- Rendez-vous : agendas de plusieurs collaborateurs ---------- */
.agenda-menu { width: 22rem; max-width: calc(100vw - 2rem); padding: .75rem; }
.agenda-menu-title { font-weight: 600; margin: 0 0 .5rem; font-size: .95rem; }
.agenda-menu-title small { font-weight: 400; color: var(--edp-muted); }
.agenda-options { max-height: 18rem; overflow-y: auto; margin: .5rem 0; }
.agenda-option { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem .25rem; border-radius: .3rem; cursor: pointer; line-height: 1.25; }
.agenda-option:hover { background: var(--edp-gold-soft); }
.agenda-option .form-check-input { margin-top: .15rem; flex: none; }
.agenda-option small { display: block; color: var(--edp-muted); font-size: .8rem; }
.agenda-menu-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--edp-line); padding-top: .5rem; }
.agenda-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.5rem 0 1rem; }
.agenda-tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: #f4f1ec; color: var(--edp-ink); }
.agenda-tag a { color: inherit; text-decoration: none; }
.agenda-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--agenda-color); flex: none; }
.appt-owners { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .3rem !important; }
.agenda-c0 { --agenda-color: #b8965a; }
.agenda-c1 { --agenda-color: #2f6f8f; }
.agenda-c2 { --agenda-color: #8a3b5c; }
.agenda-c3 { --agenda-color: #3f7d4e; }
.agenda-c4 { --agenda-color: #c0612b; }
.agenda-c5 { --agenda-color: #5a4fa0; }
.agenda-c6 { --agenda-color: #1c1a17; }
.agenda-c7 { --agenda-color: #9a8f2e; }

/* ---------- Accueil : niveau (groupe, bureau, agent, moi) ---------- */
.home-scope { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: -.25rem 0 1rem; }
.home-scope label { font-weight: 600; font-size: .9rem; }
.home-scope .form-select { width: auto; min-width: 15rem; }
.home-detail summary { padding: .75rem 1rem; cursor: pointer; font-weight: 600; }
.home-detail td:first-child, .home-detail th:first-child { padding-left: 1rem; }
.home-detail td:last-child, .home-detail th:last-child { padding-right: 1rem; }

/* ---------- Rendez-vous : boutons Tout / Visites / Estimations ---------- */
.cal-types .btn { display: inline-flex; align-items: center; gap: .35rem; }
.cal-type-count { font-size: .75rem; opacity: .75; }
.type-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; background: var(--rdv-color); }
.btn-primary .type-dot { box-shadow: 0 0 0 1.5px #fff; }

/* ---------- Catégories de rendez-vous (rdv_types) ---------- */
.rdv-visite { --rdv-color: #b8965a; }
.rdv-estimation { --rdv-color: #1c1a17; }
.rdv-expertise { --rdv-color: #2f6f8f; }
.rdv-mandat { --rdv-color: #3f7d4e; }
.rdv-compromis { --rdv-color: #8a3b5c; }
.rdv-autre { --rdv-color: #b9b3a9; }
.appt-card.appt-expertise { border-left-color: #2f6f8f; }
.appt-card.appt-mandat { border-left-color: #3f7d4e; }
.appt-card.appt-compromis { border-left-color: #8a3b5c; }
.rdv-badge { background: var(--rdv-color); color: #fff; font-weight: 600; }
.week-figure.rdv-cat { border-top-color: var(--rdv-color); }

/* ---------- Accueil : objectifs mensuels et annuels ---------- */
.goals { margin-bottom: 1.75rem; }
.goals-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.goals-days { font-size: .9rem; color: var(--edp-gold-text); font-weight: 600; }
.goals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: .5rem; }
.goal-card { background: #fff; border: 1px solid var(--edp-line); border-left: 5px solid var(--edp-gold); border-radius: .75rem; padding: 1rem 1.2rem; }
.goal-card.zone-green { border-left-color: #2e8b4f; }
.goal-card.zone-yellow { border-left-color: #d9a441; background: #fffbf0; }
.goal-card.zone-red { border-left-color: #b3261e; background: #fff6f5; }
.goal-value { font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin: .2rem 0 .4rem; color: var(--edp-ink); }
.goal-value small { font-size: 1.1rem; color: var(--edp-muted); font-weight: 600; }
.goal-note { font-size: .85rem; margin: .35rem 0 0; color: var(--edp-muted); }
.goal-year { font-size: .9rem; margin: .6rem 0 0; padding-top: .5rem; border-top: 1px dashed var(--edp-line); }
.goal-year span { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--edp-muted); }
.zone-yellow .goal-year { color: #8a5a00; }
.zone-red .goal-year { color: #b3261e; }
@media (max-width: 575.98px) { .goals-grid { grid-template-columns: 1fr; } }

/* ---------- Fiche utilisateur : réalisations avant l'intranet ---------- */
.history-box { border: 1px solid var(--edp-line); border-radius: .6rem; padding: .6rem .9rem; margin-bottom: 1rem; }
.history-box summary { cursor: pointer; font-weight: 600; }
.history-box[open] summary { margin-bottom: .5rem; }
.history-table input { max-width: 8rem; }

/* ---------- Badges et podiums ---------- */
.medal { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; text-decoration: none; vertical-align: middle; }
.page-title .medal { font-size: 1.5rem; margin-left: .15rem; }
.medal-1 { color: #c9a227; }
.medal-2 { color: #9aa3ad; }
.medal-3 { color: #b0723f; }
.badge-list li { display: flex; gap: .6rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--edp-line); }
.badge-list li:first-child { border-top: 0; }
.podium-title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.podium-title small { display: block; font-weight: 400; color: var(--edp-muted); font-size: .8rem; }
.podium-list { list-style: none; padding: 0; margin: 0; }
.podium-list li { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--edp-line); }
.podium-list li strong { margin-left: auto; }

/* ---------- Étoiles (attribuées par les admins) ---------- */
.user-stars { color: #c9a227; font-size: .95em; white-space: nowrap; letter-spacing: .02em; vertical-align: middle; }
.sidebar-user-name .user-stars { font-size: .85em; }

/* ---------- Agenda : chargement, rendez-vous non suivis, rendez-vous en cours ---------- */
.page-loading { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); backdrop-filter: blur(1px); }
.page-loading[hidden] { display: none; }
.page-loading-box { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--edp-line); border-radius: .75rem; padding: .9rem 1.3rem; box-shadow: 0 10px 30px rgba(28, 26, 23, .12); font-weight: 600; }
.page-loading-box .spinner-border { width: 1.4rem; height: 1.4rem; color: var(--edp-gold); }
.appt-card.appt-signature { background: linear-gradient(135deg, #fbf1d6, #f6e2a8); border-color: #d4af37; border-left-color: #b8962e;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .35); }
.appt-card.appt-signature .appt-type { color: #7a5c00; }
.cal-goto { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.cal-goto .form-control { width: auto; }
.appt-card.appt-autre { opacity: .55; filter: grayscale(1); }
.appt-card.appt-autre:hover { opacity: .85; }
.appt-card.is-now { box-shadow: 0 0 0 2px var(--edp-gold), 0 8px 24px rgba(184, 150, 90, .25); }
.appt-card.is-next { box-shadow: 0 0 0 1px var(--edp-gold-light); }
.appt-now { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #b3261e; margin-bottom: .15rem !important; }
.appt-now.appt-next { color: var(--edp-gold-text); }

/* ---------- Tableau de bord : taux de transformation ---------- */
.dash-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: -0.5rem 0 1.5rem; }
.dash-rate { background: var(--edp-gold-soft); border-radius: .75rem; padding: .8rem 1.1rem; }
@media (max-width: 575.98px) { .dash-rates { grid-template-columns: 1fr; } }

/* ---------- Congés ---------- */
.leave-balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.leave-balance { background: var(--edp-gold-soft); border-radius: .75rem; padding: .8rem 1.1rem; }
.leave-list { display: flex; flex-direction: column; gap: .6rem; }
.leave-item { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .6rem .8rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; }
.leave-item.is-past, .leave-item.leave-annule, .leave-item.leave-refuse { opacity: .6; }
.leave-item.is-same-profile { border-color: var(--edp-gold, #b8965a); }
.leave-review { background: #fff8e6; border: 1px solid #f0d58a; border-radius: .6rem; padding: .8rem 1rem; color: #1c1a17; }
.leave-comment { font-style: italic; }
.leave-decide { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.leave-decide .form-control { flex: 1 1 14rem; }
.badge.leave-badge-accepte { background: #e3f1e6; color: #1f6b35; }
.badge.leave-badge-en_attente { background: #fff1cc; color: #7a5a00; }
.badge.leave-badge-refuse { background: #fbe3e3; color: #9b1c1c; }
.badge.leave-badge-annule { background: #ececec; color: #555; }
.badge.leave-badge-same, .badge.leave-badge-derogation { background: var(--edp-gold-soft); color: #5c4a22; }
@media (max-width: 575.98px) { .leave-balances { grid-template-columns: 1fr; } .leave-item { flex-direction: column; } }

/* ---------- Tickets ---------- */
.ticket-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.ticket-filters .form-control { min-width: 14rem; }
.ticket-list { display: flex; flex-direction: column; gap: .5rem; }
.ticket-row { padding: .7rem .9rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; background: #fff; }
.ticket-row.is-unread { border-left: 4px solid var(--edp-gold); }
.ticket-row a { color: inherit; text-decoration: none; display: block; }
.ticket-number { color: var(--bs-secondary-color); margin-right: .4rem; font-variant-numeric: tabular-nums; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .25rem; }
.ticket-text { white-space: pre-line; }
.ticket-files { padding-left: 0; list-style: none; }
.badge.ticket-kind { background: var(--edp-gold-soft); color: #5c4a22; }
.badge.ticket-status-nouveau { background: #e7ecfb; color: #13309a; }
.badge.ticket-status-en_cours { background: #fff1cc; color: #7a5a00; }
.badge.ticket-status-info_demandee { background: #fde2d6; color: #8a3a12; }
.badge.ticket-status-a_valider { background: #e6f4f7; color: #11606e; }
.badge.ticket-status-resolu { background: #e3f1e6; color: #1f6b35; }
.badge.ticket-status-ferme, .badge.ticket-status-doublon { background: #ececec; color: #555; }
.badge.ticket-priority-basse, .badge.ticket-priority-normale { background: #f1f1f1; color: #444; }
.badge.ticket-priority-haute { background: #fde2d6; color: #8a3a12; }
.badge.ticket-priority-bloquante { background: #9b1c1c; color: #fff; }
.ticket-thread { display: flex; flex-direction: column; gap: .7rem; }
.ticket-message { padding: .6rem .8rem; border-radius: .6rem; background: #f7f6f3; }
.ticket-message.is-staff { background: #eef1fb; }
.ticket-message-internal { background: #f1f1f1; border: 1px dashed #bbb; }
.ticket-message-info_request { border-left: 4px solid #e07a4a; }
.ticket-message-head { margin: 0 0 .25rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.ticket-reply { border-top: 1px solid var(--bs-border-color); padding-top: 1rem; margin-top: 1rem; }
.ticket-validate { background: #e6f4f7; border-radius: .6rem; padding: .8rem 1rem; margin-top: 1rem; }
.chat-log { display: flex; flex-direction: column; gap: .5rem; max-height: 26rem; overflow-y: auto; margin-bottom: .75rem; }
.chat-log-static { max-height: 20rem; }
.chat-msg { padding: .55rem .8rem; border-radius: .8rem; white-space: pre-line; max-width: 92%; }
.chat-assistant { background: var(--edp-gold-soft); align-self: flex-start; }
.chat-user { background: #e7ecfb; align-self: flex-end; }
.chat-actions { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.chat-actions .btn { margin-left: auto; }
.chat-duplicates { background: #fff8e6; border: 1px solid #f0d58a; border-radius: .6rem; padding: .7rem .9rem; margin-bottom: .75rem; }
#ticket-form-card.is-ready { border-color: var(--edp-gold); box-shadow: 0 0 0 3px rgba(184, 150, 90, .25); }
.api-token { display: block; word-break: break-all; font-size: .95rem; padding: .5rem; background: #fff; border-radius: .4rem; }

/* Tickets: the assistant is answering */
.chat-thinking { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--edp-gold); font-weight: 600; }
.chat-thinking { max-width: 100%; }
.chat-thinking-time { white-space: nowrap; font-weight: 400; color: var(--bs-secondary-color); margin-left: auto; font-variant-numeric: tabular-nums; }
.chat-dots { display: inline-flex; gap: .25rem; }
.chat-dots span { width: .5rem; height: .5rem; border-radius: 50%; background: var(--edp-gold); animation: chat-dot 1.2s infinite ease-in-out; }
.chat-dots span:nth-child(2) { animation-delay: .2s; }
.chat-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.15); } }
.ticket-chat.is-thinking #chat-input { background: #f3f1ec; cursor: wait; }
@media (prefers-reduced-motion: reduce) { .chat-dots span { animation: none; opacity: .8; } }

/* Types de rendez-vous: WHISE → intranet mapping */
.rdv-mapping { display: flex; flex-direction: column; gap: .5rem; }
.rdv-mapping-row { display: grid; grid-template-columns: 14rem 1fr; gap: .75rem; align-items: start; padding: .4rem 0; border-top: 1px solid var(--bs-border-color); }
.rdv-mapping-row:first-child { border-top: 0; }
.rdv-mapping-cat { font-weight: 600; color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.rdv-mapping-types { display: flex; flex-wrap: wrap; gap: .35rem; }
.rdv-mapping-type { background: var(--edp-gold-soft); border-radius: 1rem; padding: .15rem .6rem; font-size: .875rem; }
.rdv-mapping-type small { color: var(--bs-secondary-color); }
.rdv-mapping-type.is-proposed { font-style: italic; background: #f1f1f1; }
@media (max-width: 575.98px) { .rdv-mapping-row { grid-template-columns: 1fr; gap: .3rem; } }

/* ---------- Help bubble (bottom right) ---------- */
.help-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; }
.help-fab { width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; background: var(--edp-gold); color: #1c1a17; font-size: 1.5rem;
  box-shadow: 0 6px 18px rgba(28, 26, 23, .25); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.help-fab:hover, .help-fab:focus-visible { transform: scale(1.06); }
.help-widget.is-open .help-fab { display: none; }
.help-panel { width: min(24rem, calc(100vw - 2rem)); height: min(34rem, calc(100vh - 6rem)); background: #fff; border-radius: 1rem;
  box-shadow: 0 12px 36px rgba(28, 26, 23, .28); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--bs-border-color); }
.help-panel[hidden] { display: none; }
.help-head { display: flex; align-items: center; gap: .25rem; padding: .7rem .9rem; background: #1c1a17; color: #fff; }
.help-head h2 { font-size: 1rem; margin: 0 auto 0 0; color: #fff; }
.help-head .bi-stars { color: var(--edp-gold); }
.help-icon { border: 0; background: transparent; color: #fff; width: 2rem; height: 2rem; border-radius: .4rem; }
.help-icon:hover, .help-icon:focus-visible { background: rgba(255, 255, 255, .15); }
.help-log { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.help-log .chat-msg { max-width: 95%; font-size: .92rem; }
.help-links { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.help-ticket-offer { margin-top: .5rem; display: inline-block; }
.help-error { background: #fbe3e3; color: #7a1c1c; }
.help-form { display: flex; gap: .4rem; padding: .6rem .8rem; border-top: 1px solid var(--bs-border-color); }
.help-form textarea { resize: none; }
.help-form textarea[readonly] { background: #f3f1ec; cursor: wait; }
.help-foot { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .8rem .6rem; font-size: .82rem; }
.help-foot a { text-decoration: none; }
@media (max-width: 575.98px) {
  .help-widget { right: .75rem; bottom: .75rem; }
  .help-widget.is-open { inset: 0; }
  .help-widget.is-open .help-panel { width: 100%; height: 100%; border-radius: 0; }
}
@media print { .help-widget { display: none; } }

.agency-links { display: flex; gap: .5rem; margin-top: .2rem; }
.agency-links a { color: var(--bs-secondary-color); }
.agency-links a:hover { color: var(--edp-gold); }

/* Types de rendez-vous: categories and mapping editing */
.rdv-categories { display: grid; grid-template-columns: 1fr auto; gap: .4rem .5rem; align-items: center; }
.rdv-category { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rdv-category .form-control-sm { flex: 1 1 12rem; }
.rdv-category .form-control-color { width: 2.4rem; height: 2rem; padding: .15rem; }
.rdv-category .rdv-category-pos { flex: 0 0 4.2rem; }
.rdv-category-new { border-top: 1px dashed var(--bs-border-color); padding-top: .75rem; }
.rdv-mapping-remove { border: 0; background: transparent; color: var(--bs-secondary-color); padding: 0 0 0 .3rem; line-height: 1; font-size: 1rem; }
.rdv-mapping-remove:hover, .rdv-mapping-remove:focus-visible { color: #9b1c1c; }
.rdv-mapping-add { display: flex; gap: .4rem; margin-top: .4rem; max-width: 34rem; }
@media (max-width: 575.98px) { .rdv-categories { grid-template-columns: 1fr; } }

/* ---------- Documents: two departments, then the documents in progress ---------- */
.dept-vente { --dept-color: #2f6f8f; --dept-soft: #e6f0f4; }
.dept-location { --dept-color: #b8965a; --dept-soft: #f5efe4; }
.dept-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.dept-switch-item { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border-radius: .9rem; border: 2px solid var(--bs-border-color);
  background: #fff; color: var(--edp-ink); text-decoration: none; }
.dept-switch-item > .bi { font-size: 1.6rem; color: var(--dept-color); }
.dept-switch-item span { display: flex; flex-direction: column; }
.dept-switch-item small { color: var(--edp-muted); }
.dept-switch-item:hover { border-color: var(--dept-color); }
.dept-switch-item.is-active { border-color: var(--dept-color); background: var(--dept-soft); box-shadow: inset 6px 0 0 var(--dept-color); }
.dept-panel { border-left: 6px solid var(--dept-color); padding-left: 1.1rem; display: flex; flex-direction: column; gap: 1.75rem; }
.dept-step { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 700; margin: 0 0 .9rem; }
.dept-step-number { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--dept-color); color: #fff; font-size: 1rem; }
.doc-catalog .doc-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.doc-table tr.is-highlighted > td { background: #fff4d6; }
.doc-table tr.is-highlighted > td:first-child { box-shadow: inset 4px 0 0 var(--edp-gold); }
.doc-table tr.is-highlighted { outline: 2px solid var(--edp-gold); outline-offset: -2px; }
.journey-box { margin-top: 2rem; }
.journey-box > summary { cursor: pointer; }
@media (max-width: 575.98px) { .dept-switch { grid-template-columns: 1fr; } .dept-panel { padding-left: .7rem; } }

/* Mandate given up by an owner (app/remote.py « Abandonner ») */
.doc-abandon { color: #8a4b00; }
.doc-abandoned { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 18px; padding: 14px 18px; background: #fff1db;
  border-left: 4px solid #8a4b00; color: #4a2a00; }
.doc-abandoned > .bi { font-size: 1.4rem; color: #8a4b00; }

/* Documents list: owner first, then type and address; actions grouped in a menu */
.doc-row-owner { font-weight: 600; color: var(--edp-ink); text-decoration: none; }
.doc-row-owner:hover { text-decoration: underline; }
.doc-row-meta { font-size: .82rem; color: var(--edp-ink-soft); }
.doc-row-sub { font-size: .8rem; margin-top: .25rem; }
.doc-row-actions { display: inline-flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: .35rem; }
.doc-actions-menu { min-width: 260px; padding: .5rem; }
.doc-actions-menu form { margin: 0; }
.doc-actions-menu .dropdown-item { border-radius: 6px; }
.doc-abandon-form { padding: .4rem .5rem; margin-top: .25rem; background: #fff8ec; border-radius: 6px; }
.badge-paper { background: #eef1f6; color: #3b4a63; font-weight: 500; margin-left: .25rem; }
.doc-table td { padding-top: .55rem; padding-bottom: .55rem; white-space: nowrap; }
.doc-table .doc-row-main { max-width: 22rem; }
.doc-table .doc-row-main > *, .doc-table .doc-row-agent { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-table .doc-row-agent { max-width: 16rem; display: table-cell; }
.doc-status-form { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.doc-status-form .form-select, .doc-status-form .form-control { width: auto; max-width: 220px; }
.paper-frame { width: 100%; height: 80vh; border: 1px solid var(--edp-line, #e3ded5); border-radius: 8px; }
.paper-image { max-width: 100%; height: auto; border: 1px solid var(--edp-line, #e3ded5); border-radius: 8px; }
.rdv-category .rdv-color-hex { flex: 0 0 6.2rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.bareme-table .bareme-until { color: var(--edp-ink-soft); white-space: nowrap; font-size: .9rem; }

/* Dashboard tables (agents, agencies): every column on a laptop screen; on a phone, one card per row */
.dash-table { font-size: .86rem; }
.dash-table thead th { white-space: normal; vertical-align: bottom; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--edp-ink-soft); line-height: 1.2; min-width: 3.6rem; }
.dash-table td { white-space: nowrap; padding-left: .35rem; padding-right: .35rem; }
.dash-table .dash-name { font-weight: 600; min-width: 9rem; max-width: 15rem; white-space: normal; }
.dash-table-wrap { overflow-x: auto; }
@media (max-width: 767.98px) {
  .dash-table thead { display: none; }
  .dash-table, .dash-table tbody, .dash-table tr, .dash-table th, .dash-table td { display: block; width: 100%; max-width: none; }
  .dash-table tr { padding: .6rem .8rem; border-bottom: 1px solid var(--bs-border-color); }
  .dash-table tbody td { display: flex; justify-content: space-between; border: 0; padding: .1rem 0; }
  .dash-table tbody td::before { content: attr(data-label); color: var(--edp-ink-soft); }
  .dash-table .dash-name { border: 0; padding: 0 0 .3rem; }
}

/* Home page: welcome on the left, goals of the month on the right, larger (asked by the agency) */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 2rem; align-items: start; margin-bottom: 1.75rem; }
@media (min-width: 992px) { .home-top { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); } }
.home-top .welcome { margin-bottom: 1rem; }
.goals-hero { margin-bottom: 0; padding: 1.25rem 1.4rem; border-radius: 1rem; background: var(--edp-ink, #1c1a17); color: #fff;
  box-shadow: 0 10px 30px rgba(28, 26, 23, .18); }
.goals-hero .goals-head { align-items: center; margin-bottom: 1rem; }
.goals-title { font-size: 1.35rem; font-weight: 700; color: #fff; }
.goals-title .bi { color: var(--edp-gold, #b8965a); }
.goals-title span { display: block; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #d9c79f; }
.goals-hero .goals-days { display: flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 999px;
  background: var(--edp-gold, #b8965a); color: #1c1a17; font-weight: 700; font-size: .95rem; }
.goals-days-number { font-size: 1.7rem; line-height: 1; }
.goals-hero .goal-card { color: var(--edp-ink); }
.goals-hero .goal-value { font-size: 2.8rem; }
.goals-hero .goals-empty { color: #d9c79f; }

/* Job profiles, inside Administration › Utilisateurs */
.profiles-panel { margin-bottom: 1.25rem; }
.profiles-panel > summary { cursor: pointer; display: flex; flex-direction: column; gap: .25rem; list-style: none; }
.profiles-panel > summary::-webkit-details-marker { display: none; }
.profiles-panel > summary .card-title-lg::after { content: " ▾"; color: var(--edp-muted); }
.profiles-panel[open] > summary .card-title-lg::after { content: " ▴"; }
.profiles-table { border-top: 1px solid var(--bs-border-color); }

/* Leave calendar: one line per collaborator, one column per day */
.leave-cal-wrap { overflow-x: auto; }
.leave-cal { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .78rem; }
.leave-cal th, .leave-cal td { border-bottom: 1px solid var(--bs-border-color); text-align: center; padding: .3rem .1rem; min-width: 1.6rem; }
.leave-cal thead th { font-weight: 600; color: var(--edp-ink-soft); line-height: 1.1; }
.leave-cal-letter { display: block; font-size: .65rem; color: var(--edp-muted); }
.leave-cal .leave-cal-name { text-align: left; white-space: nowrap; padding: .35rem .6rem; position: sticky; left: 0; background: #fff; z-index: 1;
  font-weight: 600; min-width: 11rem; }
.leave-cal .is-off { background: #f2efe9; }
.leave-cal thead .is-today { color: #fff; background: var(--edp-gold, #b8965a); border-radius: .35rem .35rem 0 0; }
.leave-cal td.is-today { box-shadow: inset 1px 0 0 var(--edp-gold, #b8965a), inset -1px 0 0 var(--edp-gold, #b8965a); }
.leave-cal td.leave-cal-accepte { background: #3f7d4e; }
.leave-cal td.leave-cal-en_attente { background: repeating-linear-gradient(45deg, #d9a441, #d9a441 4px, #f6e2a8 4px, #f6e2a8 8px); }
.leave-cal tr.is-me .leave-cal-name { color: var(--edp-gold-text); }
.leave-key { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; vertical-align: -2px; margin-left: .6rem; }
.leave-key.leave-cal-accepte { background: #3f7d4e; }
.leave-key.leave-cal-en_attente { background: repeating-linear-gradient(45deg, #d9a441, #d9a441 3px, #f6e2a8 3px, #f6e2a8 6px); }
.leave-key.leave-cal-off { background: #f2efe9; border: 1px solid var(--bs-border-color); }

/* Ticket in a window over the page (help bubble), and the bubble in the mandate flow */
.ticket-window .modal-body { height: min(80vh, 52rem); }
.ticket-frame { width: 100%; height: 100%; border: 0; display: block; }
.embed-page { background: var(--edp-bg, #f7f5f1); }
.embed-main { padding: 1rem 1.25rem 1.5rem; }
.ticket-group-title { margin: .25rem 0 -.25rem; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--edp-ink-soft); }
.ticket-submit { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.ticket-sent { max-width: 34rem; margin: 3rem auto; text-align: center; }
.ticket-sent > .bi { font-size: 3rem; color: #2e8b4f; }
.ticket-sent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
.wz-page .help-widget { right: auto; left: 1.25rem; bottom: 6rem; }

/* Nos services: the whole card opens the tool */
.service-card.is-link { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.service-card.is-link:hover { border-color: var(--edp-gold, #b8965a); box-shadow: 0 6px 18px rgba(28, 26, 23, .12); }
.service-card.is-link .service-actions > :not(.service-open), .service-card.is-link .service-note { position: relative; z-index: 2; }

/* « Modifier » a signed document, and its history (app/revisions.py) */
.doc-reopen { max-width: 46rem; }
.doc-reopen-warning { display: flex; gap: 12px; margin: 0 0 1rem; padding: 12px 16px; background: #fff1db; border-left: 4px solid #b3261e; border-radius: 6px; }
.doc-reopen-warning > .bi { color: #b3261e; font-size: 1.3rem; }
.doc-history { display: flex; gap: 12px; margin: 0 0 14px; padding: 10px 16px; background: #f4f1ea; border-radius: 8px; }
.doc-history > .bi { font-size: 1.2rem; color: var(--edp-gold-text); }

/* Capture of the screen joined to a ticket (help.js, embed.js) */
.ticket-capture { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px dashed var(--bs-border-color); border-radius: 10px; background: #fbfaf7; }
.ticket-capture[hidden] { display: none; }
.ticket-capture img { width: 180px; max-width: 40%; border-radius: 6px; border: 1px solid var(--bs-border-color); }
html.is-capturing, html.is-capturing * { cursor: progress !important; }

/* ---------- Documents: « Documents » / « Mes contrats » ---------- */
.doc-subnav .nav-link { font-weight: 600; }
.doc-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.doc-search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.doc-search .form-select { width: auto; max-width: 16rem; }
.doc-search .input-group { width: 20rem; max-width: 100%; }
.doc-row-type { font-size: .9rem; }
.doc-agent { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--edp-gold-soft, #f5efe4); color: var(--edp-ink); font-size: .78rem; font-weight: 700; cursor: help; }
.doc-btn-text { display: none; }
@media (min-width: 1400px) { .doc-btn-text { display: inline; } }
.abandon-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.abandon-reason { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--bs-border-color);
  border-radius: .6rem; cursor: pointer; }
.abandon-reason:has(input:checked) { border-color: var(--edp-gold); background: #fff8ea; }
.relance-menu { min-width: 280px; }
@media (max-width: 575.98px) { .abandon-reasons { grid-template-columns: 1fr; } .doc-search .input-group { width: 100%; } }

.doc-ids { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem 1rem; margin-bottom: .75rem; border-radius: .75rem;
  background: #f6f4f0; }
.doc-ids > .bi { font-size: 1.4rem; color: var(--edp-gold); }
.doc-id-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .9rem; }
.doc-id-form { margin: 0; }

.for-client-type { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; margin-bottom: .4rem;
  border: 1px solid var(--bs-border-color); border-radius: .6rem; cursor: pointer; }
.for-client-type:has(input:checked) { border-color: var(--edp-gold); background: #fff8ea; }

/* Mandate signed on paper: the scan kept, the documents in progress of the same client, the type in one click */
.paper-form .wz-field { position: relative; }
.paper-form .wz-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid #d9d3c7; border-radius: 10px; box-shadow: 0 10px 24px rgba(28, 26, 23, .14); }
.paper-form .wz-suggest li { padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: .9rem; }
.paper-form .wz-suggest li:hover, .paper-form .wz-suggest li.is-active { background: #f6efe0; }
.paper-kept { margin-bottom: .4rem; }
.paper-found { padding: 1rem; border: 2px solid var(--edp-gold); border-radius: .9rem; background: #fffaf0; }
.paper-match { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; margin-bottom: .45rem; border: 1px solid var(--bs-border-color);
  border-radius: .6rem; background: #fff; cursor: pointer; }
.paper-match:has(input:checked) { border-color: var(--edp-gold); }
.paper-match input { margin-top: .3rem; }
.paper-types { display: flex; flex-wrap: wrap; gap: .5rem; }
.paper-types.is-invalid .paper-type { border-color: var(--bs-danger); }
.paper-type { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border: 1px solid var(--bs-border-color);
  border-radius: 999px; cursor: pointer; }
.paper-type:has(input:checked) { border-color: var(--edp-gold); background: #fff8ea; font-weight: 600; }

/* New ticket: the conversation first, the summary below, the form folded */
.ticket-layout { display: flex; flex-direction: column; gap: 1rem; max-width: 960px; }
.ticket-summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; font-size: .92rem; }
.ticket-summary dt { color: var(--edp-ink-soft); font-weight: 600; }
.ticket-summary dd { margin: 0; }
.ticket-summary-text { white-space: pre-line; max-height: 9rem; overflow: auto; }
.ticket-summary [hidden], .ticket-fields [hidden] { display: none !important; }
.ticket-capture { margin: .75rem 0; }
.ticket-capture.is-on { border-style: solid; border-color: var(--edp-gold); background: #fffaf0; }

/* Help bubble: first the choice (a ticket, or a question) */
.help-choice { flex: 1; display: flex; flex-direction: column; gap: .7rem; padding: 1rem .9rem; overflow-y: auto; }
.help-choice[hidden], .help-log[hidden], .help-form[hidden], .help-foot[hidden], .help-icon[hidden] { display: none; }
.help-choice-item { display: flex; gap: .8rem; align-items: flex-start; width: 100%; padding: .9rem 1rem; text-align: left;
  border: 1px solid var(--bs-border-color); border-radius: .8rem; background: #fff; color: var(--edp-ink); text-decoration: none; cursor: pointer; }
.help-choice-item:hover, .help-choice-item:focus-visible { border-color: var(--edp-gold); background: #fffaf0; }
.help-choice-item > .bi { font-size: 1.5rem; color: var(--edp-gold); line-height: 1; }
.help-choice-item span { display: flex; flex-direction: column; gap: .2rem; }
.help-choice-item small { color: var(--edp-ink-soft); font-size: .82rem; }
.help-choice-guide { margin-top: auto; font-size: .85rem; text-align: center; text-decoration: none; }

/* Agenda: the appointment of the moment, preselected */
.appt-card.is-selected { outline: 3px solid var(--edp-gold); outline-offset: 2px; }
.appt-card:focus { outline: 3px solid var(--edp-gold); outline-offset: 2px; }
