/**
 * Portail Intranet ACME SA — Microfinance
 * Charte : bleu marine, vert ACME, blanc
 */
:root {
  --acme-navy: #1a3d6b;
  --acme-navy-dark: #0f2d52;
  --acme-navy-light: #2a5085;
  --acme-green: #3d9e4f;
  --acme-green-light: #5cb86a;
  --acme-red: #e94560;
  --acme-gold: #f0b429;
  --acme-white: #ffffff;
  --acme-gray-50: #f4f7fb;
  --acme-gray-100: #e8edf3;
  --acme-gray-200: #d1dae6;
  --acme-gray-500: #6b7c93;
  --acme-gray-800: #2c3e50;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --shadow-card: 0 2px 12px rgba(15, 45, 82, 0.08);
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  font-family: var(--font);
  color: var(--acme-gray-800);
  background: var(--acme-gray-50);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--acme-navy-light);
  text-decoration: none;
}

a:hover {
  color: var(--acme-green);
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--acme-navy-dark) 0%, var(--acme-navy) 100%);
  color: var(--acme-white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar__logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar__logo a {
  display: inline-block;
  line-height: 0;
  border-radius: 4px;
  color: inherit;
}

.sidebar__logo a:hover,
.sidebar__logo a:focus,
.sidebar__logo a:focus-visible,
.sidebar__logo a:active {
  color: inherit;
  opacity: 1;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.sidebar__logo img {
  display: block;
  max-width: 180px;
  width: 100%;
  height: auto;
}

.sidebar__nav {
  flex: 1;
  padding: 0.75rem 0;
  list-style: none;
}

.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar__nav a i {
  font-size: 1.1rem;
  width: 1.35rem;
  text-align: center;
  opacity: 0.9;
}

.sidebar__nav a:hover,
.sidebar__nav a.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--acme-white);
}

.sidebar__nav a.is-active {
  border-left: 3px solid var(--acme-green-light);
  padding-left: calc(1.25rem - 3px);
}

.sidebar__contacts {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
}

.sidebar__contacts h3 {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.sidebar__contacts p {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  opacity: 0.9;
}

.sidebar__tagline {
  padding: 0.75rem 1rem 1.25rem;
  font-size: 0.72rem;
  font-style: italic;
  text-align: center;
  opacity: 0.75;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__tagline::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  background: var(--acme-green);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* ─── Shell principal ─── */
.intranet-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar ─── */
.topbar {
  height: var(--topbar-height);
  background: var(--acme-white);
  border-bottom: 1px solid var(--acme-gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.topbar__search input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  border: 1px solid var(--acme-gray-200);
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--acme-gray-50);
}

.topbar__search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--acme-gray-500);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar__icon-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--acme-gray-800);
  font-size: 1.2rem;
  cursor: pointer;
}

.topbar__icon-btn:hover {
  background: var(--acme-gray-100);
}

.topbar__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  background: var(--acme-red);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__badge--blue {
  background: var(--acme-navy-light);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--acme-gray-200);
  position: relative;
  cursor: pointer;
  user-select: none;
}

.topbar__user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar__user-info span {
  font-size: 0.88rem;
  font-weight: 500;
}

.topbar__user-meta {
  font-size: 0.68rem;
  color: var(--acme-gray-500);
  font-weight: 400;
}

.topbar__avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.topbar__avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acme-navy), var(--acme-green));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--acme-green);
}

.topbar__user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--acme-gray-200);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 45, 82, 0.15);
  z-index: 100;
  overflow: hidden;
}

.topbar__user-dropdown.is-open {
  display: block;
}

.topbar__user-dropdown__head {
  padding: 0.75rem 1rem;
  background: var(--acme-gray-50);
  border-bottom: 1px solid var(--acme-gray-100);
  font-size: 0.78rem;
  color: var(--acme-gray-500);
}

.topbar__user-dropdown__head strong {
  display: block;
  color: var(--acme-navy);
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.topbar__user-dropdown a,
.topbar__user-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.85rem;
  color: var(--acme-gray-800);
  text-decoration: none;
  cursor: pointer;
}

