/* ============================================================
   MYONEART Manager - Design System
   MOA Digital Agency. Theme clair, marque navy + turquoise.
   Structure reprise du design system DPEM, palette MOA.
   Tokens > Base > Layout > Sidebar > Topbar > Composants
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* -- 1. TOKENS ------------------------------------------- */
:root {
  /* Menu lateral (navy MOA) */
  --sb-width: 264px;
  --sb-bg: #243a70;
  --sb-border: rgba(255,255,255,0.08);
  --sb-text: #AEBDD9;
  --sb-text-hover: #D8E1F0;
  --sb-text-active: #FFFFFF;
  --sb-item-hover: rgba(255,255,255,0.06);
  --sb-item-active: rgba(23,169,189,0.22);
  --sb-accent: #17A9BD;
  --sb-section: #7D8FB3;

  /* Barre superieure */
  --tb-height: 64px;
  --tb-bg: #FFFFFF;
  --tb-border: #EEF2F7;

  /* Surfaces */
  --body-bg: #F4F7FB;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;
  --card-radius: 12px;
  --card-shadow: 0 1px 3px rgba(36,58,112,0.07), 0 1px 2px rgba(36,58,112,0.04);
  --card-shadow-hover: 0 8px 24px rgba(36,58,112,0.12);

  /* Marque MOA */
  --primary: #2F4A8C;
  --primary-dark: #243a70;
  --primary-light: #EAF0FA;
  --primary-ring: rgba(47,74,140,0.22);
  --moa-teal: #17A9BD;
  --moa-teal-dark: #0f8496;

  /* Semantique */
  --success: #10B981; --success-light: #ECFDF5; --success-text: #065F46;
  --warning: #F59E0B; --warning-light: #FFFBEB; --warning-text: #92400E;
  --danger:  #EF4444; --danger-light:  #FEF2F2; --danger-text:  #991B1B;
  --info:    #3B82F6; --info-light:    #EFF6FF; --info-text:    #1E40AF;
  --purple:  #8B5CF6; --purple-light:  #F5F3FF; --purple-text:  #5B21B6;
  --teal:    #17A9BD; --teal-light:    #EAF7F9; --teal-text:    #0f8496;

  /* Texte */
  --t-primary:   #1A2233;
  --t-secondary: #334155;
  --t-muted:     #667085;
  --t-placeholder: #94A3B8;
  --border: #E2E8F0;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;
  --tr: all 0.15s ease;
  --tr-slow: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* -- 2. BASE --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--t-primary);
  margin: 0; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 6px; border: 2px solid var(--body-bg); }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* -- 3. LAYOUT ------------------------------------------- */
.moa-layout { display: flex; min-height: 100vh; }
.moa-content {
  flex: 1; min-width: 0; margin-left: var(--sb-width);
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left var(--tr-slow);
  position: relative; z-index: 0;
}
.moa-main { flex: 1; min-width: 0; padding: 1.75rem 2rem; }

/* -- 4. MENU LATERAL ------------------------------------- */
.moa-sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sb-width); height: 100vh;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column;
  z-index: 100; overflow: hidden;
  transition: var(--tr-slow);
}
/* Filet de marque : navy vers turquoise (equivalent MOA du bandeau tricolore DPEM). */
.moa-sidebar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary) 45%, var(--moa-teal));
  z-index: 2;
}
.moa-sidebar:hover { overflow-y: auto; }
.moa-sidebar::-webkit-scrollbar { width: 4px; }
.moa-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border: none; }

