/* ═══════════════════════════════════════════════════════════════
   FamilyTrak — Design System (Revolut Light inspired)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Sidebar */
  --sidebar-bg: #0D0F1C;
  --sidebar-bg2: #141728;
  --sidebar-text: #8B92A9;
  --sidebar-text-hover: #C8CCE0;
  --sidebar-text-active: #FFFFFF;
  --sidebar-active-bg: rgba(124,58,237,0.18);
  --sidebar-active-border: #7C3AED;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;

  /* Content */
  --bg: #F4F5FB;
  --card-bg: #FFFFFF;
  --card-border: #E8EAF2;
  --card-shadow: 0 1px 4px rgba(13,15,28,0.07), 0 4px 16px rgba(13,15,28,0.04);
  --card-shadow-hover: 0 4px 16px rgba(13,15,28,0.12), 0 8px 32px rgba(13,15,28,0.06);

  /* Typography */
  --text-primary: #0D0F1C;
  --text-secondary: #6B7291;
  --text-muted: #9EA5C1;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Accents */
  --purple: #7C3AED;
  --purple-light: #EDE9FD;
  --green: #10B981;
  --green-light: #D1FAE5;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --pink: #EC4899;
  --pink-light: #FCE7F3;
  --teal: #14B8A6;
  --teal-light: #CCFBF1;

  /* Header */
  --header-bg: #FFFFFF;
  --header-border: #E8EAF2;
  --header-height: 64px;

  /* Misc */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ─── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

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

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left var(--transition);
}

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--purple) 0%, #9F67FF 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

.logo-text {
  font-size: 16px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  transition: opacity var(--transition);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 450;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
  cursor: pointer;
}
.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
}
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--sidebar-active-border);
  border-radius: 0 3px 3px 0;
}

