/* ===================================================================
   DOG WALKER – Feuille de style
   Mobile-first, thème nature/vert
   =================================================================== */

:root {
  --vert:       #2E7D32;
  --vert-clair: #e8f5e9;
  --orange:     #E65100;
  --orange-cl:  #FFF3E0;
  --bg:         #F4F6F4;
  --card:       #FFFFFF;
  --texte:      #212121;
  --texte-doux: #666;
  --bord:       #E0E0E0;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
  --radius:     10px;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--texte);
  min-height: 100vh;
}

/* ── Authentification ────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-logo { font-size: 3rem; margin-bottom: 8px; }

.auth-card h1 {
  color: var(--vert);
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.auth-subtitle { color: var(--texte-doux); margin-bottom: 24px; }

/* ── Header ──────────────────────────────────────────────────────── */
.app-header {
  background: var(--vert);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon  { font-size: 1.4rem; }
.app-title { font-size: 1.1rem; font-weight: 700; }
.user-name { font-size: .9rem; opacity: .85; }

.btn-header {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .85rem;
  cursor: pointer;
}
.btn-header:hover { background: rgba(255,255,255,.28); }

/* ── Contenu principal ───────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Alertes ─────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .95rem;
}

.alert-success {
  background: var(--vert-clair);
  border-left: 4px solid var(--vert);
  color: #1B5E20;
}

.alert-error {
  background: #FFEBEE;
  border-left: 4px solid #C62828;
  color: #B71C1C;
}

/* ── Navigation semaine ──────────────────────────────────────────── */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.week-label {
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
  flex: 1;
}

.badge-current {
  display: inline-block;
  background: var(--vert);
  color: #fff;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  font-weight: 600;
}

.btn-nav {
  color: var(--vert);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-nav:hover { text-decoration: underline; }

/* ── Légende ─────────────────────────────────────────────────────── */
.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.legende-item {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  background: #f5f5f5;
}

.legende-item.libre {
  background: #F9F9F9;
  border-left: 4px solid #BDBDBD;
}

/* ── Formulaires ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--texte-doux);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--bord);
  border-radius: 8px;
  font-size: .95rem;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--vert);
  box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}

/* ── Boutons ─────────────────────────────────────────────────────── */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--vert);
  color: #fff;
}
.btn-primary:hover { background: #1B5E20; }

.btn-outline {
  background: transparent;
  color: var(--vert);
  border: 2px solid var(--vert);
}
.btn-outline:hover { background: var(--vert-clair); }

.btn-full { width: 100%; text-align: center; }

.btn-sm { padding: 6px 12px; font-size: .82rem; }

/* ── CALENDRIER DESKTOP (tableau) ────────────────────────────────── */
.calendar-wrapper {
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 640px;
}

.calendar-table th {
  background: var(--vert);
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-size: .85rem;
}

.th-heure { width: 72px; }

.th-jour .jour-court { display: block; font-size: .9rem; font-weight: 700; }
.th-jour .jour-date  { display: block; font-size: .75rem; opacity: .85; }

.th-jour.today { background: #1B5E20; }

.calendar-table td {
  border: 1px solid var(--bord);
  padding: 6px;
  vertical-align: middle;
  text-align: center;
}

.td-heure {
  background: #F9F9F9;
  font-weight: 700;
  font-size: .88rem;
  color: var(--texte-doux);
}

.td-slot.today { background: #F1F8E9; }
.td-slot.passe { opacity: .55; }

/* Slot : select admin */
.select-membre {
  width: 100%;
  padding: 5px;
  border-radius: 6px;
  border: 1.5px solid var(--bord);
  font-size: .82rem;
  background: #fff;
  cursor: pointer;
}

/* Slot : bouton libre */
.btn-libre {
  width: 100%;
  padding: 6px 4px;
  font-size: .78rem;
  background: #FFF8E1;
  border: 1.5px dashed #FFA000;
  border-radius: 6px;
  color: #E65100;
  cursor: pointer;
  font-weight: 600;
}
.btn-libre:hover { background: #FFECB3; }

/* Slot : mon créneau */
.slot-moi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-radius: 6px;
  background: #E8F5E9;
  font-size: .82rem;
  font-weight: 700;
}

.form-slot-inline { display: inline; }

.btn-liberer {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: .9rem;
  padding: 0 4px;
  line-height: 1;
}
.btn-liberer:hover { color: #C62828; }

/* Slot : créneau d'un autre */
.slot-autre {
  padding: 5px 6px;
  border-radius: 6px;
  background: #F5F5F5;
  font-size: .82rem;
  font-weight: 600;
}

.slot-vide-passe { color: #BDBDBD; font-size: .85rem; }

/* ── VUE MOBILE (masquée sur desktop) ────────────────────────────── */
.mobile-view  { display: none; }
.calendar-wrapper { display: block; }

@media (max-width: 700px) {
  .calendar-wrapper { display: none; }
  .mobile-view      { display: block; }
}

/* Carte de jour */
.day-card {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.day-today { border: 2px solid var(--vert); }

.day-card-header {
  background: #EEEEEE;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
}

.day-today .day-card-header {
  background: var(--vert-clair);
  color: #1B5E20;
}

/* Créneau mobile */
.mobile-slot {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bord);
  gap: 14px;
}
.mobile-slot:last-child { border-bottom: none; }

.mobile-heure {
  font-weight: 700;
  font-size: .88rem;
  min-width: 54px;
  color: var(--texte-doux);
}

.mobile-slot-action { flex: 1; }

.mobile-slot.libre .mobile-heure  { color: #E65100; }
.mobile-slot.passe  { opacity: .55; }

.select-membre-mobile {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1.5px solid var(--bord);
  font-size: .9rem;
  background: #fff;
}

.btn-libre-mobile {
  padding: 8px 16px;
  font-size: .85rem;
  background: #FFF8E1;
  border: 1.5px dashed #FFA000;
  border-radius: 8px;
  color: #E65100;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
}
.btn-libre-mobile:hover { background: #FFECB3; }

.slot-nom-moi {
  font-weight: 700;
  font-size: .9rem;
}

.slot-nom {
  font-weight: 600;
  font-size: .9rem;
}

.slot-passe { color: #BDBDBD; }

.btn-liberer-mobile {
  background: none;
  border: 1px solid #BDBDBD;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .78rem;
  color: #999;
  cursor: pointer;
  margin-left: 8px;
}
.btn-liberer-mobile:hover { color: #C62828; border-color: #C62828; }

/* ── Administration ───────────────────────────────────────────────── */
.admin-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.admin-section h2 {
  color: var(--vert);
  font-size: 1.05rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--vert-clair);
}

.help { font-size: .85rem; color: var(--texte-doux); margin-bottom: 12px; }

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.form-inline label { font-size: .85rem; font-weight: 600; display: block; margin-bottom: 4px; }
.form-inline input { padding: 10px; border-radius: 8px; border: 1.5px solid var(--bord); font-size: .9rem; }

.week-shortcuts { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Liste membres */
.membres-list { display: flex; flex-direction: column; gap: 10px; }

.membre-card {
  border: 1px solid var(--bord);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.membre-card.inactif { opacity: .55; background: #FAFAFA; }

.membre-info { display: flex; flex-direction: column; gap: 3px; }
.membre-email { font-size: .82rem; color: var(--texte-doux); }

.membre-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
}

.badge-admin    { background: #EDE7F6; color: #4527A0; }
.badge-membre   { background: #E3F2FD; color: #0D47A1; }
.badge-inactive { background: #EEEEEE; color: #616161; }

/* Formulaire ajout membre */
.form-add-membre .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 500px) {
  .form-add-membre .form-row { grid-template-columns: 1fr; }
}

/* Cron info */
.admin-cron .cron-item {
  background: #F5F5F5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: .88rem;
}

.cron-url {
  display: block;
  margin-top: 6px;
  font-family: monospace;
  font-size: .8rem;
  color: var(--vert);
  word-break: break-all;
  background: var(--vert-clair);
  padding: 6px 8px;
  border-radius: 4px;
}
