/* =====================================================
   MAP — Mon Activité Pro | style.css
   ===================================================== */

:root {
  /* Palette alignée sur assets/img/logo-login.png (2026-08-24) — couleurs extraites par
     échantillonnage de pixels (PHP GD), cf. CLAUDE.md pour le détail des valeurs et des choix.
     Turquoise dominant (sur demande explicite) plutôt que le violet du logo : --marine est une
     teinte turquoise foncée (pas le turquoise vif du logo, trop clair comme couleur de texte —
     contraste WCAG insuffisant) qui sert de couleur structurante (fond sidebar/login ET texte sur
     fond clair) ; --teal reste le turquoise vif du logo, réservé aux accents décoratifs. Le violet
     du logo redevient un accent secondaire (--violet), plus la couleur dominante. */
  --bg:         #F4F3EE;
  --beige-rose: #D9EDEB;
  --marine:     #0C6E73;
  --peche:      #FFCDA0;
  --dore:       #F2941C;
  --mauve:      #B8ACD9;
  --teal:       #1098A0;
  --violet:     #503088;

  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-width: 240px;
  --header-height: 60px;

  --text-dark:  #1a1a2e;
  --text-muted: #6b7280;
  --white:      #ffffff;

  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 2px 8px rgba(12,110,115,0.08);
  --shadow-md:  0 4px 16px rgba(12,110,115,0.12);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 15px;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* === LAYOUT === */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--marine);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease;
}

.sidebar-toggle {
  position: absolute;
  top: 1.35rem;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--dore);
  color: var(--marine);
  border: 2px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  z-index: 101;
  transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--peche); }
.sidebar-toggle i { transition: transform 0.2s ease; }

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text { min-width: 0; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dore);
  letter-spacing: 3px;
}

.brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.sidebar-slogan {
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  font-style: italic;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  border-left-color: rgba(255,255,255,0.2);
}

.nav-item.active {
  background: rgba(232,168,69,0.12);
  color: var(--dore);
  border-left-color: var(--dore);
  font-weight: 600;
}

.nav-icon { font-size: 0.95rem; width: 1.2rem; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* SIDEBAR RÉDUITE (desktop, bascule via #sidebarToggle, mémorisée en localStorage) */
html.sidebar-collapsed .sidebar { width: 64px; }
html.sidebar-collapsed .main-content { margin-left: 64px; }
html.sidebar-collapsed .sidebar-brand { padding: 1.25rem 0.5rem; justify-content: center; }
html.sidebar-collapsed .brand-logo { width: 28px; height: 28px; margin-bottom: 0; }
html.sidebar-collapsed .brand-name { display: none; }
html.sidebar-collapsed .brand-sub { display: none; }
html.sidebar-collapsed .sidebar-slogan { display: none; }
html.sidebar-collapsed .nav-item { justify-content: center; padding: 0.7rem 0; }
html.sidebar-collapsed .nav-item span { display: none; }
html.sidebar-collapsed .sidebar-footer { display: none; }
html.sidebar-collapsed .sidebar-toggle i { transform: rotate(180deg); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

/* TOP HEADER */
.top-header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--beige-rose);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.page-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--marine); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mauve);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--marine);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.page-content { flex: 1; padding: 1.5rem; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  color: var(--marine);
  font-size: 1.1rem;
  line-height: 1;
}

/* === COMPOSANTS === */

/* CARDS */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--beige-rose);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title { font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; color: var(--marine); }
.card-body  { padding: 1.25rem; }

/* STAT CARDS */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--dore);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stat-card.accent-mauve  { border-left-color: var(--mauve); }
.stat-card.accent-peche  { border-left-color: var(--peche); }
.stat-card.accent-marine { border-left-color: var(--marine); }
.stat-card.accent-teal   { border-left-color: var(--teal); }
.stat-card.accent-violet { border-left-color: var(--violet); }

.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--marine); line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-icon  { font-size: 1.75rem; color: var(--beige-rose); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.25;
  white-space: nowrap;
}

.btn-primary { background: var(--marine); color: var(--white); }
.btn-primary:hover { background: #0a5e62; }

.btn-accent { background: var(--dore); color: var(--marine); }
.btn-accent:hover { background: #ce7e18; }

.btn-outline { background: transparent; color: var(--marine); border-color: var(--beige-rose); }
.btn-outline:hover { background: var(--bg); }

.btn-danger { background: #dc2626; color: var(--white); }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: #16a34a; color: var(--white); }
.btn-success:hover { background: #15803d; }

.btn-sm   { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-lg   { padding: 0.7rem 1.4rem; font-size: 1rem; }
.btn-icon { padding: 0.45rem 0.6rem; }

/* FORMS */
.form-group  { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--marine);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--beige-rose);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--white);
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--mauve);
  box-shadow: 0 0 0 3px rgba(184,172,217,0.25);
}

.form-control::placeholder { color: #bbb; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 1.25rem; }

/* TABLES */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--beige-rose);
  white-space: nowrap;
  background: var(--white);
}

tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid rgba(230,201,175,0.35); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(244,243,238,0.7); }

/* ALERTS */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid transparent;
}

.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fff5f5; color: #9b1c1c; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary { background: rgba(184,172,217,0.25); color: var(--marine); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-muted   { background: #f3f4f6; color: var(--text-muted); }

/* GRIDS */
.grid   { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* UTILITIES */
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-end     { display: flex; justify-content: flex-end; align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ms-auto { margin-left: auto; }
.text-muted  { color: var(--text-muted); }
.text-marine { color: var(--marine); }
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.w-100  { width: 100%; }
.d-none { display: none; }

hr { border: none; border-top: 1px solid var(--beige-rose); margin: 1rem 0; }

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.content-header h1 { font-size: 1.25rem; font-weight: 700; color: var(--marine); }

/* PAGINATION */
.pagination { display: flex; gap: 0.25rem; align-items: center; justify-content: center; margin-top: 1rem; }

.page-link {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  border: 1px solid var(--beige-rose);
  color: var(--marine);
  transition: var(--transition);
}

.page-link:hover,
.page-link.active { background: var(--marine); color: var(--white); border-color: var(--marine); }

/* === MODALE === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,31,94,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  text-align: center;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-icon {
  font-size: 2.5rem;
  color: #dc2626;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--marine);
  margin-bottom: 0.5rem;
}

.modal-msg {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* === PAGE LOGIN === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--marine);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(184,172,217,0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(242,148,28,0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 95%, rgba(80,48,136,0.22) 0%, transparent 55%);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .brand-name { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: var(--marine); letter-spacing: 4px; }
.login-logo .brand-tagline { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.login-card .form-control { padding: 0.65rem 0.875rem; font-size: 0.9rem; }
.login-card .btn { padding: 0.65rem 1rem; font-size: 0.95rem; width: 100%; justify-content: center; margin-top: 0.25rem; }

/* === PAGE SETUP === */
.setup-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.setup-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}

.setup-card h1 { color: var(--marine); font-size: 1.4rem; margin-bottom: 0.35rem; }
