/* ═══════════════════════════════════════════════════════════
   SIGA – ST/CNSA  |  app.css  v3.0  |  Sidebar Premium
═══════════════════════════════════════════════════════════ */

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

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
  --sidebar-w:        270px;
  --sidebar-w-col:     72px;
  --topbar-h:          60px;

  /* Bleu nuit profond */
  --sb-bg:            #050c1a;
  --sb-bg2:           #081426;
  --sb-bg3:           #0b1c36;
  --sb-border:        rgba(255,255,255,.055);
  --sb-active:        rgba(59,130,246,.20);
  --sb-hover:         rgba(255,255,255,.065);
  --sb-accent:        #3b82f6;
  --sb-accent2:       #60a5fa;
  --sb-accent3:       #93c5fd;
  --sb-text:          rgba(255,255,255,.75);
  --sb-text-dim:      rgba(255,255,255,.30);

  --blue:             #1F5C9E;
  --blue2:            #2E6DA4;
  --light-bg:         #EEF2F9;
  --card-bg:          #ffffff;
  --radius:           12px;
  --shadow:           0 4px 20px rgba(0,0,0,.08);
}

/* ── RESET / BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.siga-body {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  background: var(--light-bg);
  margin: 0;
  min-height: 100vh;
  color: #1e293b;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.siga-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg,
      var(--sb-bg)  0%,
      var(--sb-bg2) 50%,
      var(--sb-bg3) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transition: width .32s cubic-bezier(.4,0,.2,1);
  overflow: visible;
  box-shadow:
    4px 0 40px rgba(0,0,0,.5),
    inset -1px 0 0 rgba(255,255,255,.04);
}

/* ── COLLAPSED ────────────────────────────────────────── */
.siga-sidebar.collapsed { width: var(--sidebar-w-col); }

.siga-sidebar.collapsed .sidebar-brand,
.siga-sidebar.collapsed .sidebar-user-info,
.siga-sidebar.collapsed .nav-label,
.siga-sidebar.collapsed .nav-section-label,
.siga-sidebar.collapsed .nav-chevron,
.siga-sidebar.collapsed .nav-sub { display: none; }

.siga-sidebar.collapsed .sidebar-user    { justify-content: center; padding: 10px 6px; }
.siga-sidebar.collapsed .sidebar-notif-btn { display: none; }
.siga-sidebar.collapsed .nav-link-item  { justify-content: center; padding: 11px 0; }
.siga-sidebar.collapsed .nav-icon       { margin: 0; }
.siga-sidebar.collapsed .sidebar-toggle-btn {
  right: 50%;
  transform: translateX(50%);
}
.siga-sidebar.collapsed .logo-aura-wrapper { transform: scale(.72); }

/* ── LOGO ZONE ─────────────────────────────────────────── */
.sidebar-logo-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  overflow: visible;
  z-index: 20;
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
    rgba(59,130,246,.20) 0%, transparent 70%);
}

/* ── LOGO ANIMATION WRAPPER ─────────────────────────────── */
.logo-aura-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .35s ease;
}

.logo-link {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  padding: 5px;
  filter: drop-shadow(0 0 14px rgba(59,130,246,.7));
  transition: filter .3s, transform .3s;
  position: relative;
  z-index: 10;
}
.sidebar-logo:hover {
  filter: drop-shadow(0 0 24px rgba(96,165,250,1));
  transform: scale(1.08);
}

/* ─── RINGS ──────────────────────────────────────────────── */
.logo-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  pointer-events: none;
}

/* Ring 1 – solide bicolore, tourne vite */
.logo-ring-1 {
  width: 70px; height: 70px;
  border-width: 2px;
  border-color: rgba(59,130,246,.7) rgba(59,130,246,.08) rgba(59,130,246,.7) rgba(59,130,246,.08);
  animation: spinRing 4s linear infinite;
}

/* Ring 2 – pointillés, inverse */
.logo-ring-2 {
  width: 84px; height: 84px;
  border-width: 1.5px;
  border-style: dashed;
  border-color: rgba(96,165,250,.4);
  animation: spinRing 8s linear infinite reverse;
}