.topbar__user-dropdown a:hover,
.topbar__user-dropdown button:hover {
  background: var(--acme-gray-50);
}

.topbar__user-dropdown button.logout-btn {
  color: var(--acme-red);
  border-top: 1px solid var(--acme-gray-100);
}

body.auth-pending .intranet-shell,
body.auth-pending .sidebar {
  visibility: hidden;
}

body.auth-pending.login-page {
  visibility: visible;
}

body.auth-pending.login-page .login-layout {
  visibility: visible;
}

.topbar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--acme-green);
}

.topbar__user span {
  font-size: 0.88rem;
  font-weight: 500;
}

/* ─── Contenu ─── */
.main-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto 280px;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, var(--acme-navy-dark) 0%, var(--acme-navy) 55%, var(--acme-navy-light) 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: var(--acme-white);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/images/mascot-hero-bureau.png') right center / auto 95% no-repeat;
  opacity: 0.15;
  pointer-events: none;
}

.hero__text {
  position: relative;
  z-index: 1;
}

.hero__text h1 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero__text h1 .accent {
  color: var(--acme-green-light);
}

.hero__text p {
  font-size: 0.92rem;
  opacity: 0.92;
  max-width: 420px;
  line-height: 1.5;
}

.hero__mascot {
  position: relative;
  z-index: 1;
  max-height: 220px;
  width: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  user-select: none;
  transition: none;
}

.hero__mascot:hover {
  transform: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
}

.hero__mission {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.hero__mission h2 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__mission a {
  color: var(--acme-green-light);
  font-weight: 600;
  font-size: 0.8rem;
}

/* À propos de l'intranet — voir css/about-intranet.css */

/* Accès rapides */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--acme-navy);
  margin-bottom: 1rem;
}

.quick-access {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.quick-card {
  background: var(--acme-white);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--acme-gray-100);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 45, 82, 0.12);
}

.quick-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.quick-card__icon--green { background: #3d9e4f; }
.quick-card__icon--blue { background: #3b82c4; }
.quick-card__icon--yellow { background: #e8a838; }
.quick-card__icon--purple { background: #7c5cbf; }
.quick-card__icon--teal { background: #2a9d8f; }
.quick-card__icon--red { background: #d64550; }
.quick-card__icon--lime { background: #6aaf2e; }
.quick-card__icon--navy { background: var(--acme-navy); }

.quick-card span {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--acme-gray-800);
  display: block;
}

/* Grille widgets */
.widgets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.widget {
  background: var(--acme-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--acme-gray-100);
  overflow: hidden;
}

.widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--acme-gray-100);
}

.widget__head h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--acme-navy);
}

.widget__head a {
  font-size: 0.78rem;
  font-weight: 500;
}

.widget__body {
  padding: 0.75rem 1rem 1rem;
}

/* Actualités */
.news-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--acme-gray-100);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item__thumb {
  width: 72px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--acme-gray-100);
  pointer-events: none;
  transition: none;
}

.news-item__thumb:hover {
  transform: none;
  filter: none;
}

.news-item__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--acme-navy-light);
  margin-bottom: 0.2rem;
}

.news-item__excerpt {
  font-size: 0.75rem;
  color: var(--acme-gray-500);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.news-item__date {
  font-size: 0.7rem;
  color: var(--acme-gray-500);
}

/* Annonces */
.announce-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--acme-gray-100);
}

.announce-item:last-child {
  border-bottom: none;
}

