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

:root {
  --brand:       #6c63ff;
  --brand-dark:  #4f46e5;
  --brand-light: #ede9fe;
  --accent:      #f59e0b;
  --danger:      #ef4444;
  --danger-soft: #fee2e2;
  --success:     #10b981;
  --bg:          #f5f3ff;
  --card:        #ffffff;
  --text:        #1e1b4b;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --radius:      14px;
  --shadow:      0 4px 24px rgba(108, 99, 255, 0.10);
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 48px;
}

/* ── Hero header ──────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #6c63ff 0%, #a78bfa 60%, #f59e0b 100%);
  color: #fff;
  text-align: center;
  padding: 42px 24px 36px;
  position: relative;
  overflow: visible;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,255,255,0.12) 0%, transparent 70%);
}

.hero-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.hero-sub {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.88;
  font-weight: 400;
}

.hero-user {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.30);
  border-radius: 8px;
  padding: 7px 14px;
}

.hero-user strong {
  color: #fff;
}

.hero-user a {
  color: rgba(255,255,255,0.85);
  text-decoration: underline;
  cursor: pointer;
}

.hero-user a:hover {
  color: #fff;
}

/* Badges utilisateur */
.badge-user {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-jean {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-alice {
  background: #fce7f3;
  color: #be185d;
}

/* ── Layout ───────────────────────────────────── */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 0;
}

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(108, 99, 255, 0.08);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.14);
}

h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon { font-size: 1.1rem; }

/* ── Form ─────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="date"],
input[type="time"],
input[type="text"],
input[type="number"],
select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

/* ── Buttons ──────────────────────────────────── */
button {
  padding: 11px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
}

button:active { transform: scale(0.97); }

#btn-ajouter {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
}

#btn-ajouter:hover {
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.45);
  background: linear-gradient(135deg, #7c73ff 0%, var(--brand) 100%);
}

#btn-filtrer {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.25);
}

#btn-filtrer:hover { background: var(--brand-dark); }

button.secondary {
  background: #f3f4f6;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

button.secondary:hover { background: #e5e7eb; color: var(--text); }

button.danger {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 7px;
  box-shadow: none;
}

button.danger:hover { background: #fca5a5; }

/* ── Message feedback ─────────────────────────── */
.message {
  margin-top: 12px;
  font-size: 0.87rem;
  color: var(--success);
  min-height: 18px;
  font-weight: 500;
}

.message.error { color: var(--danger); }

/* ── Filtres ──────────────────────────────────── */
.filtre-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 20px;
}

.filtre-row .field { flex: 1; min-width: 120px; }

/* ── Total box ────────────────────────────────── */
.total-box {
  background: linear-gradient(135deg, var(--brand-light) 0%, #fdf4ff 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.total-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 130px;
}

.total-icon { font-size: 1.8rem; flex-shrink: 0; }

.total-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.total-sep {
  width: 1.5px;
  align-self: stretch;
  min-height: 40px;
  background: #c4b5fd;
  border-radius: 2px;
  flex-shrink: 0;
}

.total-text span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-dark);
  opacity: 0.75;
}

.total-text strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.5px;
}

/* Tarif dans le tableau */
.tarif {
  font-weight: 600;
  color: #059669;
}

/* ── Table ────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead { background: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 100%); }

th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-dark);
  border-bottom: 2px solid #c4b5fd;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover td { background: #faf5ff; }

/* durée en gras coloré */
td strong { color: var(--brand-dark); font-weight: 700; }

/* ── Vide ─────────────────────────────────────── */
.vide {
  text-align: center;
  color: #c4b5fd;
  padding: 36px 0;
  font-size: 0.95rem;
  display: none;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 520px) {
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 18px; }
  .total-text strong { font-size: 1.2rem; }

  .total-box { padding: 14px 16px; gap: 10px; }

  /* Séparateurs verticaux cachés sur mobile */
  .total-sep { display: none; }

  /* Chaque bloc prend 100% de la largeur sur très petit écran */
  .total-item {
    flex: 1 1 calc(50% - 10px);
    min-width: unset;
  }
}