.nav-separator {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 8px 4px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.logout-btn { color: #F87171 !important; }
.logout-btn:hover { background: rgba(239,68,68,0.1) !important; }

/* ─── TOP HEADER ──────────────────────────────────────────────── */
.top-header {
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.sidebar-toggle {
  width: 36px; height: 36px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition);
  display: none;
}
.sidebar-toggle:hover { background: var(--bg); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.header-title {
  font-size: 16px; font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.header-actions {
  display: flex; align-items: center; gap: 12px;
}

.notif-bell {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.notif-bell:hover { background: var(--bg); color: var(--text-primary); }
.notif-bell svg { width: 20px; height: 20px; }

.notif-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.header-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.header-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* ─── PAGE CONTENT ────────────────────────────────────────────── */
.page-content {
  padding: 28px 32px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.page-header p {
  font-size: 14px; color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle { font-size: 12px; color: var(--text-muted); }

/* ─── KPI CARDS ───────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.kpi-purple .kpi-icon { background: var(--purple-light); color: var(--purple); }
.kpi-green  .kpi-icon { background: var(--green-light);  color: var(--green); }
.kpi-red    .kpi-icon { background: var(--red-light);    color: var(--red); }
.kpi-orange .kpi-icon { background: var(--orange-light); color: var(--orange); }
.kpi-blue   .kpi-icon { background: var(--blue-light);   color: var(--blue); }
.kpi-pink   .kpi-icon { background: var(--pink-light);   color: var(--pink); }

/* ─── GRIDS ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ─── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-danger  { background: var(--red-light);    color: var(--red); }
.badge-warning { background: var(--orange-light);  color: #B45309; }
.badge-info    { background: var(--blue-light);   color: #1D4ED8; }
.badge-success { background: var(--green-light);  color: #065F46; }
.badge-purple  { background: var(--purple-light); color: var(--purple); }
.badge-pink    { background: var(--pink-light);   color: var(--pink); }
.badge-muted   { background: #F1F3F9; color: var(--text-secondary); }

/* ─── AVATARS ─────────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 56px; height: 56px; font-size: 18px; }

/* ─── BOUTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.btn-primary:hover { background: #6D28D9; box-shadow: 0 4px 12px rgba(124,58,237,0.4); }

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: #ECEEF7; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  padding: 6px 8px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }
.btn-ghost svg { width: 15px; height: 15px; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ─── FORMULAIRES ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

/* ─── TABLE ───────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F3F9;
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFF; }

/* ─── FILTRES MEMBRES ─────────────────────────────────────────── */
.member-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.member-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--card-border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.member-filter-btn:hover { border-color: var(--purple); color: var(--purple); }
.member-filter-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.member-filter-btn .avatar-sm { width: 20px; height: 20px; font-size: 9px; }

/* ─── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13,15,28,0.5);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(13,15,28,0.2);
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 680px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg); border: none; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--red-light); color: var(--red); }
.modal-close svg { width: 16px; height: 16px; }

/* ─── KANBAN ──────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-col {
  background: #F1F3FB;
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 400px;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.kanban-col-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.kanban-count {
  background: var(--card-bg);
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: box-shadow var(--transition);
  box-shadow: var(--card-shadow);
}
.kanban-card:hover { box-shadow: var(--card-shadow-hover); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card.drag-over { border: 2px dashed var(--purple); }
.kanban-card-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.kanban-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ─── TIMELINE CALENDRIER ─────────────────────────────────────── */
.calendar-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}
.calendar-title { font-size: 15px; font-weight: 600; }
.calendar-nav { display: flex; gap: 4px; }
.calendar-nav button {
  width: 32px; height: 32px;
  background: var(--bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.calendar-nav button:hover { background: var(--purple-light); color: var(--purple); }
.calendar-nav button svg { width: 16px; height: 16px; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.calendar-day-name {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.calendar-day {
  min-height: 80px;
  padding: 6px;
  border-top: 1px solid var(--card-border);
  border-left: 1px solid var(--card-border);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.calendar-day:hover { background: #FAFBFF; }
.calendar-day.today .day-num {
  background: var(--purple);
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.calendar-day.other-month { background: #FAFBFF; opacity: 0.6; }
.day-num { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.day-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.day-dot {
  width: 7px; height: 7px; border-radius: 50%;
}

/* ─── TIMELINE ÉCHÉANCES ──────────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute; left: 9px; top: 0; bottom: 0;
  width: 2px; background: var(--card-border);
}
.timeline-month { margin-bottom: 24px; }
.timeline-month-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 12px; margin-left: -24px;
  padding-left: 24px;
}
.timeline-item {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow var(--transition);
}
.timeline-item:hover { box-shadow: var(--card-shadow); }
.timeline-item::before {
  content: '';
  position: absolute; left: -19px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
}
.timeline-item.urgent::before { border-color: var(--red); background: var(--red); }
.timeline-item.warning::before { border-color: var(--orange); background: var(--orange); }
.timeline-item.info::before { border-color: var(--blue); background: var(--blue); }

/* ─── ALERTE BANDEAU ──────────────────────────────────────────── */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: var(--blue-light);   color: #1E40AF; }
.alert-warning { background: var(--orange-light); color: #92400E; }
.alert-danger  { background: var(--red-light);    color: #991B1B; }
.alert-success { background: var(--green-light);  color: #065F46; }

/* ─── SEMAINIER ───────────────────────────────────────────────── */
.timetable-wrapper { overflow-x: auto; }
.timetable {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  min-width: 700px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
}
.tt-header {
  background: #FAFBFF;
  padding: 12px 8px;
  text-align: center;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}
.tt-time {
  padding: 0 8px;
  font-size: 11px; color: var(--text-muted);
  text-align: right;
  display: flex; align-items: flex-start;
  padding-top: 6px;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid #F1F3F9;
}
.tt-cell {
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid #F1F3F9;
  min-height: 32px;
  position: relative;
}
.tt-cell:last-child { border-right: none; }
.tt-event {
  position: absolute; left: 2px; right: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px; font-weight: 600; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer; z-index: 1;
  opacity: 0.9;
  transition: opacity var(--transition);
}
.tt-event:hover { opacity: 1; }

/* ─── BUDGET CHARTS PLACEHOLDER ──────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ─── PROGRESS BAR ────────────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: #F1F3F9;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-purple { background: linear-gradient(90deg, var(--purple) 0%, #9F67FF 100%); }
.progress-green  { background: linear-gradient(90deg, var(--green) 0%, #34D399 100%); }
.progress-red    { background: linear-gradient(90deg, var(--red) 0%, #F87171 100%); }
.progress-orange { background: linear-gradient(90deg, var(--orange) 0%, #FCD34D 100%); }

/* ─── TABS ────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── TOGGLE ──────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  width: 40px; height: 22px;
  background: var(--card-border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked ~ .toggle-knob { transform: translateX(18px); }
.toggle input:checked + .toggle-knob { transform: translateX(18px); }
.toggle:has(input:checked) { background: var(--purple); }

/* ─── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ─── TOOLTIP ─────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1000;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── DROPDOWN ────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow-hover);
  min-width: 160px;
  z-index: 50;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 13px; color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item svg { width: 15px; height: 15px; }

/* ─── SPARKLINE ───────────────────────────────────────────────── */
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 32px; }
.sparkline-bar {
  flex: 1; border-radius: 2px;
  min-height: 4px;
  transition: height 0.5s ease;
}

/* ─── SEARCH BAR ──────────────────────────────────────────────── */
.search-bar {
  position: relative;
}
.search-bar svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar input { padding-left: 34px; }

/* ─── ANNUELLES CALENDAR (Congés) ─────────────────────────────── */
.annual-calendar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.month-mini { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 12px; }
.month-mini-title { font-size: 12px; font-weight: 700; text-align: center; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.month-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.month-mini-day { text-align: center; font-size: 10px; padding: 3px 1px; border-radius: 3px; }
.month-mini-day.header { color: var(--text-muted); font-weight: 600; }
.month-mini-day.ferie { background: var(--orange-light); color: #92400E; font-weight: 600; }
.month-mini-day.weekend { color: var(--text-muted); }

/* ─── TOAST ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  max-width: 340px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--orange); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── SANTÉ WIDGETS ───────────────────────────────────────────── */
.health-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}
.health-stat:last-child { border-bottom: none; }
.health-stat-label { font-size: 13px; color: var(--text-secondary); }
.health-stat-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ─── UPLOAD ZONE ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.upload-zone:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.upload-zone svg { width: 24px; height: 24px; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; }
.upload-zone .file-name { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-top: 6px; }

/* ─── IMMOBILIER BLOCS ────────────────────────────────────────── */
.property-hero {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.property-hero::before {
  content: '🏠';
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  font-size: 64px; opacity: 0.15;
}

/* ─── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── PAGE LOGIN ──────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--sidebar-bg);
}
.login-left {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: linear-gradient(135deg, #0D0F1C 0%, #1E1B4B 100%);
}
.login-brand { text-align: center; color: #fff; }
.login-brand-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--purple) 0%, #9F67FF 100%);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 12px 32px rgba(124,58,237,0.4);
}
.login-brand h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.login-brand p { color: rgba(255,255,255,0.5); font-size: 15px; margin-top: 8px; }
.login-brand-members {
  display: flex; justify-content: center; gap: 12px;
  margin-top: 40px;
}
.login-member-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center; color: rgba(255,255,255,0.7);
}
.login-member-card .avatar { margin: 0 auto 8px; }
.login-member-card span { font-size: 12px; font-weight: 500; display: block; }

.login-right {
  width: 480px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 40px;
}
.login-form-box { width: 100%; max-width: 360px; }
.login-form-box h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-form-box > p { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.login-error {
  background: var(--red-light);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .annual-calendar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .annual-calendar { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .member-filters { gap: 4px; }
  .member-filter-btn { padding: 5px 10px; font-size: 12px; }
}

/* ─── PRINT ───────────────────────────────────────────────────── */
@media print {
  .sidebar, .top-header, .btn, .modal-overlay { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
