:root {
  --bg: #f1f5f9;
  --card-bg: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warning: #ea580c;
  --border-radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 70px; /* espace pour la nav basse mobile */
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card a.card-link { display: block; color: inherit; }
.card a.card-link:hover { text-decoration: none; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-tile {
  background: white;
  border-radius: var(--border-radius);
  padding: 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-tile .value { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-tile .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

form.form { display: flex; flex-direction: column; gap: 12px; }

label { font-size: 13px; color: var(--muted); font-weight: 600; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], textarea, select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  width: 100%;
  background: white;
  color: var(--text);
}

textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: #94a3b8; }
.btn.secondary:hover { background: #64748b; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.success {
  background: #dcfce7;
  color: #166534;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #f1f5f9; color: var(--muted); }
.badge.warning { background: #ffedd5; color: var(--warning); }
.badge.critical { background: #fee2e2; color: var(--danger); }
.badge.neutral { background: #f1f5f9; color: var(--muted); }
.badge.success { background: #dcfce7; color: #166534; }
.badge.role-pilote { background: #dbeafe; color: #1e40af; }
.badge.role-mecano { background: #fef3c7; color: #92400e; }
.badge.role-admin { background: #fce7f3; color: #9d174d; }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  z-index: 10;
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  font-size: 11px;
  color: var(--muted);
}

.bottom-nav a.active { color: var(--primary); font-weight: 700; }
.bottom-nav .icon { display: block; font-size: 20px; margin-bottom: 2px; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
}

.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; background-color: var(--primary);
  flex-shrink: 0;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-row .info { flex: 1; min-width: 0; }
.list-row .info .title { font-weight: 600; }
.list-row .info .subtitle { font-size: 13px; color: var(--muted); }