.announce-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.announce-item__icon--warn { background: #fff3e0; color: #e65100; }
.announce-item__icon--info { background: #e3f2fd; color: #1565c0; }
.announce-item__icon--ok { background: #e8f5e9; color: var(--acme-green); }
.announce-item__icon--star { background: #fff8e1; color: #f9a825; }

/* Documents */
.doc-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--acme-gray-100);
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

a.doc-item:hover {
  color: var(--acme-navy-light);
}

a.doc-item:hover .doc-item__name {
  color: var(--acme-green);
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-item i {
  font-size: 1.5rem;
  color: #c62828;
}

.doc-item__name {
  font-size: 0.82rem;
  font-weight: 500;
}

.doc-item__size {
  font-size: 0.72rem;
  color: var(--acme-gray-500);
}

/* Événements */
.event-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--acme-gray-100);
}

.event-item:last-child {
  border-bottom: none;
}

.event-item__date {
  width: 48px;
  text-align: center;
  background: var(--acme-navy);
  color: white;
  border-radius: 6px;
  padding: 0.35rem 0.25rem;
  flex-shrink: 0;
}

.event-item__date .day {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.event-item__date .month {
  font-size: 0.65rem;
  text-transform: uppercase;
}

.event-item__title {
  font-size: 0.85rem;
  font-weight: 600;
}

.event-item__meta {
  font-size: 0.72rem;
  color: var(--acme-gray-500);
}

/* Anniversaires */
.birthday-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.birthday-list {
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.birthday-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.4rem;
  font-size: 0.76rem;
  border-radius: 6px;
  line-height: 1.25;
}

.birthday-item img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.birthday-item__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
}

.birthday-item--today {
  background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
  border: 1px solid #f9a825;
  box-shadow: 0 2px 8px rgba(249, 168, 37, 0.35);
}

.birthday-item--today strong {
  color: #bf360c;
}

.birthday-item__badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: #e65100;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 0.12rem;
}

.widget-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--acme-gray-500);
}

.birthday-promo {
  text-align: center;
  padding: 0.5rem;
}

.birthday-promo img {
  max-width: 100px;
  opacity: 0.9;
}

.birthday-promo p {
  font-size: 0.75rem;
  color: var(--acme-green);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Sondage */
.poll-question {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.poll-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.poll-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--acme-navy);
  color: white;
}

.btn-primary:hover {
  background: var(--acme-navy-dark);
}

.btn-success {
  background: var(--acme-green);
  color: white;
}

.idea-box {
  margin-top: 1rem;
  padding: 0.85rem;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-radius: 8px;
  text-align: center;
  border: 1px dashed var(--acme-green);
}

.idea-box i {
  font-size: 1.75rem;
  color: var(--acme-green);
}

.idea-box p {
  font-size: 0.78rem;
  margin: 0.35rem 0 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--acme-gray-200);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--acme-gray-500);
}

.site-footer__links {
  display: flex;
  gap: 1.25rem;
}

/* Responsive */
@media (max-width: 1400px) {
  .quick-access {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .widgets-row {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__mascot {
    max-height: 160px;
    margin: 0 auto;
  }
  .hero__text p {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .intranet-shell {
    margin-left: 0;
  }
  .quick-access {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Images : aucun zoom / agrandissement au survol */
img:hover,
a:hover > img:not(.sidebar__logo-img),
.topbar__avatar:hover,
.hero__mascot:hover,
.news-item__thumb:hover,
.about-intranet-poster__hero-visual:hover,
.birthday-item:hover img,
.birthday-promo:hover img,
.emp-card:hover .emp-card__photo,
.trombi-item:hover img,
.trombi-item:hover .trombi-avatar {
  transform: none !important;
  scale: 1 !important;
}

/* Logo sidebar : taille fixe, aucun effet au survol (priorité maximale) */
.sidebar .sidebar__logo a,
.sidebar .sidebar__logo a:hover,
.sidebar .sidebar__logo a:focus,
.sidebar .sidebar__logo a:focus-visible,
.sidebar .sidebar__logo a:active,
.sidebar .sidebar__logo img,
.sidebar .sidebar__logo a img,
.sidebar .sidebar__logo a:hover img,
.sidebar .sidebar__logo img:hover,
.sidebar .sidebar__logo .sidebar__logo-img,
.sidebar .sidebar__logo a:hover .sidebar__logo-img {
  transform: none !important;
  -webkit-transform: none !important;
  scale: 1 !important;
  zoom: 1 !important;
  transition: none !important;
  animation: none !important;
  max-width: 180px !important;
  width: 100% !important;
  height: auto !important;
  filter: none !important;
  opacity: 1 !important;
}
