:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  background: var(--card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 {
  font-size: 18px;
  margin: 0;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar nav a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover {
  background: var(--primary-dark);
}
.btn-secondary {
  background: var(--muted);
}
.btn-danger {
  background: var(--danger);
}
.btn-block {
  display: block;
  width: 100%;
}
label {
  display: block;
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
form {
  margin: 0;
}
.error {
  background: #fee2e2;
  color: var(--danger);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-a_faire {
  background: #fef3c7;
  color: var(--warning);
}
.badge-en_cours {
  background: #dbeafe;
  color: var(--primary);
}
.badge-termine {
  background: #dcfce7;
  color: var(--success);
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row .btn {
  flex: 1;
}
.intervention-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
}
.intervention-item .heure {
  font-weight: 700;
  color: var(--primary);
}
.intervention-item .client {
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0;
}
.intervention-item .adresse {
  color: var(--muted);
  font-size: 14px;
}
.intervention-item .tech {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.date-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.date-nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  padding: 0 6px;
}
.date-nav input[type='date'] {
  flex: 1;
}
.week-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.today-jump {
  text-align: center;
  margin-bottom: 16px;
}
.day-add-link {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 10px;
}
.week-grid-wrap {
  overflow-x: auto;
  border-radius: 10px;
  margin-top: 12px;
  -webkit-overflow-scrolling: touch;
}
.week-grid {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(104px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  min-width: 800px;
}
.grid-corner,
.grid-day-header,
.grid-hour-label,
.grid-cell {
  background: var(--card);
}
.grid-corner,
.grid-hour-label {
  position: sticky;
  left: 0;
  z-index: 2;
}
.grid-day-header {
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.grid-day-header.today {
  background: #eff6ff;
  color: var(--primary);
}
.grid-hour-label {
  padding: 6px 4px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
}
.grid-cell {
  min-height: 46px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: default;
}
.grid-cell.addable {
  cursor: pointer;
  text-decoration: none;
}
.grid-cell.addable:hover {
  background: #f8fafc;
}
.grid-event {
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  color: #fff;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  text-decoration: none;
  display: block;
}
.grid-event.status-a_faire {
  background: var(--warning);
}
.grid-event.status-en_cours {
  background: var(--primary);
}
.grid-event.status-termine {
  background: var(--success);
}
.note {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 14px;
}
.note:last-child {
  border-bottom: none;
}
.note .meta {
  color: var(--muted);
  font-size: 12px;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px 0;
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
}
.login-card h1 {
  text-align: center;
  margin-top: 0;
  font-size: 22px;
}
.paiement-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}
