/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
  --blue:        #2f6385;
  --blue-dk:     #234d66;
  --blue-lt:     #edf3f8;
  --blue-mid:    #c8dcea;
  --prune:       #530f49;
  --prune-dk:    #3d0a36;
  --prune-lt:    #f5edf4;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;

  --text:       #1a2332;
  --text-soft:  #4b5563;
  --white:      #ffffff;

  --green:    #1e6b2e;
  --green-bg: #e6f4ea;
  --orange:   #c45500;
  --orange-bg:#fff3e0;
  --red:      #b91c1c;
  --red-bg:   #fee2e2;

  --radius:    14px;
  --radius-sm:  9px;
  --radius-xs:  6px;
  --shadow:     0 2px 14px rgba(0,0,0,.07);
  --shadow-md:  0 4px 22px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.14);
  --t:          .2s ease;

  --header-h: 64px;
  --font-h:   'Urbanist', -apple-system, sans-serif;
  --font-b:   'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   RESET + BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-h); font-weight: 700; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: var(--font-b); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   SCREENS
═══════════════════════════════════════════════════════════ */
.screen { display: none; }
.screen.active { display: block; }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 200;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-h);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.logo-img      { height: 56px; width: auto; }
.logo-energy   { color: var(--blue); }
.logo-coaching { color: var(--prune); }
.logo-tag {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
}
.btn-nav {
  font-size: .85rem;
  font-weight: 700;
  padding: 8px 20px;
  border: 2px solid var(--prune);
  border-radius: var(--radius-sm);
  color: var(--prune);
  transition: var(--t);
}
.btn-nav:hover { background: var(--prune); color: var(--white); }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  background: var(--prune);
  color: var(--white);
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--t);
  letter-spacing: .01em;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--prune-dk);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(83,15,73,.3);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-full { width: 100%; }

/* ═══════════════════════════════════════════════════════════
   HOME — HERO
═══════════════════════════════════════════════════════════ */
#screen-home { padding-top: var(--header-h); }
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
  background: linear-gradient(145deg, #f5f8fb 0%, #edf3f8 60%, #f0ebf4 100%);
}
.hero-bg-circle {
  position: absolute;
  top: -120px; right: -180px;
  width: 560px; height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47,99,133,.09) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--blue);
  background: rgba(47,99,133,.1);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 22px;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.hero-subtitle {
  font-size: 1.12rem;
  color: var(--text-soft);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 42px;
}
.hero-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.hero-cta-sub {
  font-size: .8rem;
  color: var(--gray-400);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   HOME — STATS
═══════════════════════════════════════════════════════════ */
.stats-section {
  padding: 64px 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-block {
  padding: 36px 28px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--t);
}
.stat-block:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-mid);
}
.stat-number {
  font-family: var(--font-h);
  font-size: 3rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.stat-label {
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  margin-bottom: 8px;
}
.stat-desc { font-size: .82rem; color: var(--text-soft); line-height: 1.55; }

/* ═══════════════════════════════════════════════════════════
   HOME — REASSURANCE
═══════════════════════════════════════════════════════════ */
.reassurance-section { padding: 64px 0 80px; background: var(--white); }
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 36px;
  text-align: center;
}
.reassurance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 52px;
}
.reassurance-card {
  padding: 32px 26px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: var(--t);
}
.reassurance-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--blue-mid);
}
.reassurance-icon { font-size: 1.9rem; margin-bottom: 16px; }
.reassurance-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
}
.reassurance-card p { font-size: .88rem; color: var(--text-soft); line-height: 1.65; }
.home-cta-bottom { text-align: center; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer { padding: 20px 0; border-top: 1px solid var(--gray-200); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-inner span { font-size: .78rem; color: var(--gray-400); }
.btn-demo-reset {
  font-size: .75rem;
  color: var(--gray-400);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: var(--t);
}
.btn-demo-reset:hover { color: var(--text-soft); }

/* ═══════════════════════════════════════════════════════════
   GIVE-TO-GET
═══════════════════════════════════════════════════════════ */
#screen-give-to-get {
  padding-top: var(--header-h);
  min-height: 100vh;
  background: var(--gray-100);
}
.gtg-outer {
  display: flex;
  justify-content: center;
  padding: 48px 24px 80px;
}
.gtg-inner { width: 100%; max-width: 560px; }

/* GTG header */
.gtg-header { text-align: center; margin-bottom: 28px; }
.gtg-logo {
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 28px;
}
.gtg-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.gtg-header p { font-size: .9rem; color: var(--text-soft); }

/* Notice contextuel GTG (accès expiré / rejet) */
.gtg-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 18px;
  text-align: left;
}
.gtg-notice.hidden { display: none; }
.gtg-notice-warning {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  color: #92400e;
}
.gtg-notice-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.gtg-notice-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* Progress dots */
.gtg-progress-wrap { margin-top: 24px; }
.gtg-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.gtg-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: var(--t);
}
.gtg-dot.filled { background: var(--blue); }
.gtg-dot.current {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,99,133,.22);
}
.gtg-progress-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
}

