/* Thème « Suivi des tâches » – inspiré des maquettes fournies */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --app-bg: #F5F7FA;
  --app-card: #FFFFFF;
  --app-text: #1E293B;
  --app-muted: #64748B;
  --app-border: #E5E9F2;
  --app-primary: #2563EB;
  --app-primary-dark: #1D4ED8;
  --app-primary-soft: #EEF3FF;
  --app-green: #16A34A;
  --app-orange: #F59E0B;
  --app-red: #DC2626;
  --app-violet: #7C3AED;
  --bs-primary: #2563EB;
  --bs-primary-rgb: 37, 99, 235;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bs-body-color: #1E293B;
  --bs-body-bg: #F5F7FA;
  --bs-link-color: #2563EB;
  --bs-link-hover-color: #1D4ED8;
  --bs-border-radius: .625rem;
}

body { background: var(--app-bg); color: var(--app-text); }
a { text-decoration: none; }
.text-muted { color: var(--app-muted) !important; }
.btn-primary { --bs-btn-bg: #2563EB; --bs-btn-border-color: #2563EB; --bs-btn-hover-bg: #1D4ED8; --bs-btn-hover-border-color: #1D4ED8; --bs-btn-active-bg: #1E40AF; font-weight: 600; }
.btn-outline-primary { --bs-btn-color: #2563EB; --bs-btn-border-color: #C7D6F8; --bs-btn-hover-bg: #2563EB; --bs-btn-hover-border-color: #2563EB; font-weight: 600; }
.btn { border-radius: .7rem; }
.form-control, .form-select { border-radius: .7rem; border-color: var(--app-border); }
.form-control:focus, .form-select:focus { border-color: #93B4F5; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px; flex: 0 0 260px; background: #fff; border-right: 1px solid var(--app-border);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-brand { display: flex; align-items: center; gap: .75rem; padding: 0 .5rem; color: var(--app-text); font-weight: 700; font-size: 1.15rem; }
.app-brand-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--app-primary); color: #fff; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto; }
.app-nav-title { font-size: .72rem; font-weight: 600; color: var(--app-muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 .75rem .4rem; }
.app-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.app-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: .7rem; color: #334155; font-weight: 500; }
.app-nav a:hover { background: #F1F5FD; color: var(--app-primary); }
.app-nav a.active { background: var(--app-primary-soft); color: var(--app-primary); font-weight: 600; }
.app-nav .bi { font-size: 1.1rem; }
.app-nav .badge { margin-left: auto; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: 1rem 2rem; background: transparent; }
.app-content { padding: .5rem 2rem 2.5rem; }
.app-icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--app-border); background: #fff; display: inline-grid; place-items: center; color: #334155; position: relative; }
.app-icon-btn:hover { color: var(--app-primary); border-color: #C7D6F8; }
.app-icon-btn .app-dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--app-red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.app-search { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--app-border); border-radius: 12px; height: 44px; padding: 0 .9rem; min-width: 240px; flex: 0 1 340px; }
.app-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.app-profile { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--app-border); border-radius: 12px; height: 44px; padding: 0 .75rem 0 .3rem; color: var(--app-text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .75rem; background: #DBEAFE; color: #1D4ED8; flex: 0 0 auto; }
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-c1 { background: #DBEAFE; color: #1D4ED8; } .avatar-c2 { background: #FCE7F3; color: #9D174D; }
.avatar-c3 { background: #DCFCE7; color: #166534; } .avatar-c4 { background: #FEF3C7; color: #92400E; }
.avatar-c0 { background: #EDE9FE; color: #5B21B6; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--app-muted); }

/* ---------- Cartes ---------- */
.app-card { background: var(--app-card); border: 1px solid #E9EDF5; border-radius: 18px; padding: 1.35rem; }
.app-card-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.app-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stat-card { background: #fff; border: 1px solid #E9EDF5; border-radius: 18px; padding: 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .8rem; color: var(--app-text); }
a.stat-card:hover { border-color: #C7D6F8; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.stat-card .stat-label { font-weight: 500; color: #334155; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat-card.stat-primary { background: var(--app-primary); border-color: var(--app-primary); color: #fff; }
.stat-card.stat-primary .stat-label { color: #fff; }
.stat-card.stat-primary .stat-icon { background: #fff; color: var(--app-primary); }
.si-blue { background: #DBEAFE; color: #1D4ED8; } .si-green { background: #DCFCE7; color: #15803D; }
.si-red { background: #FEE2E2; color: #B91C1C; } .si-orange { background: #FEF3C7; color: #B45309; }
.si-violet { background: #EDE9FE; color: #6D28D9; } .si-slate { background: #F1F5F9; color: #334155; }

/* ---------- Badges (toujours icône + texte : pas d'info par la couleur seule) ---------- */
.badge-app { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .3rem .6rem; border-radius: 8px; white-space: nowrap; }
.badge-st-todo { background: #F1F5F9; color: #334155; }
.badge-st-progress { background: #DBEAFE; color: #1D4ED8; }
.badge-st-blocked { background: #FEE2E2; color: #B91C1C; }
.badge-st-waiting { background: #FEF3C7; color: #92400E; }
.badge-st-review { background: #EDE9FE; color: #5B21B6; }
.badge-st-done { background: #DCFCE7; color: #166534; }
.badge-st-cancelled { background: #E2E8F0; color: #475569; text-decoration: line-through; }
.badge-prio-low { background: #F0FDF4; color: #166534; border-radius: 999px; }
.badge-prio-normal { background: #F1F5F9; color: #334155; border-radius: 999px; }
.badge-prio-high { background: #FFEDD5; color: #9A3412; border-radius: 999px; }
.badge-prio-urgent { background: #FEE2E2; color: #B91C1C; border-radius: 999px; }
.alert-late { color: #B91C1C; font-weight: 600; font-size: .8rem; }
.alert-soon { color: #B45309; font-weight: 600; font-size: .8rem; }

/* ---------- Tableaux ---------- */
.table-app { --bs-table-bg: transparent; margin: 0; }
.table-app thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--app-muted); font-weight: 600; border-bottom-color: var(--app-border); white-space: nowrap; }
.table-app td { vertical-align: middle; border-color: #EEF1F6; padding-top: .8rem; padding-bottom: .8rem; }
.table-app tbody tr:hover { background: #FAFBFE; }
.cell-sub { font-size: .78rem; color: var(--app-muted); }

/* ---------- Progression ---------- */
.progress { height: 8px; border-radius: 99px; background: #E2E8F0; }
.progress-bar { background: var(--app-primary); border-radius: 99px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .9rem; }
.timeline .tl-rail { display: flex; flex-direction: column; align-items: center; padding-top: .9rem; }
.timeline .tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--app-primary); background: #fff; flex: 0 0 auto; }
.timeline .tl-line { flex: 1; width: 2px; background: #DBE3F4; margin-top: 4px; }
.timeline li:last-child .tl-line { display: none; }
.timeline .tl-body { flex: 1; min-width: 0; background: #F8FAFD; border-radius: 14px; padding: .75rem .9rem; margin-bottom: .6rem; }
.tl-change { font-size: .82rem; margin-top: .3rem; white-space: pre-line; word-break: break-word; }
.tl-old { color: #B91C1C; } .tl-new { color: #166534; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.kanban-col { background: #EBEFF7; border-radius: 18px; padding: .8rem; min-height: 200px; display: flex; flex-direction: column; gap: .7rem; }
.kanban-col.drag-over { outline: 3px dashed rgba(37, 99, 235, .55); outline-offset: -3px; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; padding: .2rem .35rem; font-weight: 700; font-size: .92rem; }
.kanban-card { background: #fff; border-radius: 14px; padding: .85rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); display: flex; flex-direction: column; gap: .55rem; cursor: grab; }
.kanban-card.is-moving { opacity: .5; }
.kanban-card h3 { font-size: .95rem; font-weight: 600; margin: 0; line-height: 1.35; }
.kanban-card .form-select { font-size: .78rem; padding-top: .2rem; padding-bottom: .2rem; }
.kanban-empty { color: var(--app-muted); font-size: .82rem; text-align: center; padding: 1rem .5rem; }

/* ---------- Divers ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--app-muted); }
.empty-state .bi { font-size: 2.2rem; color: #94A3B8; display: block; margin-bottom: .5rem; }
.filters-card .form-label { font-size: .78rem; font-weight: 600; color: #475569; margin-bottom: .2rem; }
.chart-box { position: relative; height: 280px; }
.comment { background: #F8FAFD; border-radius: 14px; padding: .8rem 1rem; }
.comment-content { white-space: pre-wrap; word-break: break-word; margin: .35rem 0 0; }
.comment-internal { background: #FFFBEB; border: 1px dashed #F59E0B; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.dl-grid dt { color: var(--app-muted); font-weight: 500; }
.dl-grid dd { margin: 0; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, #EEF3FF 0%, #F5F7FA 60%); }
.login-card { width: 100%; max-width: 420px; }
.is-loading { pointer-events: none; opacity: .7; }
.rules { font-size: .82rem; color: #475569; }

/* ---------- Responsive : sidebar repliable ---------- */
.app-sidebar-toggle { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: 0; top: 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 30px rgba(15, 23, 42, .15); }
  .app-sidebar.open { transform: translateX(0); }
  .app-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 1040; display: none; }
  .app-backdrop.show { display: block; }
  .app-sidebar-toggle { display: inline-grid; }
  .app-topbar, .app-content { padding-left: 1rem; padding-right: 1rem; }
  .app-search { flex: 1 1 100%; order: 5; }
}
@media (prefers-reduced-motion: reduce) { .app-sidebar { transition: none; } }
@media print { .app-sidebar, .app-topbar, .no-print { display: none !important; } }