/* Ring 3 – fin, lent */
.logo-ring-3 {
  width: 98px; height: 98px;
  border-width: 1px;
  border-color: rgba(147,197,253,.20);
  animation: spinRing 14s linear infinite;
}

/* Ring 4 – particules orbitales */
.logo-ring-orbit {
  position: absolute;
  width: 84px; height: 84px;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: spinRing 6s linear infinite;
  pointer-events: none;
}
.logo-ring-orbit::before,
.logo-ring-orbit::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sb-accent2);
  box-shadow: 0 0 8px 3px rgba(96,165,250,.9);
}
.logo-ring-orbit::before { top: -3px; left: 50%; transform: translateX(-50%); }
.logo-ring-orbit::after  { bottom: -3px; left: 50%; transform: translateX(-50%); }

/* Pulse glow derrière le logo */
.logo-pulse {
  position: absolute;
  width: 72px; height: 72px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(59,130,246,.35) 0%,
    rgba(59,130,246,.10) 50%,
    transparent 70%);
  animation: logoPulse 2.8s ease-in-out infinite;
  z-index: 1;
}

/* Halo externe pulsant */
.logo-halo {
  position: absolute;
  width: 72px; height: 72px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(59,130,246,.4);
  animation: haloExpand 2.8s ease-out infinite;
  pointer-events: none;
}
.logo-halo-2 {
  animation-delay: 1.4s;
}

/* ── KEYFRAMES ─────────────────────────────────────────── */
@keyframes spinRing {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes logoPulse {
  0%, 100% { opacity: .45; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.28); }
}

@keyframes haloExpand {
  0%   { transform: translate(-50%,-50%) scale(1);   opacity: .7; }
  100% { transform: translate(-50%,-50%) scale(2.1); opacity: 0; }
}

/* ── BRAND TEXT ─────────────────────────────────────────── */
.sidebar-brand {
  margin-top: 12px;
  text-align: center;
  transition: opacity .2s;
}
.brand-main {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(59,130,246,.5);
}
.brand-sub {
  display: block;
  font-size: .67rem;
  color: var(--sb-accent2);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 3px;
  opacity: .85;
}

/* ── TOGGLE BUTTON ─────────────────────────────────────── */
.sidebar-toggle-btn {
  position: absolute;
  right: 10px; top: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--sb-text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .7rem;
  transition: background .2s, color .2s, border-color .2s;
  z-index: 20;
}
.sidebar-toggle-btn:hover {
  background: var(--sb-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(59,130,246,.5);
}

/* ── USER CARD ──────────────────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  background: rgba(255,255,255,.02);
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59,130,246,.4);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(59,130,246,.3);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: .78rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .62rem; color: var(--sb-accent2);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.sidebar-notif-btn {
  color: var(--sb-text);
  font-size: .88rem;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background .2s, color .2s;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-notif-btn:hover {
  background: var(--sb-hover);
  color: var(--sb-accent2);
}

/* ── NAVIGATION ─────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 3px;
}

.nav-section-label {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--sb-text-dim);
  text-transform: uppercase;
  padding: 14px 10px 5px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  transition: background .18s, color .18s, box-shadow .18s;
  margin-bottom: 2px;
  position: relative;
}
.nav-link-item:hover {
  background: var(--sb-hover);
  color: #fff;
  text-decoration: none;
}
.nav-link-item.active {
  background: var(--sb-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--sb-accent);
}

.nav-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  transition: background .18s, color .18s;
}
.nav-link-item.active .nav-icon,
.nav-link-item:hover .nav-icon {
  background: rgba(59,130,246,.22);
  color: var(--sb-accent2);
}
.nav-label  { flex: 1; white-space: nowrap; }
.nav-chevron {
  font-size: .62rem;
  color: var(--sb-text-dim);
  transition: transform .25s;
  margin-left: auto;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group-toggle { cursor: pointer; }

/* Sub-menu */
.nav-sub {
  display: none;
  padding: 4px 0 4px 16px;
}
.nav-group.open .nav-sub { display: block; }

.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s, color .15s;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
}
.nav-sub-item:hover {
  background: var(--sb-hover);
  color: #fff;
  text-decoration: none;
}
.nav-sub-item.active {
  color: var(--sb-accent2);
  border-left-color: var(--sb-accent);
  background: rgba(59,130,246,.1);
}