/* GTG card */
.gtg-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
}
.gtg-step-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--gray-400);
  text-align: center;
  margin-bottom: 24px;
}

/* Form */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-2 > .form-group { min-width: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
}
.req { color: var(--prune); }
.optional { font-weight: 400; color: var(--gray-400); font-size: .8em; }

.form-group input,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: var(--t);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,99,133,.12);
}
.form-group input::placeholder { color: var(--gray-400); }
.form-group input.invalid { border-color: var(--red); }
.form-group input.valid   { border-color: var(--green); }

.field-hint { font-size: .76rem; min-height: 18px; }
.hint-ok   { color: var(--green); }
.hint-warn { color: var(--blue); }
.hint-err  { color: var(--red); }

/* GTG success */
.gtg-success {
  text-align: center;
  padding: 52px 28px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--prune);
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.gtg-success h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--prune);
  margin-bottom: 12px;
}
.gtg-success p { color: var(--text-soft); font-size: .9rem; margin-bottom: 8px; }
.success-note { font-style: italic; font-size: .82rem !important; margin-bottom: 28px !important; }

/* ═══════════════════════════════════════════════════════════
   DIRECTORY
═══════════════════════════════════════════════════════════ */
#screen-directory { padding-top: var(--header-h); }

/* Sticky bar */
.dir-sticky {
  position: sticky;
  top: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 100;
  padding: 14px 0 10px;
}

/* Search */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 13px 16px 13px 48px;
  font-size: .98rem;
  border: 2px solid var(--gray-300);
  border-radius: 50px;
  background: var(--gray-50);
  color: var(--text);
  transition: var(--t);
}
.search-input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(47,99,133,.1);
}

/* ── Filter dropdowns (multi-select) ─────────────────────── */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 10px;
}
.filter-dd {
  position: relative;
}
.filter-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  white-space: nowrap;
}
.filter-dd-btn:hover,
.filter-dd.open .filter-dd-btn {
  border-color: var(--blue);
  color: var(--blue);
}
.filter-dd-btn.has-filter {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.filter-dd-badge {
  background: rgba(255,255,255,.25);
  color: var(--white);
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.filter-dd-btn:not(.has-filter) .filter-dd-badge {
  background: var(--blue);
  color: var(--white);
}
.fd-chevron {
  font-size: .7rem;
  transition: transform .2s;
  line-height: 1;
}
.filter-dd.open .fd-chevron { transform: rotate(180deg); }
.filter-dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  width: 250px;
  overflow: hidden;
}
.fd-search {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-bottom: 1px solid var(--gray-200);
  font-size: .82rem;
  outline: none;
  box-sizing: border-box;
  color: var(--text);
}
.fd-items {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}
.fd-items::-webkit-scrollbar { width: 4px; }
.fd-items::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
.fd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text);
  transition: background .12s;
}
.fd-item:hover { background: var(--gray-50); }
.fd-item.fd-item-active { color: var(--blue); font-weight: 600; }
.fd-item input[type="checkbox"] {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}
.fd-footer {
  padding: 7px 14px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
}
.fd-clear-btn {
  background: none;
  border: none;
  font-size: .78rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.fd-clear-btn:hover { color: var(--red); }

/* Counter */
.dir-counter {
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-400);
}

/* Body */
.dir-body { padding: 22px 0 60px; min-height: 60vh; }

/* Contact card */
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 9px;
  cursor: pointer;
  transition: var(--t);
}
.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--blue-mid);
}
.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-h);
  font-weight: 800;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.card-info { flex: 1; min-width: 0; }