.moa-sb-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sb-border); flex-shrink: 0;
}
.moa-sb-logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; min-width: 0; }
.moa-sb-logo img { width: 38px; height: 38px; flex-shrink: 0; }
.moa-sb-logo-id { display: flex; flex-direction: column; min-width: 0; }
.moa-sb-logo-text { display: block; font-size: 0.95rem; font-weight: 800; color: #FFFFFF; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; }
.moa-sb-logo-sub { display: block; font-size: 0.6875rem; color: var(--sb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }

.moa-sb-nav { flex: 1; padding: 0.65rem 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.1rem; }
.moa-nav-section { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--sb-section); padding: 1rem 0.75rem 0.4rem; }
.moa-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.575rem 0.75rem; border-radius: var(--r-md);
  text-decoration: none; color: var(--sb-text);
  font-size: 0.875rem; font-weight: 500; transition: var(--tr);
  position: relative; white-space: nowrap;
}
.moa-nav-item:hover { color: var(--sb-text-hover); background: var(--sb-item-hover); }
.moa-nav-item.active { color: var(--sb-text-active); background: var(--sb-item-active); }
.moa-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--sb-accent); border-radius: 0 3px 3px 0;
}
.moa-nav-icon { width: 1.15rem; text-align: center; flex-shrink: 0; font-size: 0.9375rem; }
.moa-nav-label { flex: 1; }
.moa-nav-soon {
  flex-shrink: 0; font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--sb-section); background: rgba(255,255,255,0.08);
  border-radius: var(--r-full); padding: 0.15rem 0.45rem;
}

