:root {
  --cyprus: #004741;
  --cyprus-light: #0a6b62;
  --sand: #F0EDE4;
  --sand-dark: #e2ddcf;
  --ink: #16231f;
  --muted: #6b7a75;
  --card-bg: #ffffff;
  --danger: #c0392b;
  --success: #1a7f4f;
  --warning: #b8860b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: var(--sand);
  color: var(--ink);
}

a { color: var(--cyprus); }

/* ---------- Barre de navigation ---------- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--cyprus);
  color: var(--sand);
  flex-wrap: wrap;
  gap: 10px;
}
.navbar .brand { color: var(--sand); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; }
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a, .nav-links button { color: var(--sand); text-decoration: none; }
.nav-links .role-badge {
  background: rgba(240,237,228,.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Layout ---------- */
.page { max-width: 1080px; margin: 32px auto; padding: 0 20px 60px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { margin: 0; font-size: 1.6rem; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-page .card { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; font-weight: 800; font-size: 1.4rem; color: var(--cyprus); margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: .9rem; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stat-card {
  background: linear-gradient(135deg, var(--cyprus) 0%, var(--cyprus-light) 100%);
  color: var(--sand);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.stat-card .label { opacity: .8; font-size: .85rem; margin-bottom: 6px; }
.stat-card .value { font-size: 2rem; font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ---------- Formulaires ---------- */
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: .9rem; font-weight: 600; color: #333; }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--sand-dark);
  border-radius: 8px; font-weight: normal; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyprus-light); outline-offset: 1px; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 160px; }
fieldset { border: 1px solid var(--sand-dark); border-radius: 10px; margin-bottom: 16px; padding: 14px; }
legend { font-weight: 700; padding: 0 6px; color: var(--cyprus); }

/* ---------- Boutons ---------- */
button, .btn { cursor: pointer; font: inherit; }
.btn-primary {
  background: var(--cyprus); color: var(--sand); border: none;
  padding: 11px 20px; border-radius: 8px; text-decoration: none;
  display: inline-block; font-weight: 700;
}
.btn-primary:hover { background: var(--cyprus-light); }
.btn-secondary {
  background: transparent; color: var(--cyprus); border: 1.5px solid var(--cyprus);
  padding: 9px 18px; border-radius: 8px; text-decoration: none; display: inline-block; font-weight: 700;
}
.link-btn { background: none; border: none; color: var(--cyprus); text-decoration: underline; padding: 0; }
.danger { background: #fbeaea; color: var(--danger); border: 1px solid #f3c9c9; border-radius: 8px; padding: 7px 12px; font-weight: 600; }
.small { padding: 4px 9px; font-size: .85rem; }

/* ---------- Tableaux ---------- */
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data th { background: var(--cyprus); color: var(--sand); text-align: left; padding: 10px 12px; font-size: .85rem; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--sand-dark); }
table.data tr.weekend td { background: #fdf1ef; }
table.data tr:nth-child(even):not(.weekend) td { background: #fbfaf7; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-paye { background: #e3f5ea; color: var(--success); }
.badge-attente { background: #fdf3e2; color: var(--warning); }
.badge-role { background: var(--sand-dark); color: var(--cyprus); }

.pay-checkbox { width: 20px; height: 20px; accent-color: var(--cyprus); cursor: pointer; }

/* ---------- Divers ---------- */
.error { color: var(--danger); font-weight: 600; }
.success { color: var(--success); font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; margin-top: 40px; }
.card-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.month-block { margin-bottom: 26px; }
.month-block h3 { color: var(--cyprus); margin-bottom: 4px; }

/* ---------- Mon Profil (carte photo épurée, style "booking app") ---------- */
.profile-card {
  background: var(--card-bg);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,40,35,.14);
  margin-bottom: 22px;
}

.profile-photo-wrap {
  position: relative;
  height: 320px;
  background: linear-gradient(160deg, var(--cyprus-light) 0%, var(--cyprus) 100%);
}
.profile-photo-wrap img.profile-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-photo-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem; font-weight: 800; color: rgba(255,255,255,.55);
}
.profile-photo-gradient {
  position: absolute; left: 0; right: 0; bottom: 0; height: 62%;
  background: linear-gradient(to top, rgba(0,40,36,.68) 0%, rgba(0,40,36,.28) 55%, rgba(0,40,36,0) 100%);
  pointer-events: none;
}
.profile-photo-footer {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 22px 22px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
}
.profile-photo-name { color: #fff; font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.profile-photo-role {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  background: rgba(255,255,255,.92); color: var(--cyprus);
  font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.profile-photo-actions { display: flex; gap: 10px; flex-shrink: 0; }
.photo-icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 12px rgba(0,20,18,.25);
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; text-decoration: none; color: var(--cyprus);
}
.photo-icon-btn:hover { background: var(--sand); }

.profile-stats-row {
  display: flex; justify-content: space-around; align-items: flex-start;
  padding: 24px 16px; gap: 8px;
}
.profile-stats-row .stat-pill {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; flex: 1; min-width: 0;
}
.stat-pill .icon-circle {
  width: 42px; height: 42px; border-radius: 50%; background: var(--sand);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0;
}
.stat-pill .num { font-weight: 800; font-size: 1rem; color: var(--ink); line-height: 1.2; }
.stat-pill .lbl { font-size: .74rem; color: var(--muted); line-height: 1.25; }

.moto-photo-card {
  position: relative; border-radius: 20px; overflow: hidden; height: 180px;
  background: linear-gradient(160deg, var(--cyprus-light) 0%, var(--cyprus) 100%);
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(0,40,35,.12);
}
.moto-photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moto-photo-card .fallback { width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:2.8rem; }
.moto-photo-card .gradient {
  position: absolute; left:0; right:0; bottom:0; height:65%;
  background: linear-gradient(to top, rgba(0,40,36,.7) 0%, rgba(0,40,36,0) 100%);
}
.moto-photo-card .label {
  position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff; font-weight: 700;
}
.moto-photo-card .label .plak { font-size: .78rem; opacity: .85; font-weight: 500; margin-top: 2px; }

.profile-details-list { display: flex; flex-direction: column; gap: 0; }
.profile-details-list .item {
  display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--sand-dark);
  font-size: .95rem;
}
.profile-details-list .item:last-child { border-bottom: none; }
.profile-details-list .item .k { color: var(--muted); }
.profile-details-list .item .v { font-weight: 600; }