.card-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-poste {
  font-size: .8rem;
  color: var(--text-soft);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.card-entreprise { font-size: .78rem; font-weight: 600; color: var(--text); }
.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-secteur  { background: var(--blue-lt); color: var(--blue); }
.badge-categorie { background: #f0fdf4; color: #15803d; font-size:.65rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; padding:2px 7px; border-radius:20px; margin-left:6px; vertical-align:middle; }
.freshness-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.card-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.action-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-xs);
  background: var(--gray-100);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
  border: 1px solid var(--gray-200);
  cursor: pointer;
}
.action-btn:hover { background: var(--blue-lt); color: var(--blue); border-color: var(--blue-mid); }

/* Directory placeholder (no filter selected) */
.dir-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-soft);
}
.dir-placeholder-icon { font-size: 2.5rem; margin-bottom: 16px; opacity: .7; }
.dir-placeholder h3   { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.dir-placeholder p    { font-size: .88rem; color: var(--text-soft); line-height: 1.7; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state h3 { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 8px; }
.empty-state p  { font-size: .85rem; color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════════
   SIDE PANEL
═══════════════════════════════════════════════════════════ */
.side-panel { position: fixed; inset: 0; z-index: 300; }
.panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,20,30,.42);
  backdrop-filter: blur(2px);
}
.panel-aside {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100%;
  background: var(--white);
  overflow-y: auto;
  box-shadow: -12px 0 48px rgba(0,0,0,.14);
  display: flex;
  flex-direction: column;
  animation: slideIn .25s ease;
}
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.panel-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  width: 38px; height: 38px;
  border-radius: var(--radius-xs);
  background: var(--gray-100);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 14px 0;
  transition: var(--t);
  z-index: 1;
}
.panel-close:hover { background: var(--gray-200); }
#panel-body { padding: 8px 28px 48px; flex: 1; }

/* Panel content helpers */
.panel-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.panel-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.panel-poste { font-size: .92rem; color: var(--text-soft); margin-bottom: 6px; }
.panel-categorie-sep { color: var(--gray-300); }
.panel-categorie { color: var(--blue); font-weight: 600; }
.panel-ent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.panel-sep { height: 1px; background: var(--gray-200); margin: 18px 0; }
.panel-freshness-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 7px;
}
.pill-green  { background: var(--green-bg);  color: var(--green);  }
.pill-orange { background: var(--orange-bg); color: var(--orange); }
.pill-red    { background: var(--red-bg);    color: var(--red);    }
.pill-gray   { background: var(--gray-100);  color: var(--gray-400);}
.panel-date  { font-size: .76rem; color: var(--gray-400); margin-bottom: 22px; }
.panel-btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--prune);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 10px;
  transition: var(--t);
  cursor: pointer;
}
.panel-btn-copy:hover { background: var(--prune-dk); }
.panel-btn-linkedin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  background: var(--blue-lt);
  color: var(--blue);
  border-radius: var(--radius-sm);
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .93rem;
  margin-bottom: 16px;
  transition: var(--t);
  text-decoration: none;
}
.panel-btn-linkedin:hover { background: var(--blue-mid); }
.panel-btn-jobs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 4px;
  transition: var(--t);
  text-decoration: none;
}
.panel-btn-jobs:hover { background: #c8e6cb; }
.panel-btn-sites {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 4px;
  transition: var(--t);
  text-decoration: none;
}
.panel-btn-sites:hover { background: #bae6fd; }
.panel-btn-offres {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  background: #f0fdf4;
  color: #15803d;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 4px;
  transition: var(--t);
  text-decoration: none;
}
.panel-btn-offres:hover { background: #dcfce7; }
.panel-hunter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .76rem;
  color: var(--green);
  font-weight: 700;
  margin-top: 4px;
  margin-bottom: 16px;
}
.panel-sec-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.panel-email-sec { font-size: .84rem; color: var(--text-soft); font-style: italic; }

/* ═══════════════════════════════════════════════════════════
   MODALS / OVERLAYS
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,30,.55);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 44px 38px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn .22s ease;
}
@keyframes popIn {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-logo {
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 22px;
}
.modal-card h2 {
  font-size: 1.65rem;
  font-weight: 900;
  margin-bottom: 14px;
  color: var(--text);
}
.modal-card p {
  font-size: .93rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Auth terms notice */
.auth-terms-notice {
  font-size: .8rem;
  color: var(--text-soft);
  margin-bottom: 12px;
  text-align: center;
}
.auth-terms-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-terms-link:hover { color: var(--prune); }

/* Rules modal */
.rules-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,30,.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rules-modal-overlay.hidden { display: none; }
.rules-modal-card {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
.rules-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 16px;
  border-bottom: 1.5px solid var(--gray-200);
  flex-shrink: 0;
}
.rules-modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.rules-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.rules-modal-close:hover { color: var(--text); background: var(--gray-100); }
.rules-modal-body {
  overflow-y: auto;
  padding: 20px 28px;
  flex: 1;
}
.rules-section { margin-bottom: 24px; }
.rules-section:last-child { margin-bottom: 0; }
.rules-section h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--prune);
  margin-bottom: 6px;
}
.rules-section p {
  font-size: .85rem;
  color: var(--text-soft);
  margin-bottom: 8px;
  line-height: 1.6;
}
.rules-section ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rules-section li {
  font-size: .83rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.rules-section a { color: var(--blue); }
.rules-modal-card > .btn-primary {
  margin: 0 28px 22px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 24px;
  border-radius: 50px;
  font-size: .86rem;
  font-weight: 600;
  z-index: 500;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: toastIn .2s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.toast-blue   { background: var(--blue);  color: var(--white); }
.toast-green  { background: var(--green); color: var(--white); }
.toast-orange { background: var(--orange); color: var(--white); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   DIRECTORY IMPROVEMENTS
═══════════════════════════════════════════════════════════ */

/* Counter + toggle row */
.dir-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* View toggle */
.view-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 3px;
  flex-shrink: 0;
}
.vt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray-400);
  transition: var(--t);
  letter-spacing: .01em;
}
.vt-btn:hover:not(.active) { color: var(--text); }
.vt-btn.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow);
}

