:root {
  --pink: #ff6f91;
  --peach: #ffb26b;
  --cream: #fff8f0;
  --text: #2e2a26;
  --muted: #8a8078;
  --border: #f0e4d8;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
}

.muted { color: var(--muted); }
.error { color: #c0392b; font-weight: 600; }

/* --- Login --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(255, 111, 145, 0.15);
}
.login-emoji { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-subtitle { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  margin-bottom: 14px;
}
.login-card button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

/* --- Navigation --- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 18px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.nav-links a.active { color: var(--pink); }
.inline-form { display: inline; }
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  padding: 0;
}
.link-btn.danger { color: #c0392b; }

/* --- Layout --- */
.content {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.admin-content { display: block; }

/* --- Calendrier --- */
.calendar-panel {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  flex: 1;
  box-shadow: 0 6px 20px rgba(0,0,0,0.03);
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
}
.month-nav h2 { margin: 0; min-width: 200px; text-align: center; }
.month-arrow {
  text-decoration: none;
  color: var(--pink);
  font-size: 20px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}
.month-arrow:hover { background: var(--cream); }

table.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
table.calendar th {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  font-weight: 600;
  text-transform: uppercase;
}
table.calendar td {
  border: 1px solid var(--border);
  vertical-align: top;
  height: 90px;
  padding: 6px;
  font-size: 13px;
}
table.calendar td.empty { background: #fdfaf6; }
table.calendar td.today { background: #fff3e9; border-color: var(--peach); }
table.calendar td.has-birthday { background: #fff0f4; }
.day-number { font-weight: 600; margin-bottom: 4px; color: var(--muted); }
table.calendar td.today .day-number { color: var(--peach); }
.birthday-tag {
  background: white;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  margin-bottom: 3px;
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Sidebar --- */
.sidebar {
  width: 280px;
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.03);
}
.sidebar h3 { margin-top: 0; font-size: 15px; }
.upcoming-list { list-style: none; padding: 0; margin: 0; }
.upcoming-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.upcoming-list li:last-child { border-bottom: none; }
.upcoming-when { color: var(--pink); font-weight: 600; white-space: nowrap; margin-left: 8px; }

/* --- Admin --- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-secondary {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 18px;
  font-size: 14px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table .actions { display: flex; gap: 12px; }
.admin-table .actions a { color: var(--pink); text-decoration: none; font-size: 13px; }

/* --- Formulaire --- */
.person-form {
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  max-width: 480px;
}
.person-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.person-form input, .person-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.date-fields {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 10px;
}
.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 10px; }

@media (max-width: 800px) {
  .content { flex-direction: column; }
  .sidebar { width: 100%; }
  table.calendar td { height: 70px; font-size: 11px; }
}