/* ── BOTTOM ACTIONS ─────────────────────────────────────── */
.sidebar-bottom {
  padding: 8px 8px 12px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  background: rgba(0,0,0,.15);
}
.nav-logout { color: rgba(252,129,129,.75) !important; }
.nav-logout:hover {
  background: rgba(239,68,68,.12) !important;
  color: #fc8181 !important;
}

/* ── OVERLAY MOBILE ──────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1040;
  backdrop-filter: blur(3px);
}

/* ═══════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════ */
.siga-topbar {
  position: fixed;
  top: 0; right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(0,0,0,.07);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  z-index: 1030;
  transition: left .32s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
}
.siga-topbar.sidebar-collapsed { left: var(--sidebar-w-col); }

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.15rem;
  color: #64748b;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.topbar-menu-btn:hover { background: #f1f5f9; color: var(--blue); }

.topbar-breadcrumb { flex: 1; }
.topbar-title {
  font-size: .96rem;
  font-weight: 700;
  color: #1e293b;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-date {
  font-size: .78rem;
  color: #94a3b8;
  font-weight: 600;
}
.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
  background: #f1f5f9;
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.topbar-icon-btn:hover { background: var(--blue); color: #fff; }

.topbar-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  font-size: .84rem; font-weight: 700; color: #1e293b;
  cursor: pointer; padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.topbar-user-btn::after { display: none; }
.topbar-user-btn:hover  { background: #f1f5f9; }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════ */
.siga-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left .32s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.siga-main.sidebar-collapsed { margin-left: var(--sidebar-w-col); }

.siga-content {
  flex: 1;
  padding-bottom: 50px;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.siga-footer {
  position: fixed; bottom: 0;
  left: var(--sidebar-w); right: 0;
  background: rgba(255,255,255,.96);
  border-top: 1px solid #e2e8f0;
  text-align: center;
  padding: 5px 12px;
  font-size: .72rem;
  color: #94a3b8;
  z-index: 1020;
  backdrop-filter: blur(4px);
  transition: left .32s cubic-bezier(.4,0,.2,1);
}

.siga-footer.sidebar-collapsed { left: var(--sidebar-w-col); }

/* ═══════════════════════════════════════════════════════
   NOTIFICATION BADGE
═══════════════════════════════════════════════════════ */
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--sb-bg);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════════════ */

/* Cards */
.card            { border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-card        { transition: transform .2s, box-shadow .2s; }
.kpi-card:hover  { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(0,0,0,.13) !important; }
.kpi-icon        { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }

/* Inputs */
.siga-input, .form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: .88rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.siga-input:focus, .form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,92,158,.12);
  outline: none;
}

/* Buttons */
.btn { border-radius: 8px; font-weight: 700; font-family: 'Nunito', sans-serif; }
.siga-btn-primary, .btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
  border: none;
  transition: opacity .2s, transform .15s;
}
.siga-btn-primary:hover, .btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-xs { padding: .2rem .5rem; font-size: .75rem; }