/* ── LIST CARDS (improved) ─────────────────────── */
.contact-card {
  border-left: 3px solid transparent;
}
.contact-card.fresh-green  { border-left-color: var(--green); }
.contact-card.fresh-orange { border-left-color: var(--orange); }
.contact-card.fresh-red    { border-left-color: var(--red); }
.contact-card.fresh-gray   { border-left-color: var(--gray-300); }

/* ── GRID VIEW ─────────────────────────────────── */
#contacts-list.is-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.contact-card-grid {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  flex-direction: column;
}
.contact-card-grid:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--blue-mid);
}

.grid-top {
  background: linear-gradient(140deg, var(--blue-lt) 0%, #d4e7f3 100%);
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}
.avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,.8);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  letter-spacing: .02em;
}
.grid-freshness-dot {
  position: absolute;
  top: 14px; right: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.grid-body {
  padding: 16px 18px 12px;
  flex: 1;
}
.grid-name {
  font-family: var(--font-h);
  font-weight: 800;
  font-size: .98rem;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.grid-poste {
  font-size: .78rem;
  color: var(--text-soft);
  margin-bottom: 14px;
  line-height: 1.45;
}
.grid-sep {
  height: 1px;
  background: var(--gray-200);
  margin-bottom: 12px;
}
.grid-company {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}
.grid-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.grid-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--gray-100);
}
.btn-grid-copy {
  width: 100%;
  padding: 10px;
  background: var(--prune);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: var(--t);
  border: none;
}
.btn-grid-copy:hover { background: var(--prune-dk); }
.btn-grid-view {
  width: 100%;
  padding: 10px;
  background: var(--gray-100);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--t);
}
.btn-grid-view:hover { background: var(--gray-200); }

/* Footer admin link */
.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-admin-link {
  font-size: .75rem;
  color: var(--gray-400);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: var(--t);
}
.footer-admin-link:hover { color: var(--blue); }

