/* LinkedOut : thème fidèle à LinkedIn (usage interne, cercle privé) */
:root {
  --blue: #0a66c2;
  --blue-dark: #004182;
  --bg: #f4f2ee;
  --card: #ffffff;
  --border: #e0dfdc;
  --text: rgba(0, 0, 0, 0.9);
  --text-low: rgba(0, 0, 0, 0.6);
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--blue); font-weight: 600; }
a.link:hover { text-decoration: underline; }

/* ---------- Logo ---------- */
.logo-img { height: 26px; width: auto; display: block; }
.logo-img-xl { height: 42px; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.navbar-inner {
  max-width: 1128px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 8px; height: 52px;
}
.search {
  background: #edf3f8; border: none; border-radius: 4px;
  padding: 8px 12px; font-size: 14px; width: 280px; color: var(--text);
}
.search::placeholder { color: var(--text-low); }
.search-wrap { position: relative; }
.search-wrap .search { width: 280px; max-width: 100%; }
@media (max-width: 840px) { .search-wrap .search { width: 100%; } }
.search-drop {
  position: absolute; top: 100%; left: 0; margin-top: 4px; width: 320px; max-width: 80vw;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15); overflow: hidden; z-index: 30;
}
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.search-item:hover { background: rgba(0,0,0,0.05); }
.search-item-txt { display: flex; flex-direction: column; min-width: 0; }
.search-item-txt strong { font-size: 14px; }
.search-item-txt span { font-size: 12px; color: var(--text-low); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 840px) { .search-wrap { flex: 1; min-width: 0; } }
.nav-links { display: flex; margin-left: auto; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 80px; height: 52px; color: var(--text-low); font-size: 12px; gap: 2px;
  border-bottom: 2px solid transparent;
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); border-bottom-color: var(--text); }
.nav-item .avatar { width: 24px; height: 24px; font-size: 10px; }
.nav-burger {
  display: none; margin-left: auto; border: none; background: none;
  font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-low); padding: 8px;
}
@media (max-width: 840px) {
  .navbar-inner { position: relative; }
  .search { width: auto; flex: 1; min-width: 0; }
  .nav-burger { display: block; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 52px; right: 0; width: 230px; background: var(--card);
    border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15); z-index: 20; margin-left: 0;
  }
  .nav-links.open .nav-item {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    height: 48px; min-width: 0; padding: 0 16px; font-size: 14px;
    border-bottom: none;
  }
  .nav-links.open .nav-item.active { color: var(--blue); }
}

/* ---------- Layout ---------- */
.container { max-width: 1128px; margin: 24px auto; padding: 0 16px; }
.container.narrow { max-width: 576px; }
.grid {
  display: grid; grid-template-columns: 225px minmax(0, 1fr) 300px; gap: 24px;
  align-items: start;
}
@media (max-width: 990px) { .grid { grid-template-columns: minmax(0, 1fr); } .rail { display: none; } }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 8px;
}
.card-pad { padding: 16px; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; flex-shrink: 0; }
.avatar-fallback {
  background: var(--blue); color: #fff; align-items: center; justify-content: center;
  font-weight: 600;
}
.avatar-24 { width: 24px; height: 24px; font-size: 10px; }
.avatar-40 { width: 40px; height: 40px; font-size: 16px; }
.avatar-48 { width: 48px; height: 48px; font-size: 18px; }
.avatar-72 { width: 72px; height: 72px; font-size: 26px; }
.avatar-152 { width: 152px; height: 152px; font-size: 52px; border: 4px solid #fff; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 24px; padding: 8px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; font-family: inherit;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--text-low); }
.btn-ghost:hover { background: rgba(0,0,0,0.06); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: rgba(112,181,249,0.15); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-low); margin-bottom: 4px; font-weight: 600; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid rgba(0,0,0,0.5); border-radius: 4px; color: var(--text);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.hint { font-size: 12px; color: var(--text-low); margin-top: 4px; }

/* ---------- Login ---------- */
.login-page { max-width: 400px; margin: 48px auto; }
.login-title { font-size: 32px; font-weight: 300; line-height: 1.25; margin: 24px 0; color: rgba(0,0,0,0.85); }
.login-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.login-card .btn { width: 100%; padding: 12px; font-size: 16px; }
.error-banner {
  background: #fde7e9; color: #8f1425; border-radius: 4px;
  padding: 10px 12px; margin-bottom: 16px; font-size: 14px;
}
.ok-banner {
  background: #ddf5f2; color: #01754f; border-radius: 4px;
  padding: 10px 12px; margin-bottom: 16px; font-size: 14px;
}

/* ---------- Composer ---------- */
.composer { display: flex; gap: 8px; align-items: flex-start; }
.composer textarea {
  flex: 1; border: 1px solid rgba(0,0,0,0.3); border-radius: 8px;
  padding: 12px 16px; font-size: 14px; font-family: inherit; min-height: 48px;
}
.composer-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; justify-content: flex-end; }
.file-label { color: var(--text-low); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 8px; border-radius: 4px; }
.file-label:hover { background: rgba(0,0,0,0.06); }

