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

/* ── DESIGN TOKENS ── */
:root {
  --primary: #FF8C3B;
  --primary-dark: #FF6348;
  --gradient: linear-gradient(270deg, #FF8C3B 0%, #FF6348 93.6%);
  --gradient-icon: linear-gradient(269.9deg, #FF8C3B 0%, #FF6348 93.6%);
  --bg: #F8F8F8;
  --bg-content: #F6F7F8;
  --white: #FFFFFF;
  --text-dark: #101828;
  --text-medium: #29303A;
  --text-muted: #727272;
  --text-light: #9B9B9B;
  --text-disabled: rgba(41,48,58,0.5);
  --border: rgba(41,48,58,0.3);
  --shadow: 0 1px 1.5px rgba(0,0,0,0.1), 0 1px 1px rgba(0,0,0,0.1);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.1);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 249px;
  --font: 'Plus Jakarta Sans', sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text-medium); font-size: 14px; line-height: 20px; display: flex; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
input, button, select, textarea { font-family: var(--font); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--white); display: flex; flex-direction: column;
  justify-content: space-between; padding: 16px;
  height: 100vh; position: sticky; top: 0;
  box-shadow: var(--shadow); z-index: 10;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; margin-bottom: 20px; }
.sidebar-logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 36px; height: 29px; }
.logo-text { font-family: sans-serif; font-size: 14.25px; color: var(--text-medium); white-space: nowrap; }
.logo-text span { color: #F57C00; }
.sidebar-hamburger { background: none; border: none; cursor: pointer; padding: 0; }
.sidebar-zaac {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1.5px solid var(--primary); border-radius: var(--radius);
  background: var(--white); cursor: pointer; width: 100%; margin-bottom: 20px;
  transition: background 0.15s;
}
.sidebar-zaac:hover { background: #FFF8F5; }
.zaac-icon { width: 26px; height: 25px; }
.zaac-label { font-size: 14px; font-weight: 600; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; white-space: nowrap; }
.sidebar-nav { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.nav-section { display: flex; flex-direction: column; gap: 8px; }
.nav-section-title { font-size: 13px; color: var(--text-light); padding: 4px 10px; }
.nav-items { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-medium); transition: background 0.15s; white-space: nowrap; }
.nav-item:hover { background: #F3F4F6; }
.nav-item.active { background: var(--gradient); color: var(--white); }
.nav-item.active svg * { stroke: white !important; fill: white !important; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { height: 40px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md); box-shadow: var(--shadow); background: var(--white); margin-top: 16px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#E0E0E0,#C4C4C4); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; color: #000; line-height: 20px; }
.user-role { font-size: 12px; color: var(--text-light); line-height: 16px; }
.user-caret { width: 20px; height: 20px; opacity: 0.5; }

/* ─── MAIN ─────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; background: var(--bg-content); padding: 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }

/* ─── TOPBAR ─────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.topbar-filters { display: flex; align-items: center; gap: 16px; }
.filter-label { font-size: 12px; color: var(--text-disabled); white-space: nowrap; }
.filter-btn { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); border: none; cursor: pointer; font-size: 14px; color: var(--text-medium); white-space: nowrap; transition: background 0.15s; }
.filter-btn:hover { background: #F9FAFB; }
.filter-btn svg { width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-input { width: 340px; height: 34px; padding: 0 40px 0 20px; background: rgba(202,199,199,0.1); border: none; border-radius: 10px; box-shadow: var(--shadow-md); font-family: var(--font); font-size: 12px; color: var(--text-disabled); outline: none; }
.search-input::placeholder { color: var(--text-disabled); }
.search-btn { position: absolute; right: 0; top: 0; width: 34px; height: 34px; background: var(--white); border-radius: 10px; box-shadow: var(--shadow); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn { width: 34px; height: 34px; background: var(--white); border-radius: 10px; box-shadow: var(--shadow); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.icon-btn:hover { background: #F9FAFB; }
.notif-group { display: flex; align-items: center; gap: 12px; }
.notif-divider { width: 1px; height: 25px; background: #E0E0E0; }

/* ─── PAGE HEADER ──────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.page-title { font-size: 16px; font-weight: 600; color: var(--text-dark); }
.page-actions { display: flex; align-items: center; gap: 12px; }
.btn-primary { display: flex; align-items: center; gap: 8px; padding: 8px 20px; background: var(--gradient); color: var(--white); border: none; border-radius: 10px; font-size: 12px; font-weight: 400; cursor: pointer; white-space: nowrap; height: 39px; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { display: flex; align-items: center; gap: 8px; padding: 8px 20px; background: var(--white); color: var(--text-disabled); border: 1px solid var(--text-medium); border-radius: 10px; font-size: 12px; cursor: pointer; white-space: nowrap; height: 39px; transition: background 0.15s; }
.btn-secondary:hover { background: #F9FAFB; }

/* ─── SEARCH BAR (page level) ─────────────────────────────────── */
.page-search-bar { display: flex; gap: 16px; align-items: center; }
.search-field-wrap { position: relative; display: flex; }
.search-field { height: 51px; padding: 0 55px 0 20px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; font-family: var(--font); font-size: 12px; color: var(--text-disabled); outline: none; width: 391px; }
.search-field::placeholder { color: var(--text-disabled); }
.search-field-btn { position: absolute; right: 0; top: 0; width: 55px; height: 51px; background: none; border: none; border-left: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.select-field { height: 51px; padding: 0 44px 0 20px; text-overflow: ellipsis; background: var(--white); border: 1px solid var(--border); border-radius: 10px; font-family: var(--font); font-size: 12px; color: var(--text-disabled); outline: none; width: 214px; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg width='11' height='7' viewBox='0 0 11 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5.5 6L10 1' stroke='%2329303A' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; }

/* ─── DATA TABLE ───────────────────────────────────────────────── */
.data-panel { background: var(--white); border-radius: var(--radius-xl); padding: 0; box-shadow: var(--shadow); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table thead tr { background: var(--bg-content); }
.data-table thead th { padding: 13px 12px; font-weight: 400; color: var(--text-medium); text-align: left; white-space: nowrap; font-size: 14px; }
.data-table thead th:first-child { padding-left: 20px; }
.data-table thead th.center { text-align: center; }
.data-table tbody tr { border-bottom: 1px solid var(--bg-content); transition: background 0.1s; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFAFA; }
.data-table tbody td { padding: 14px 12px; vertical-align: middle; }
.data-table tbody td:first-child { padding-left: 20px; }
.data-table tbody td.center { text-align: center; }
.checkbox { width: 16px; height: 16px; border: 1.5px solid var(--text-medium); border-radius: 2px; cursor: pointer; }
.item-cell { display: flex; align-items: center; gap: 12px; }
.item-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.item-thumb-placeholder { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(270deg, #FF8C3B 0%, #FF6348 93.6%); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.item-thumb-grey { width: 36px; height: 36px; border-radius: 8px; background: #C4C4C4; flex-shrink: 0; }
.item-name { font-size: 14px; font-weight: 600; color: var(--text-medium); }
.item-sub { font-size: 11px; color: var(--text-disabled); margin-top: 3px; }

/* ─── STATUS BADGES ────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius); font-size: 13px; white-space: nowrap; }
.badge-conforme   { background: #F7FAEF; color: #B0CA5B; }
.badge-incomplet  { background: #E9F9FD; color: #25C2EA; }
.badge-danger     { background: #FFE5E5; color: #FF0000; }
.badge-controle   { background: #E9F2ED; color: #217B4E; }
.badge-blue       { background: #EFF6FF; color: #1447E6; }
.badge-red        { background: #FEF2F2; color: #C10007; }
.badge-orange     { background: #FFF7ED; color: #E7460C; }
.badge-cat { background: var(--gradient); color: var(--white); font-size: 12px; font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: #B0CA5B; }
.dot-cyan   { background: #25C2EA; }
.dot-red    { background: #FF0000; }
.dot-dkgreen{ background: #217B4E; }

/* ─── PROGRESS BAR ─────────────────────────────────────────────── */
.progress-wrap { width: 119px; height: 2px; background: rgba(255,137,60,0.09); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: #FF893C; border-radius: 100px; }

/* ─── KPI CARDS ─────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-card { background: var(--white); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.kpi-icon-wrap { width: 34px; height: 34px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-header { display: flex; align-items: center; gap: 12px; }
.kpi-title { font-size: 14px; font-weight: 600; color: var(--text-dark); white-space: nowrap; }
.kpi-value { font-size: 24px; font-weight: 600; color: var(--text-dark); line-height: 1; }
.kpi-desc { font-size: 14px; color: var(--text-muted); }
.kpi-progress { height: 5px; border-radius: 10px; background: #F3F4F6; overflow: hidden; width: 100%; margin-top: 10px; }
.kpi-progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(269deg, #FF8C3B 0%, #FF6348 93.6%); }
.kpi-cta { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #FEF2F2; border-radius: var(--radius); border: none; cursor: pointer; font-size: 14px; color: var(--text-medium); font-family: var(--font); width: fit-content; transition: opacity 0.15s; }
.kpi-cta:hover { opacity: 0.8; }

/* ─── CHARTS PANEL ──────────────────────────────────────────────── */
.charts-row { display: flex; gap: 16px; align-items: flex-start; }
.chart-panel { flex: 0 0 auto; width: 63%; background: var(--white); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); height: 357px; display: flex; flex-direction: column; gap: 16px; }
.cat-panel { flex: 1; background: var(--white); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); height: 357px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.panel-title { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.panel-sub { font-size: 14px; color: #4A5565; line-height: 16px; }
.chart-body { display: flex; gap: 16px; flex: 1; min-height: 0; align-items: center; }
.legend-list { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }
.legend-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.legend-left { display: flex; align-items: center; gap: 8px; }
.legend-count { font-size: 14px; font-weight: 700; }
.legend-label { font-size: 12px; font-weight: 500; }
.table-header-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--bg-content); border-radius: var(--radius); font-size: 14px; color: var(--text-medium); flex-shrink: 0; }
.cat-list { display: flex; flex-direction: column; overflow-y: auto; flex: 1; }
.cat-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--bg-content); }
.cat-row:last-child { border-bottom: none; }
.cat-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--gradient-icon); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); flex-shrink: 0; }
.cat-name { font-size: 14px; font-weight: 600; color: var(--text-medium); }
.cat-count { font-size: 14px; font-weight: 600; color: var(--text-dark); }

/* ─── FORM ──────────────────────────────────────────────────────── */
.form-panel { background: var(--white); border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow); max-width: 800px; }
.form-section { margin-bottom: 32px; }
.form-section-title { font-size: 16px; font-weight: 600; color: var(--text-dark); margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-medium); }
.form-input { height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 14px; color: var(--text-medium); outline: none; transition: border-color 0.15s; background: var(--white); }
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-disabled); }
.form-select { height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 14px; color: var(--text-medium); outline: none; background: var(--white); appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg width='11' height='7' viewBox='0 0 11 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5.5 6L10 1' stroke='%2329303A' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.form-textarea { padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 14px; color: var(--text-medium); outline: none; resize: vertical; min-height: 120px; transition: border-color 0.15s; }
.form-textarea:focus { border-color: var(--primary); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer; text-align: center; transition: border-color 0.15s; }
.upload-zone:hover { border-color: var(--primary); }
.upload-icon { width: 40px; height: 40px; }
.upload-text { font-size: 14px; color: var(--text-muted); }
.upload-hint { font-size: 12px; color: var(--text-light); }

/* ─── SETTINGS ──────────────────────────────────────────────────── */
.settings-panel { background: var(--white); border-radius: var(--radius-xl); padding: 24px 32px; box-shadow: var(--shadow); }
.settings-section { border-bottom: 1px solid var(--bg-content); padding-bottom: 28px; margin-bottom: 28px; }
.settings-section:last-child { border-bottom: none; margin-bottom: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.settings-label { font-size: 14px; font-weight: 500; color: var(--text-medium); }
.settings-value { font-size: 14px; color: var(--text-muted); }
.settings-edit { color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; }

/* ─── MODAL OVERLAY ─────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--white); border-radius: var(--radius-xl); padding: 32px; max-width: 680px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 600; color: var(--text-dark); }
.modal-close { width: 32px; height: 32px; border: none; background: var(--bg-content); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-item { display: flex; flex-direction: column; gap: 6px; }
.detail-label { font-size: 12px; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-value { font-size: 14px; font-weight: 600; color: var(--text-medium); }

/* ─── FORMATIONS TABLE ─────────────────────────────────────────── */
.formations-panel { background: var(--white); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.formations-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.formations-title { font-size: 14px; font-weight: 600; color: #000; }

/* ─── RESPONSIVE UTILS ─────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.mt-16 { margin-top: 16px; }

/* Alertes de succès fermables (assets/js/alerte.js) */
.alerte-fermable { position: relative; padding-right: 40px !important; transition: opacity .4s ease; }
.alerte-fermable.alerte-masquee { opacity: 0; }
.alerte-fermer { position: absolute; top: 4px; right: 8px; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 4px; opacity: .7; }
.alerte-fermer:hover, .alerte-fermer:focus-visible { opacity: 1; background: rgba(0, 0, 0, .08); }