/* ═══════════════════════════════════════════════════════════
   MOBILE — 768px
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Hero */
  .hero { padding: 52px 0 44px; }
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1rem; }

  /* Stats + reassurance */
  .stats-grid,
  .reassurance-grid { grid-template-columns: 1fr; gap: 14px; }
  .stats-section, .reassurance-section { padding: 44px 0; }

  /* GTG form */
  .form-row-2 { grid-template-columns: 1fr; }
  .gtg-card { padding: 22px 18px; }

  /* Directory */
  .card-actions { display: none; } /* open panel on card click */
  .contact-card { padding: 14px 14px; }
  #contacts-list.is-grid { grid-template-columns: repeat(2, 1fr); }
  .dir-bottom-bar { flex-wrap: wrap; gap: 8px; }
  .vt-btn span { display: none; }

  /* Panel: full screen bottom sheet */
  .panel-aside {
    width: 100%;
    top: auto;
    height: 90dvh;
    border-radius: var(--radius) var(--radius) 0 0;
    animation: slideUp .28s ease;
  }
  @keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE — 480px
═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero-title { font-size: 1.85rem; }
  .stat-number { font-size: 2.4rem; }
  .stat-block { padding: 24px 18px; }
  .logo-tag { display: none; }
  #contacts-list.is-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   AUTH SCREEN
═══════════════════════════════════════════════════════════ */
#screen-auth {
  padding-top: var(--header-h);
  min-height: 100vh;
  background: linear-gradient(145deg, #f5f8fb 0%, #edf3f8 60%, #f0ebf4 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.auth-outer {
  width: 100%;
  min-height: 100vh;
  padding: 52px 24px 80px;
  display: flex;
  justify-content: center;
  background: #f8fafc;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px 40px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.15rem;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: .88rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Google button */
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-b);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  transition: var(--t);
  margin-bottom: 20px;
}
.auth-google-btn:hover {
  border-color: var(--blue);
  background: var(--blue-lt);
}

/* OR separator */
.auth-or {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
  color: var(--gray-400);
  font-size: .76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-or::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--gray-200);
}
.auth-or span {
  position: relative;
  background: var(--white);
  padding: 0 12px;
}

/* Tab switcher */
.auth-tabs {
  display: flex;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--white);
  cursor: pointer;
  transition: var(--t);
  font-family: var(--font-h);
}
.auth-tab:first-child { border-right: 1px solid var(--gray-200); }
.auth-tab.active { background: var(--blue); color: var(--white); }
.auth-tab:not(.active):hover { color: var(--text); }

/* Error message */
.auth-error {
  color: var(--red);
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--red-bg);
  border-radius: var(--radius-xs);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   HEADER — USER WIDGET
═══════════════════════════════════════════════════════════ */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-h);
  font-weight: 800;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
  user-select: none;
}
.hu-name {
  font-size: .83rem;
  font-weight: 700;
  color: var(--text);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hu-logout-btn {
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-400);
  padding: 6px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  transition: var(--t);
  cursor: pointer;
  white-space: nowrap;
}
.hu-logout-btn:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 768px) {
  .auth-card { padding: 30px 22px; }
  .hu-name { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   DIRECTORY — TAB BAR
═══════════════════════════════════════════════════════════ */
:root { --tabs-h: 50px; }

.dir-tabs-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 150;
  height: var(--tabs-h);
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
}
.dir-tabs-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dir-tabs-inner::-webkit-scrollbar { display: none; }

.dir-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 22px;
  height: 100%;
  font-family: var(--font-h);
  font-size: .85rem;
  font-weight: 700;
  color: var(--gray-400);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--t);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.dir-tab:hover:not(.active) { color: var(--blue); }
.dir-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Shift dir-sticky below tab bar */
.dir-sticky { top: calc(var(--header-h) + var(--tabs-h)) !important; }

/* ═══════════════════════════════════════════════════════════
   RESOURCES — CV & Lettres
═══════════════════════════════════════════════════════════ */
.resources-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}
.resources-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.resources-header p { font-size: .88rem; color: var(--text-soft); line-height: 1.65; }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding-bottom: 60px;
}

.tpl-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--t);
  cursor: pointer;
}
.tpl-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--blue-mid);
}
.tpl-card-hint {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  margin-top: 6px;
  letter-spacing: .02em;
  opacity: 0;
  transition: opacity .2s;
}
.tpl-card:hover .tpl-card-hint { opacity: 1; }