/* Tables */
.table { font-size: .86rem; }
.table th {
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .6px; color: #94a3b8; font-weight: 800;
}
.table-hover tbody tr:hover { background-color: #f4f8ff; }

/* Badges */
.badge { font-weight: 700; letter-spacing: .3px; border-radius: 6px; }

/* Modal */
.siga-modal { border-radius: var(--radius); overflow: hidden; border: none; }

/* Toast */
.siga-toast {
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.16);
  border: none;
  min-width: 280px;
  animation: slideInRight .3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

code { background: #eff6ff; color: var(--blue); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

.btn-xs            { padding: .2rem .45rem; font-size: .75rem; }
.x-small           { font-size: .72rem; }
.min-height-80     { min-height: 80px; }
.timeline-steps    { border-left: 2px dashed #e2e8f0; padding-left: 12px; }
.notif-item        { transition: background .2s; }
.notif-item:hover  { background: #f4f8ff !important; }

/* ── LOGIN ─────────────────────────────────────────────── */
.siga-login-bg {
  background: linear-gradient(135deg, #050c1a 0%, #1F5C9E 60%, #050c1a 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card   { border-radius: var(--radius); overflow: hidden; max-width: 440px; width: 100%; }
.login-header { background: linear-gradient(135deg, var(--blue) 0%, #050c1a 100%); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .siga-sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease, width .3s ease;
    width: var(--sidebar-w) !important;
  }
  .siga-sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.mobile-open { display: block; }

  .siga-topbar  { left: 0 !important; }
  .siga-main    { margin-left: 0 !important; }
  .siga-footer  { left: 0 !important; }
  .topbar-menu-btn { display: flex; }
  .sidebar-toggle-btn { display: none; }
}

@media (max-width: 576px) {
  .container-fluid { padding: .75rem; }
  .kpi-card .fs-2  { font-size: 1.4rem !important; }
}

/* ── PRINT ─────────────────────────────────────────────── */
@media print {
  .siga-sidebar, .siga-topbar, .siga-footer,
  .btn, .no-print { display: none !important; }
  .siga-main { margin-left: 0 !important; padding-top: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL FONT SIZE REDUCTION
═══════════════════════════════════════════════════════════ */
html { font-size: 15px; }

body.siga-body { font-size: 1rem; }

h1 { font-size: 1.55rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1.08rem; }
h5 { font-size: 1rem; }
h6 { font-size: .92rem; }

.fs-xs  { font-size: .8rem !important; }
.fs-sm  { font-size: .88rem !important; }

.table         { font-size: .88rem; }
.table th      { font-size: .76rem; }
.badge         { font-size: .74rem; }
.btn           { font-size: .86rem; }
.btn-sm        { font-size: .82rem; }
.btn-xs        { font-size: .76rem; padding: .2rem .5rem; }
.form-control,
.form-select   { font-size: .9rem; }
.form-label    { font-size: .86rem; font-weight: 600; }
.card-header   { font-size: .9rem; }
.dropdown-item { font-size: .86rem; }
.modal-title   { font-size: .98rem; }
.nav-link-item { font-size: .86rem; }
.nav-sub-item  { font-size: .82rem; }
.nav-section-label { font-size: .62rem; }
.topbar-title  { font-size: .95rem; }
.sidebar-user-name { font-size: .82rem; }
.sidebar-user-role { font-size: .68rem; }
.brand-main    { font-size: 1.2rem; }
.brand-sub     { font-size: .62rem; }

/* ═══════════════════════════════════════════════════════════
   USER PROFILE CARD — Premium
═══════════════════════════════════════════════════════════ */
.upc {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Bandeau haut */
.upc-banner {
  height: 80px;
  background: linear-gradient(135deg, #050c1a 0%, #1F5C9E 55%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.upc-banner-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 20px 20px;
}
.upc-banner-glow {
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.3), transparent 70%);
  right: -20px; top: -40px;
}

/* Avatar flottant */
.upc-avatar-area {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: -46px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.upc-avatar-ring {
  width: 92px; height: 92px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #3b82f6, #1F5C9E);
  box-shadow: 0 6px 24px rgba(31,92,158,.35);
}
.upc-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  display: block;
}
.upc-status-dot {
  position: absolute;
  width: 14px; height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  bottom: 4px;
  right: calc(50% - 44px);
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}

/* Contenu */
.upc-content {
  padding: 4px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}
.upc-name {
  font-size: .98rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 4px;
}
.upc-name span { color: #1F5C9E; }

.upc-role {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #1F5C9E15, #3b82f610);
  color: #1F5C9E;
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #1F5C9E25;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.upc-direction {
  font-size: .71rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.upc-sep {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0 30%, #e2e8f0 70%, transparent);
  margin: 12px 0 10px;
}

/* Infos détail */
.upc-info-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.upc-info-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.upc-info-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.upc-ico-blue   { background: #eff6ff; color: #1F5C9E; }
.upc-ico-green  { background: #f0fdf4; color: #16a34a; }
.upc-ico-orange { background: #fffbeb; color: #b45309; }
.upc-ico-purple { background: #faf5ff; color: #7c3aed; }

.upc-info-txt {
  font-size: .72rem;
  color: #334155;
  line-height: 1.5;
  word-break: break-all;
}
.upc-info-label {
  display: block;
  font-size: .64rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.upc-info-txt strong { color: #0f172a; font-weight: 700; }

/* Boutons */
.upc-actions {
  margin-top: 14px;
  width: 100%;
  display: flex;
  gap: 8px;
}
.upc-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  transition: all .2s;
}
.upc-btn-solid {
  background: linear-gradient(135deg, #1F5C9E, #2E6DA4);
  color: #fff;
  box-shadow: 0 3px 10px rgba(31,92,158,.3);
}
.upc-btn-solid:hover { opacity: .88; color: #fff; transform: translateY(-1px); }
.upc-btn-outline {
  background: #f1f5f9;
  color: #1F5C9E;
  border: 1.5px solid #bfdbfe;
}
.upc-btn-outline:hover { background: #dbeafe; color: #1e40af; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════
   KPI CARDS v3
═══════════════════════════════════════════════════════════ */
.kpiv3 {
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px 14px 16px;
  box-shadow: 0 2px 14px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  border-left: 4px solid var(--kc1);
  cursor: default;
}
.kpiv3:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.kpiv3-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--kc1)22, var(--kc2)15);
  color: var(--kc1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.kpiv3-body { flex: 1; min-width: 0; }
.kpiv3-val {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--kc1);
  line-height: 1;
}
.kpiv3-label {
  font-size: .68rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Reflet décoratif */
.kpiv3-shine {
  position: absolute;
  top: -20px; right: -20px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--kc2)18, transparent 70%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER — taille réduite
═══════════════════════════════════════════════════════════ */
.siga-footer {
  font-size: .67rem !important;
}

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER — commun à toutes les pages
═══════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1F5C9E, #2E6DA4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(31,92,158,.3);
}
.page-title {
  font-size: .92rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}
.page-subtitle {
  font-size: .7rem;
  color: #94a3b8;
  font-weight: 600;
}
.btn-back {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: .8rem;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.btn-back:hover { background: #1F5C9E; color: #fff; }

/* Bouton action principal */
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #1F5C9E, #2E6DA4);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .18s, transform .15s;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(31,92,158,.25);
}
.btn-action-primary:hover { opacity: .88; color: #fff; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════
   TABLES — style unifié
═══════════════════════════════════════════════════════════ */
.siga-table { font-size: .77rem; }
.siga-table thead tr {
  background: #f8faff;
}
.siga-table thead th {
  font-size: .67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #94a3b8;
  padding: 10px 12px;
  border-bottom: 1.5px solid #f1f5f9;
  white-space: nowrap;
}
.siga-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f8faff;
  vertical-align: middle;
}
.siga-table tbody tr:last-child td { border-bottom: none; }
.siga-table tbody tr:hover td { background: #f4f8ff; }

.user-thumb {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}
.code-sm {
  background: #eff6ff;
  color: #1F5C9E;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 5px;
}
.badge-role {
  display: inline-block;
  background: linear-gradient(135deg, #1F5C9E20, #2E6DA415);
  color: #1F5C9E;
  font-size: .67rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid #1F5C9E30;
}
.fw-700 { font-weight: 700 !important; }

/* Badges bootstrap custom */
.bg-success-subtle { background: #f0fdf4 !important; }
.bg-danger-subtle  { background: #fff1f2 !important; }
.bg-primary-subtle { background: #eff6ff !important; }
.bg-warning-subtle { background: #fffbeb !important; }

/* ═══════════════════════════════════════════════════════════
   CARD HEADER CUSTOM
═══════════════════════════════════════════════════════════ */
.card-header-custom {
  padding: 10px 14px;
  background: linear-gradient(135deg, #1F5C9E, #2E6DA4);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

/* ═══════════════════════════════════════════════════════════
   WORKFLOW CARDS
═══════════════════════════════════════════════════════════ */
.workflow-card {
  border-radius: 12px;
  overflow: hidden;
}
.workflow-card-header {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workflow-circuit-badge {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: fit-content;
}
.workflow-initiator {
  font-size: .74rem;
  color: #475569;
}
.workflow-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  flex-shrink: 0;
}
