:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0891b2;
  --accent-dark: #0e7490;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; margin: 0 auto; }

/* Barre du haut */
.navbar { background: #0b1220; color: #fff; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: #fff; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: #cbd5e1; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); }

/* Hero (landing) */
.hero { padding: 80px 24px; text-align: center; background: radial-gradient(ellipse at top, rgba(8,145,178,0.18), transparent 55%), #0b1220; color: #fff; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 16px; }
.hero p { color: #cbd5e1; font-size: 1.1rem; margin: 0 auto 28px; max-width: 560px; }

.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 600; background: var(--accent); color: #fff !important; transition: 0.2s; border: none; cursor: pointer; font-size: 1rem; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: transparent; border: 1px solid #334155; color: #cbd5e1 !important; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* Cartes & sections */
.section { padding: 56px 0; }
.muted { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

/* Formulaires */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.form-card { max-width: 460px; margin: 40px auto; }
.alert { padding: 12px 16px; border-radius: 8px; margin: 12px 0; font-size: 0.95rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; }
tr:hover td { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-nouveau { background: #dbeafe; color: #1e40af; }
.badge-assigne { background: #ede9fe; color: #5b21b6; }
.badge-en_cours { background: #fef3c7; color: #92400e; }
.badge-termine { background: #d1fae5; color: #065f46; }
.badge-valide { background: #dcfce7; color: #166534; }
.badge-rejete { background: #fee2e2; color: #991b1b; }
.badge-urgente { background: #fee2e2; color: #991b1b; }
.badge-haute { background: #ffedd5; color: #9a3412; }

/* Grille KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: #0b1220; color: #fff; border-radius: 12px; padding: 18px; }
.kpi .num { font-size: 1.8rem; font-weight: 700; }
.kpi .lbl { color: #94a3b8; font-size: 0.85rem; }

/* Layout app */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #0b1220; color: #cbd5e1; padding: 20px 0; flex-shrink: 0; }
.sidebar a { display: block; padding: 12px 24px; color: #cbd5e1; }
.sidebar a.active, .sidebar a:hover { background: rgba(8,145,178,0.15); color: #fff; text-decoration: none; }
.main { flex: 1; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* Photos */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photos img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* Responsive */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0; }
  .sidebar a { flex-shrink: 0; }
  .main { padding: 16px; }
}