.tpl-card-top {
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, var(--blue-lt) 0%, #d4e7f3 100%);
  border-bottom: 1px solid var(--gray-200);
}
.tpl-card-top.lettre {
  background: linear-gradient(135deg, var(--prune-lt) 0%, #e8d0e6 100%);
}

.tpl-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--blue);
  margin-bottom: 6px;
}
.tpl-category.lettre { color: var(--prune); }

.tpl-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.tpl-card-body { padding: 16px 22px; flex: 1; }
.tpl-desc {
  font-size: .83rem;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}
.tpl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-tag {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.tpl-tag-level { background: var(--blue-lt);   color: var(--blue-dk); }
.tpl-tag-skill { background: var(--gray-100);  color: var(--text-soft); }
.tpl-tag-tone  { background: var(--prune-lt);  color: var(--prune-dk); }

.tpl-card-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--gray-100);
}
.btn-tpl {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--t);
  border: none;
}
.btn-tpl-blue  { background: var(--blue);  color: var(--white); }
.btn-tpl-blue:hover  { background: var(--blue-dk); }
.btn-tpl-prune { background: var(--prune); color: var(--white); }
.btn-tpl-prune:hover { background: var(--prune-dk); }
.tpl-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: .84rem;
  font-weight: 600;
  font-style: italic;
}

/* Letter panel */
.letter-panel-body {
  font-size: .87rem;
  color: var(--text);
  line-height: 1.85;
  white-space: pre-line;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 12px;
}
.letter-panel-hint {
  font-size: .75rem;
  color: var(--gray-400);
  font-style: italic;
}

@media (max-width: 768px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .dir-tab  { padding: 0 14px; font-size: .8rem; }
}

/* ─── AUTH DEMO QUICK-ACCESS ──────────────────────────── */
.auth-demo {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}
.auth-demo p {
  font-size: .8rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.auth-demo-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--prune);
  color: var(--prune);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .88rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.auth-demo-btn:hover {
  background: var(--prune);
  color: #fff;
}
.auth-demo-creds {
  display: block;
  margin-top: 8px;
  font-size: .72rem;
  color: #94a3b8;
  font-family: monospace;
}

/* ─── PDF VIEWER OVERLAY ──────────────────────────────── */
.pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #0f172a;
  display: flex;
  flex-direction: column;
}
.pdf-viewer-overlay.hidden { display: none; }
.pdf-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #1e2d3d;
  color: #fff;
  flex-shrink: 0;
  gap: 12px;
}
.pdf-viewer-title {
  font-weight: 600;
  font-size: .95rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-viewer-close {
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: .82rem;
  font-family: var(--font-body);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.pdf-viewer-close:hover { background: rgba(255,255,255,.12); }
.pdf-viewer-body {
  flex: 1;
  display: flex;
}
#pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.btn-tpl-pdf {
  background: var(--blue);
  color: var(--white);
}
.btn-tpl-pdf:hover { background: var(--blue-dk); }

/* ═══════════════════════════════════════════════════════════
   DOCX PREVIEW OVERLAY
═══════════════════════════════════════════════════════════ */
.docx-preview-content {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  padding: 0;
}
.docx-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 48px;
  background: #fff;
  min-height: 100%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: .95rem;
  line-height: 1.75;
  color: #1e293b;
}
.docx-inner p { margin: 0 0 .9em; }
.docx-inner h1, .docx-inner h2, .docx-inner h3 {
  font-family: var(--font-body);
  color: #1e2d3d;
  margin: 1.2em 0 .4em;
}
.docx-inner table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.docx-inner td, .docx-inner th { border: 1px solid #e2e8f0; padding: 6px 10px; }
.docx-loading, .docx-error {
  text-align: center;
  padding: 80px 24px;
  font-family: var(--font-body);
  color: #6b7280;
  font-size: .9rem;
  width: 100%;
}
.docx-error p:first-child { color: #ef4444; font-weight: 600; margin-bottom: 8px; }
.docx-error-hint { color: #6b7280; font-size: .85rem; line-height: 1.5; }

/* ─── Card footer with multiple buttons ─────────────────── */
.tpl-footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tpl-footer-actions .btn-tpl { flex: 1; min-width: 0; justify-content: center; }

/* Secondary (outline) button for preview */
.btn-tpl-secondary {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-tpl-secondary:hover { background: #eff6ff; }
