:root {
  --navy: #15233d;
  --navy-light: #1e3a5f;
  --navy-soft: #1f2f4d;
  --gold: #e8a838;
  --gold-dark: #c98c1f;
  --text-muted: #94a3b8;
  --bg-app: #f4f6fa;
  --card-radius: 14px;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-app);
  color: #1c2b3a;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  min-height: 100vh;
  color: #fff;
  width: 260px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 1.25rem 0;
  z-index: 1030;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo {
  width: 42px; height: 42px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--navy);
}
.sidebar .brand h1 { font-size: 1.05rem; font-weight: 700; margin: 0; color: #fff; }
.sidebar .brand small { color: var(--text-muted); font-size: .72rem; }

.sidebar .user-box {
  margin: 1rem 1.25rem;
  padding: .75rem;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  display: flex; align-items: center; gap: .6rem;
}
.sidebar .user-box .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.sidebar .user-box .name { font-size: .85rem; font-weight: 600; color: #fff; }
.sidebar .user-box .role { font-size: .72rem; color: var(--text-muted); }

.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 1rem 1.25rem .35rem; }
.sidebar .nav-link {
  color: #cbd5e1;
  padding: .55rem 1.25rem;
  font-size: .88rem;
  display: flex; align-items: center; gap: .65rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
  background: rgba(232,168,56,.12);
  color: #fff;
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar .nav-link i { width: 18px; text-align: center; }
.sidebar .logout-link { color: #f3a3a3; }

/* ---------- Main content ---------- */
.main-content { margin-left: 260px; padding: 1.75rem 2rem; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.topbar h2 { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin: 0; }
.topbar .breadcrumb-sub { font-size: .85rem; color: #64748b; }

/* ---------- Cards / KPI ---------- */
.kpi-card {
  background: #fff; border-radius: var(--card-radius);
  padding: 1.1rem 1.3rem; box-shadow: 0 2px 10px rgba(15,35,61,.06);
  border: 1px solid #eef1f6;
  height: 100%;
}
.kpi-card .kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  font-size: 1.2rem; margin-bottom: .6rem;
}
.kpi-card .kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.kpi-card .kpi-label { font-size: .8rem; color: #64748b; }

.bg-soft-navy { background: rgba(31,56,95,.1); color: var(--navy); }
.bg-soft-gold { background: rgba(232,168,56,.18); color: var(--gold-dark); }
.bg-soft-green { background: rgba(46,125,50,.12); color: #2e7d32; }
.bg-soft-red { background: rgba(192,57,43,.12); color: #c0392b; }

.card-app {
  background: #fff; border-radius: var(--card-radius);
  border: 1px solid #eef1f6; box-shadow: 0 2px 10px rgba(15,35,61,.05);
}
.card-app .card-app-header {
  padding: 1rem 1.3rem; border-bottom: 1px solid #f0f2f6;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; color: var(--navy);
}
.card-app .card-app-body { padding: 1.3rem; }

/* ---------- Buttons ---------- */
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); color:#fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }

/* ---------- Badges statut ---------- */
.badge-statut { font-weight: 600; font-size: .72rem; padding: .35em .7em; border-radius: 20px; }
.badge-planifie { background:#dce6f1; color:#1f3864; }
.badge-encours { background:#ffe699; color:#7a5c00; }
.badge-termine { background:#c6e0b4; color:#1e5c25; }
.badge-bloque { background:#f8cbad; color:#8a3a1d; }
.badge-annule { background:#d9d9d9; color:#444; }

.badge-prio-haute { color:#c0392b; font-weight:700; }
.badge-prio-moyenne { color:#e08e0b; font-weight:700; }
.badge-prio-basse { color:#2e7d32; font-weight:700; }

/* ---------- Auth pages (login / 2FA) ---------- */
.auth-wrapper { min-height: 100vh; display: flex; }
.auth-left {
  flex: 1.1; background: linear-gradient(160deg, var(--navy) 0%, #0e1c33 100%);
  color: #fff; padding: 4rem; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-left::after {
  content: ''; position: absolute; right: -120px; top: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.auth-left .brand-row { display:flex; align-items:center; gap:.8rem; margin-bottom: 2.5rem; }
.auth-left .brand-row .logo {
  width: 50px; height:50px; background: var(--gold); border-radius: 12px;
  display:flex; align-items:center; justify-content:center; font-size:1.4rem; color: var(--navy);
}
.auth-left h1 { font-size: 2.1rem; font-weight: 800; line-height: 1.25; }
.auth-left h1 span { color: var(--gold); }
.auth-left p.lead-text { color: #c8d2e0; max-width: 460px; }
.auth-left .feature-item { display:flex; align-items:center; gap:.75rem; margin-top:1rem; color:#d6dee8; }
.auth-left .feature-item .ico {
  width: 34px; height:34px; border-radius:8px; background: rgba(255,255,255,.08);
  display:flex; align-items:center; justify-content:center;
}
.auth-right {
  flex: 1; background: #fff; display:flex; align-items:center; justify-content:center; padding: 2rem;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-weight: 800; color: var(--navy); }
.auth-card .form-label { font-weight: 600; color: var(--navy); font-size: .85rem; }
.auth-card .form-control { padding: .65rem .9rem; border-radius: 9px; border-color: #dde3ec; }
.auth-card .btn-login {
  background: var(--navy); color: #fff; border-radius: 9px; padding: .65rem;
  font-weight: 700; border: none;
}
.auth-card .btn-login:hover { background: var(--navy-light); color:#fff; }

table.table-app thead th {
  background: var(--navy); color: #fff; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .03em; border: none; vertical-align: middle;
}
table.table-app tbody tr:hover { background: #f7f9fc; }
table.table-app td, table.table-app th { vertical-align: middle; }

.progress-bar-gold { background-color: var(--gold); }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .auth-left { display: none; }
}