.moa-sb-footer { border-top: 1px solid var(--sb-border); padding: 0.75rem; flex-shrink: 0; }
.moa-sb-user { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: var(--r-md); cursor: pointer; transition: var(--tr); text-decoration: none; }
.moa-sb-user:hover { background: var(--sb-item-hover); }
.moa-avatar {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--primary), var(--moa-teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.moa-sb-user-name { font-size: 0.8125rem; font-weight: 600; color: var(--sb-text-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moa-sb-user-role { font-size: 0.6875rem; color: var(--sb-text); }

/* -- 5. BARRE SUPERIEURE --------------------------------- */
.moa-topbar {
  position: sticky; top: 0; height: var(--tb-height);
  background: var(--tb-bg); border-bottom: 1px solid var(--tb-border);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 0.85rem;
  z-index: 40; flex-shrink: 0;
}
.moa-topbar-toggle {
  display: none; width: 38px; height: 38px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--r-md); color: var(--t-muted);
  cursor: pointer; align-items: center; justify-content: center;
}
.moa-topbar-title { font-size: 1rem; font-weight: 700; color: var(--t-primary); }
.moa-topbar-sub { font-size: 0.75rem; color: var(--t-muted); margin-top: 1px; }
.moa-spacer { flex: 1; }
.moa-topbar-search {
  display: flex; align-items: center; gap: 0.5rem; width: 320px; max-width: 36vw;
  background: var(--body-bg); border: 1px solid var(--border); border-radius: var(--r-full);
  padding: 0.45rem 0.95rem; color: var(--t-muted);
}
.moa-topbar-search input { border: none; background: transparent; outline: none; font-family: var(--font); font-size: 0.8125rem; width: 100%; color: var(--t-primary); }
.moa-topbar-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--r-md); color: var(--t-muted);
  cursor: pointer; text-decoration: none; font-size: 0.95rem; position: relative; transition: var(--tr);
}
.moa-topbar-btn:hover { background: var(--body-bg); color: var(--t-primary); }
.moa-topbar-user {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  background: var(--body-bg); border: 1px solid var(--border); border-radius: var(--r-full);
  cursor: pointer; color: var(--t-primary); font-size: 0.8125rem; font-weight: 600; transition: var(--tr);
}
.moa-topbar-user:hover { border-color: var(--primary); }
.moa-avatar-sm { width: 30px; height: 30px; border-radius: var(--r-full); background: linear-gradient(135deg, var(--primary), var(--moa-teal)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.6875rem; font-weight: 700; }
.moa-avatar-photo { width: 36px; height: 36px; border-radius: var(--r-full); object-fit: cover; flex-shrink: 0; }
.moa-avatar-photo.sm { width: 30px; height: 30px; }

/* -- 6. EN-TETE DE PAGE ---------------------------------- */
.moa-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.moa-page-title { font-size: 1.4rem; font-weight: 800; color: var(--t-primary); letter-spacing: -0.02em; }
.moa-page-desc { font-size: 0.875rem; color: var(--t-muted); margin-top: 0.3rem; max-width: 60ch; }
.moa-breadcrumb { display: flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; color: var(--t-muted); margin-bottom: 0.6rem; }
.moa-breadcrumb a { text-decoration: none; }
.moa-breadcrumb a:hover { color: var(--primary); }
.moa-page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* -- 7. CARTES ------------------------------------------- */
.moa-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); }
.moa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--card-border); flex-wrap: wrap; }
.moa-card-title { font-size: 0.95rem; font-weight: 700; color: var(--t-primary); display: flex; align-items: center; gap: 0.55rem; }
.moa-card-title i { color: var(--primary); font-size: 0.9rem; }
.moa-card-sub { font-size: 0.75rem; color: var(--t-muted); margin-top: 2px; font-weight: 400; }
.moa-card-body { padding: 1.35rem; }
.moa-card-body.tight { padding: 0; }
.moa-card-foot { padding: 0.85rem 1.35rem; border-top: 1px solid var(--card-border); background: #FCFDFE; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

/* -- 8. CARTES STATISTIQUES ------------------------------ */
.moa-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.moa-stat { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 1.25rem; display: flex; align-items: flex-start; gap: 1rem; transition: var(--tr); }
.moa-stat:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.moa-stat-icon { width: 50px; height: 50px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.moa-stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.moa-stat-icon.teal { background: var(--teal-light); color: var(--teal-text); }
.moa-stat-icon.green { background: #ECFDF5; color: #059669; }
.moa-stat-icon.purple { background: #F5F3FF; color: #7C3AED; }
.moa-stat-icon.orange { background: #FFF7ED; color: #D97706; }
.moa-stat-icon.red { background: #FEF2F2; color: #DC2626; }
.moa-stat-icon.gray { background: #F1F5F9; color: #475569; }
.moa-stat-body { min-width: 0; flex: 1; }
.moa-stat-label { font-size: 0.8125rem; color: var(--t-muted); font-weight: 500; }
.moa-stat-value { font-size: 1.9rem; font-weight: 800; color: var(--t-primary); line-height: 1.1; letter-spacing: -0.02em; }
.moa-stat-trend { font-size: 0.75rem; margin-top: 0.3rem; display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.moa-stat-trend.up { color: var(--success); }
.moa-stat-trend.down { color: var(--danger); }
.moa-stat-trend.flat { color: var(--t-muted); }

/* -- 8b. ACTIONS RAPIDES --------------------------------- */
.moa-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; }
.moa-action { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; padding: 1rem; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--card-bg); text-decoration: none; transition: var(--tr); }
.moa-action:hover { border-color: var(--primary); box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.moa-action-ico { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.moa-action-label { font-size: 0.85rem; font-weight: 700; color: var(--t-primary); }
.moa-action-sub { font-size: 0.72rem; color: var(--t-muted); line-height: 1.35; }

/* -- 9. BOUTONS ------------------------------------------ */
.moa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.55rem 1rem; border-radius: var(--r-md); font-size: 0.875rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: var(--tr); border: 1px solid transparent; text-decoration: none; white-space: nowrap; line-height: 1.25; }
.moa-btn-primary { background: var(--primary); color: #fff; }
.moa-btn-primary:hover { background: var(--primary-dark); }
.moa-btn-teal { background: var(--moa-teal); color: #fff; }
.moa-btn-teal:hover { background: var(--moa-teal-dark); }
.moa-btn-secondary { background: var(--card-bg); color: var(--t-primary); border-color: var(--border); }
.moa-btn-secondary:hover { background: var(--body-bg); border-color: #CBD5E1; }
.moa-btn-danger { background: var(--danger); color: #fff; }
.moa-btn-danger:hover { background: #DC2626; }
.moa-btn-success { background: var(--success); color: #fff; }
.moa-btn-success:hover { background: #059669; }
.moa-btn-ghost { background: transparent; color: var(--t-secondary); }
.moa-btn-ghost:hover { background: var(--body-bg); }
.moa-btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.moa-btn-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; }
.moa-btn-icon { padding: 0.5rem; width: 38px; height: 38px; gap: 0; }
.moa-btn-block { width: 100%; }

/* -- 10. PASTILLES --------------------------------------- */
.moa-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border-radius: var(--r-full); font-size: 0.6875rem; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em; }
.moa-badge i { font-size: 0.55rem; }
.moa-badge-blue { background: var(--info-light); color: var(--info-text); }
.moa-badge-green { background: var(--success-light); color: var(--success-text); }
.moa-badge-yellow { background: var(--warning-light); color: var(--warning-text); }
.moa-badge-red { background: var(--danger-light); color: var(--danger-text); }
.moa-badge-purple { background: var(--purple-light); color: var(--purple-text); }
.moa-badge-teal { background: var(--teal-light); color: var(--teal-text); }
.moa-badge-gray { background: #F1F5F9; color: #475569; }
.moa-badge-navy { background: var(--primary-light); color: var(--primary-dark); }

.moa-dot { width: 8px; height: 8px; border-radius: var(--r-full); display: inline-block; flex-shrink: 0; }
.moa-dot.green { background: var(--success); }
.moa-dot.yellow { background: var(--warning); }
.moa-dot.red { background: var(--danger); }
.moa-dot.blue { background: var(--info); }
.moa-dot.teal { background: var(--moa-teal); }
.moa-dot.gray { background: #94A3B8; }

/* -- 11. FORMULAIRES ------------------------------------- */
.moa-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--t-secondary); margin-bottom: 0.4rem; }
.moa-label .req { color: var(--danger); }
.moa-input, .moa-select, .moa-textarea {
  width: 100%; padding: 0.6rem 0.8rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 0.875rem; font-family: var(--font); color: var(--t-primary);
  transition: var(--tr); outline: none;
}
.moa-input:focus, .moa-select:focus, .moa-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.moa-input::placeholder, .moa-textarea::placeholder { color: var(--t-placeholder); }
.moa-textarea { resize: vertical; min-height: 90px; }
.moa-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem; }
.moa-hint { font-size: 0.75rem; color: var(--t-muted); margin-top: 0.3rem; }
.moa-input-icon-wrap { position: relative; }
.moa-input-icon-wrap .moa-input { padding-left: 2.5rem; }
.moa-input-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--t-muted); font-size: 0.85rem; }
.moa-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.moa-field-full { grid-column: 1 / -1; }

.moa-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.moa-switch input { opacity: 0; width: 0; height: 0; }
.moa-switch span { position: absolute; inset: 0; background: #CBD5E1; border-radius: 999px; transition: var(--tr); cursor: pointer; }
.moa-switch span::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--tr); box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.moa-switch input:checked + span { background: var(--primary); }
.moa-switch input:checked + span::before { transform: translateX(18px); }

/* -- 12. TABLEAUX ---------------------------------------- */
.moa-table-wrap { overflow-x: auto; }
.moa-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.moa-table thead tr { border-bottom: 1px solid var(--border); }
.moa-table th { padding: 0.7rem 1rem; text-align: left; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--t-muted); white-space: nowrap; }
.moa-table td { padding: 0.85rem 1rem; color: var(--t-secondary); border-bottom: 1px solid #EEF2F7; vertical-align: middle; }
.moa-table tbody tr:last-child td { border-bottom: none; }
.moa-table tbody tr { transition: var(--tr); }
.moa-table tbody tr:hover td { background: #F8FAFC; }
.moa-table td .strong { color: var(--t-primary); font-weight: 600; }
.moa-table .num { font-variant-numeric: tabular-nums; }
.moa-cell-main { display: flex; align-items: center; gap: 0.7rem; }
.moa-cell-ico { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }

/* -- 13. ONGLETS ET PUCES -------------------------------- */
.moa-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.moa-tab { padding: 0.7rem 1rem; font-size: 0.8125rem; font-weight: 600; color: var(--t-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font); transition: var(--tr); display: inline-flex; align-items: center; gap: 0.45rem; }
.moa-tab:hover { color: var(--t-secondary); }
.moa-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.moa-tab-pane { display: none; }
.moa-tab-pane.active { display: block; animation: moa-fade 0.2s ease; }
@keyframes moa-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.moa-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.moa-chip { padding: 0.4rem 0.85rem; border-radius: var(--r-full); font-size: 0.75rem; font-weight: 600; border: 1px solid var(--border); background: var(--card-bg); color: var(--t-secondary); cursor: pointer; transition: var(--tr); font-family: var(--font); text-decoration: none; }
.moa-chip:hover { border-color: #CBD5E1; }
.moa-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* -- 14. BARRE DE FILTRES -------------------------------- */
.moa-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.moa-filters .moa-select, .moa-filters .moa-input { width: auto; min-width: 150px; padding: 0.45rem 0.7rem; font-size: 0.8125rem; }
.moa-filters .moa-input-icon-wrap .moa-input { padding-left: 2.25rem; }

/* -- 15. PROGRESSION ------------------------------------- */
.moa-progress { height: 8px; background: #EEF2F7; border-radius: 999px; overflow: hidden; }
.moa-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.moa-progress > span.teal { background: var(--moa-teal); }
.moa-progress > span.green { background: var(--success); }
.moa-progress > span.orange { background: var(--warning); }
.moa-progress > span.red { background: var(--danger); }

/* -- 16. FRISE ------------------------------------------- */
.moa-timeline { position: relative; padding-left: 1.75rem; }
.moa-timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.moa-tl-item { position: relative; padding-bottom: 1.35rem; }
.moa-tl-item:last-child { padding-bottom: 0; }
.moa-tl-dot { position: absolute; left: -1.75rem; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card-bg); border: 3px solid var(--primary); }
.moa-tl-dot.teal { border-color: var(--moa-teal); }
.moa-tl-dot.green { border-color: var(--success); }
.moa-tl-dot.red { border-color: var(--danger); }
.moa-tl-dot.gray { border-color: #CBD5E1; }
.moa-tl-time { font-size: 0.7rem; color: var(--t-muted); }
.moa-tl-title { font-size: 0.8125rem; font-weight: 600; color: var(--t-primary); margin: 1px 0 2px; }
.moa-tl-desc { font-size: 0.8125rem; color: var(--t-muted); }

/* -- 17. MENUS DEROULANTS -------------------------------- */
.moa-dropdown { position: relative; }
.moa-dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  box-shadow: 0 12px 28px rgba(36,58,112,0.16); padding: 0.4rem; z-index: 200;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: var(--tr);
}
.moa-dropdown.open .moa-dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.moa-dropdown-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.7rem; border-radius: var(--r-md); text-decoration: none; color: var(--t-secondary); font-size: 0.8125rem; transition: var(--tr); cursor: pointer; }
.moa-dropdown-item:hover { background: var(--body-bg); color: var(--t-primary); }
.moa-dropdown-item i { width: 1rem; text-align: center; color: var(--t-muted); }
.moa-dropdown-item.danger { color: var(--danger); }
.moa-dropdown-item.danger i { color: var(--danger); }
.moa-dropdown-divider { height: 1px; background: var(--border); margin: 0.3rem 0; }
.moa-dropdown-header { padding: 0.55rem 0.7rem 0.3rem; font-size: 0.7rem; font-weight: 700; color: var(--t-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* -- 18. ETAT VIDE --------------------------------------- */
.moa-empty { text-align: center; padding: 3rem 1.5rem; }
.moa-empty-icon { font-size: 2.5rem; color: var(--t-muted); opacity: 0.35; margin-bottom: 1rem; }
.moa-empty-title { font-size: 1rem; font-weight: 700; color: var(--t-primary); margin-bottom: 0.4rem; }
.moa-empty-desc { font-size: 0.875rem; color: var(--t-muted); max-width: 40ch; margin: 0 auto; }

/* -- 19. ENCARTS ----------------------------------------- */
.moa-alert { display: flex; gap: 0.75rem; padding: 0.9rem 1.1rem; border-radius: var(--r-lg); font-size: 0.8125rem; border: 1px solid; }
.moa-alert i { font-size: 0.95rem; margin-top: 1px; }
.moa-alert-info { background: var(--info-light); border-color: #BFDBFE; color: var(--info-text); }
.moa-alert-warning { background: var(--warning-light); border-color: #FDE68A; color: var(--warning-text); }
.moa-alert-danger { background: var(--danger-light); border-color: #FECACA; color: var(--danger-text); }
.moa-alert-success { background: var(--success-light); border-color: #A7F3D0; color: var(--success-text); }
.moa-alert-teal { background: var(--teal-light); border-color: #BEE3E9; color: var(--teal-text); }

/* -- 20. NOTIFICATIONS FLOTTANTES ------------------------ */
.moa-toasts { position: fixed; top: calc(var(--tb-height) + 1rem); right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 300; max-width: 380px; }
.moa-toast { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 1rem; background: var(--card-bg); border: 1px solid var(--card-border); border-left: 3px solid var(--primary); border-radius: var(--r-lg); box-shadow: 0 8px 20px rgba(36,58,112,0.14); animation: moa-toast-in 0.25s ease; }
.moa-toast.success { border-left-color: var(--success); }
.moa-toast.warning { border-left-color: var(--warning); }
.moa-toast.error { border-left-color: var(--danger); }
@keyframes moa-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* -- 21. FENETRES MODALES -------------------------------- */
.moa-modal-overlay { position: fixed; inset: 0; background: rgba(26,34,51,0.45); display: none; align-items: center; justify-content: center; z-index: 400; padding: 1rem; }
.moa-modal-overlay.open { display: flex; animation: moa-fade 0.15s ease; }
.moa-modal { background: var(--card-bg); border-radius: var(--r-xl); box-shadow: 0 24px 60px rgba(26,34,51,0.3); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.moa-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--border); }
.moa-modal-body { padding: 1.4rem; }
.moa-modal-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.6rem; }

/* -- 22. TABLEAU DES TACHES (kanban) --------------------- */
/* 200px de large : les cinq colonnes de statut tiennent sur une seule rangee
   dans la zone de contenu (1230px environ), au lieu de passer a la ligne. */
.moa-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; align-items: start; }
.moa-col { background: #F8FAFC; border: 1px solid var(--card-border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; }
.moa-col-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--card-border); }
.moa-col-title { font-size: 0.8125rem; font-weight: 700; color: var(--t-primary); }
.moa-col-count { margin-left: auto; background: var(--border); color: var(--t-secondary); font-size: 0.65rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.moa-col-body { padding: 0.65rem; display: flex; flex-direction: column; gap: 0.55rem; min-height: 60px; }
.moa-task { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 0.7rem 0.8rem; box-shadow: var(--card-shadow); transition: var(--tr); text-decoration: none; display: block; }
.moa-task:hover { box-shadow: var(--card-shadow-hover); border-color: var(--primary); }
.moa-task-title { font-size: 0.8125rem; font-weight: 600; color: var(--t-primary); line-height: 1.35; }
.moa-task-meta { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.5rem; flex-wrap: wrap; font-size: 0.7rem; color: var(--t-muted); }
.moa-task.retard { border-left: 3px solid var(--danger); }

/* -- 23. LIGNES DE LISTE --------------------------------- */
.moa-listrow { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1rem; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--card-bg); transition: var(--tr); flex-wrap: wrap; }
.moa-listrow:hover { box-shadow: var(--card-shadow-hover); }
.moa-listrow-ico { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }

/* -- 24. ZONE DE TELEVERSEMENT --------------------------- */
.moa-upload { border: 2px dashed var(--border); border-radius: var(--r-lg); padding: 1.6rem 1rem; text-align: center; color: var(--t-muted); cursor: pointer; transition: var(--tr); background: #FCFDFE; }
.moa-upload:hover, .moa-upload:focus-visible, .moa-upload.drag { border-color: var(--primary); color: var(--primary); background: var(--primary-light); outline: none; }
.moa-upload .ic { font-size: 1.5rem; margin-bottom: 0.5rem; }
.moa-upload.ok { border-style: solid; border-color: var(--success); color: var(--success); background: var(--success-light); }

/* -- 25. CONNEXION --------------------------------------- */
.moa-auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(120% 90% at 50% 0%, #2F4A8C 0%, #243a70 55%, #1b2c55 100%); }
.moa-auth-card { width: 100%; max-width: 420px; background: var(--card-bg); border-radius: var(--r-xl); box-shadow: 0 24px 60px rgba(15,23,42,0.35); overflow: hidden; }
.moa-auth-head { padding: 2rem 2rem 1.25rem; text-align: center; }
.moa-auth-head img { width: 56px; height: 56px; margin: 0 auto 0.9rem; display: block; }
.moa-auth-title { font-size: 1.2rem; font-weight: 800; color: var(--t-primary); letter-spacing: -0.01em; }
.moa-auth-sub { font-size: 0.8125rem; color: var(--t-muted); margin-top: 0.35rem; }
.moa-auth-body-form { padding: 0 2rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.moa-auth-foot { padding: 1rem 2rem 1.5rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.72rem; color: var(--t-muted); }
.moa-otp-row { display: flex; gap: 0.5rem; justify-content: center; }
.moa-otp-input { width: 46px; height: 54px; text-align: center; font-size: 1.3rem; font-weight: 700; font-family: var(--font);
  border: 1px solid var(--border); border-radius: var(--r-md); color: var(--t-primary); outline: none; transition: var(--tr); }
.moa-otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* -- 26. UTILITAIRES ------------------------------------- */
.moa-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.moa-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
/* align-items:start : sans lui, une carte courte (tableau vide) s'etire a la
   hauteur de sa voisine (un long formulaire) et laisse un grand blanc. */
.moa-split { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
.moa-split > * { min-width: 0; }
.moa-flex { display: flex; align-items: center; gap: 0.6rem; }
.moa-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.moa-flex-wrap { flex-wrap: wrap; }
.moa-mt { margin-top: 1.25rem; }
.moa-mt-sm { margin-top: 0.75rem; }
.moa-muted { color: var(--t-muted); }
.moa-small { font-size: 0.8125rem; }
.moa-xs { font-size: 0.75rem; }
.moa-strong { font-weight: 700; color: var(--t-primary); }
.moa-divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.moa-kv { display: flex; flex-direction: column; gap: 0.15rem; }
.moa-kv-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--t-muted); font-weight: 600; }
.moa-kv-value { font-size: 0.875rem; color: var(--t-primary); font-weight: 500; }
.moa-def-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem 1.5rem; }

/* Pastilles de comptage : menu lateral et cloche. */
.moa-nav-pastille, .moa-notif-compteur {
  background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.moa-nav-pastille { margin-left: auto; flex-shrink: 0; }
.moa-notif-compteur { position: absolute; top: 2px; right: 2px; box-shadow: 0 0 0 2px var(--card-bg); }
.moa-nav-compteur {
  margin-left: auto; background: var(--border); color: var(--t-secondary);
  font-size: 0.65rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
}

/* -- 27. RESPONSIVE -------------------------------------- */
@media (max-width: 1024px) {
  .moa-split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .moa-sidebar { transform: translateX(-100%); }
  .moa-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .moa-content { margin-left: 0; }
  .moa-topbar-toggle { display: flex; }
  .moa-topbar-search { display: none; }
  .moa-main { padding: 1.25rem; }
  .moa-sidebar-backdrop { position: fixed; inset: 0; background: rgba(26,34,51,0.5); z-index: 90; display: none; }
  .moa-sidebar-backdrop.open { display: block; }
}
@media (max-width: 560px) {
  .moa-page-title { font-size: 1.2rem; }
  .moa-topbar-title { display: none; }
  /* Sur telephone l'avatar suffit a identifier le compte : afficher en plus le
     prenom poussait la page au-dela de l'ecran. */
  .moa-topbar-user > span:not(.moa-avatar-sm), .moa-topbar-user > i { display: none; }
}
