* { box-sizing: border-box; }
:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --primary: #22c55e;
  --primary-600: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #1f2937;
}

/* Base */
html, body { margin:0; padding:0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; }
a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

/* Topbar + brand (corrigé : logo dimensionné, doublons supprimés) */
.topbar { display:flex; align-items:center; justify-content:space-between; padding: 10px 16px;
  background: #0b1220; border-bottom:1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; font-weight:700; }
.brand-logo { max-height: 46px; height:auto; width:auto; display:block; object-fit:contain;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.4)); }
.brand-title { font-weight:700; letter-spacing:.2px; }

.topnav a { margin: 0 8px; color: var(--text); opacity:.9; }
.topnav-right { display:flex; align-items:center; gap:10px;}
.user-badge { opacity:.8; font-size:14px; }

/* Cards / layout */
.card { background: var(--card); border:1px solid var(--border); border-radius: 12px; padding: 16px; }
.grid { display:grid; gap:16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.flex { display:flex; gap:8px; align-items:center; }
.right { margin-left:auto; }

/* Tables */
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align:left; }
.table th { color: var(--muted); font-weight:600; }

/* Badges / KPI */
.kpi { display:flex; align-items:center; justify-content:space-between; }
.kpi .num { font-size: 28px; font-weight: 800; }
.badge { display:inline-block; padding: 2px 8px; border-radius:999px; font-size: 12px; border:1px solid var(--border); color: var(--muted); }
.badge.green { color: #86efac; border-color: #14532d; background: #052e16; }
.badge.orange { color: #fed7aa; border-color: #7c2d12; background: #431407; }
.badge.red { color: #fecaca; border-color: #7f1d1d; background: #450a0a; }

/* Boutons */
.btn, .btn-outline { display:inline-block; padding:8px 12px; border-radius:8px; font-weight:600; border:1px solid transparent; }
.btn { background: var(--primary); color:black; }
.btn:hover { background: var(--primary-600); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: #374151; background:#0b1220; }

/* Bouton danger (visible sur fond sombre) */
.btn-danger {
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(220,20,60,.55);
  background: rgba(220,20,60,.16);
  color: #ffccd3; font-weight: 600; cursor: pointer;
}
.btn-danger:hover { background: rgba(220,20,60,.28); border-color: rgba(220,20,60,.8); color:#fff; }
.btn-danger:disabled { opacity:.5; cursor:not-allowed; }

/* Formulaires */
.input, select, .file { width:100%; padding:10px 12px; border-radius:8px; background:#0b1220; color: var(--text); border:1px solid var(--border); }
.label { display:block; margin-bottom:6px; color: var(--muted); font-size:14px; }
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.actions { display:flex; gap:8px; }
.topbar .btn-outline { padding:6px 10px; font-size:14px; }
.footer { padding:16px; border-top:1px solid var(--border); color: var(--muted); opacity:.8; }

/* Alerts */
.alert { padding: 10px 12px; border-radius:8px; margin-bottom:12px; }
.alert.warn { background:#3f2f03; border:1px solid #7c5e10; color:#fde68a; }
.alert.error { background:#3f0b0b; border:1px solid #7f1d1d; color:#fecaca; }
.alert.ok { background:#052e16; border:1px solid #14532d; color:#86efac; }

/* Misc */
.login-wrap { max-width: 420px; margin: 80px auto; }
.center { text-align:center; }
hr.sep { border: 0; border-top:1px solid var(--border); margin: 16px 0; }
.small { font-size: 12px; color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 16px; }

/* --- Documents: Vue cartes --- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.user-card h3 { margin: 0; font-size: 18px; }
.user-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.user-card__meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.user-card__metrics { list-style: none; padding: 0; margin: 0 0 10px 0; }
.user-card__metrics li { font-size: 14px; margin: 4px 0; }
.user-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Formulaire moderne (édition employé) --- */
.form-modern label { display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.form-modern input[type="text"],
.form-modern input[type="email"],
.form-modern input[type="date"],
.form-modern select {
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border); background:#0b1220; color:var(--text);
}
.form-modern .grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.form-modern .fg { margin-bottom:10px; }