/* ---------- Bouton IA ---------- */
.btn-ai {
  background: linear-gradient(115deg, #6e2cf2, #a24ff5);
  color: #fff;
}
.btn-ai:hover { background: linear-gradient(115deg, #5a1fd0, #8d3be0); }
.btn-ai:disabled { opacity: 0.55; cursor: default; }
.btn-augment {
  display: inline-block; margin-left: 8px; padding: 2px 10px;
  border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(115deg, #6e2cf2, #a24ff5);
  vertical-align: middle;
}
.btn-augment:hover { background: linear-gradient(115deg, #5a1fd0, #8d3be0); }
.btn-augment:disabled { opacity: 0.55; cursor: default; }
.ai-status {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px;
  font-size: 13px; color: #6e2cf2; font-weight: 600;
}
.ai-status[hidden] { display: none; }
.ai-status.ai-error { color: #8f1425; }
.ai-status.ai-error .ai-spinner { display: none; }
.ai-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #d9c6fb; border-top-color: #6e2cf2;
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.composer textarea.ai-thinking {
  border-color: #6e2cf2;
  animation: ai-pulse 1.6s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 44, 242, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(110, 44, 242, 0.12); }
}

/* ---------- Posts ---------- */
.post-head { display: flex; gap: 8px; padding: 12px 16px 0; }
.post-head-info { min-width: 0; }
.post-author { font-weight: 600; font-size: 14px; }
.post-headline { color: var(--text-low); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-time { color: var(--text-low); font-size: 12px; }
.post-text { padding: 8px 16px; font-size: 14px; white-space: normal; }
.post-image { width: 100%; display: block; max-height: 600px; object-fit: contain; background: #000; }
.post-stats { display: flex; justify-content: space-between; padding: 8px 16px; color: var(--text-low); font-size: 12px; border-bottom: 1px solid var(--border); }
.post-actions { display: flex; padding: 4px 8px; }
.post-actions form { flex: 1; display: flex; }
.post-actions .btn { flex: 1; border-radius: 4px; padding: 10px 4px; font-size: 14px; color: var(--text-low); background: transparent; }
.post-actions .btn:hover { background: rgba(0,0,0,0.06); }
.post-actions .btn.reacted { color: var(--blue); }
.reaction-bar { position: relative; }
.reaction-menu {
  display: none; position: absolute; bottom: 100%; left: 0;
  background: #fff; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 4px 8px; white-space: nowrap; z-index: 5;
}
.reaction-bar:hover .reaction-menu, .reaction-bar:focus-within .reaction-menu { display: block; }
.reaction-menu button {
  border: none; background: none; font-size: 24px; cursor: pointer; padding: 4px;
  transition: transform 0.1s;
}
.reaction-menu button:hover { transform: scale(1.4); }

/* ---------- Commentaires ---------- */
.comments { padding: 4px 16px 12px; }
.comment { display: flex; gap: 8px; margin-top: 8px; }
.comment-bubble { background: #f2f2f2; border-radius: 0 8px 8px 8px; padding: 8px 12px; flex: 1; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-text { font-size: 14px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input {
  flex: 1; border: 1px solid rgba(0,0,0,0.3); border-radius: 24px; padding: 8px 16px;
  font-size: 14px; font-family: inherit;
}

/* ---------- Profil ---------- */
.profile-cover { height: 200px; background: linear-gradient(120deg, #a0b4b7, #c9ccce 60%, #b6c8d4); }
.profile-cover.mini { height: 56px; }
.profile-head { padding: 0 24px 24px; margin-top: -76px; }
.profile-name { font-size: 24px; font-weight: 600; margin-top: 12px; }
.profile-headline { font-size: 16px; }
.profile-meta { color: var(--text-low); font-size: 14px; margin-top: 4px; }
.section-title { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.rail-card-head { padding: 12px 12px 0; font-weight: 600; font-size: 16px; }
.rail-item { padding: 8px 12px; display: flex; gap: 8px; align-items: center; }
.rail-item-name { font-weight: 600; font-size: 13px; }
.rail-item-sub { color: var(--text-low); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.news-item { padding: 6px 12px; }
.news-title { font-weight: 600; font-size: 13px; }
.news-sub { color: var(--text-low); font-size: 12px; }
.footer-note { text-align: center; color: var(--text-low); font-size: 12px; padding: 16px; }

/* ---------- Identity card (rail gauche) ---------- */
.id-card-body { text-align: center; padding: 0 12px 16px; }
.id-card-body .avatar { margin-top: -36px; border: 2px solid #fff; }
.id-name { font-weight: 600; font-size: 16px; margin-top: 8px; }
.id-headline { color: var(--text-low); font-size: 12px; }

/* ---------- Tables admin ---------- */
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th, table.admin td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
table.admin th { color: var(--text-low); font-weight: 600; }
code.pw { background: #f2f2f2; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
