* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f2f3f5;
  color: #1a1a2e;
}

/* ---------- Landing page ---------- */
.landing {
  min-height: 100vh;
  background: #2b2b47;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
}
.landing .broom { font-size: 48px; margin-bottom: 8px; }
.landing h1 { color: #fff; font-size: 26px; margin: 0 0 4px; text-align: center; }
.landing .subtitle { color: #b7b9d6; margin: 0 0 32px; }
.landing .users {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.landing .users .autre { grid-column: 1 / span 2; }
.user-btn {
  background: #4a4a6a;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.user-btn:hover { background: #5a5a80; }
.user-btn.autre { background: #3f3f66; color: #b9a6ff; }

.qr-wrap { margin-top: 48px; text-align: center; color: #b7b9d6; }
.qr-wrap img { margin-top: 12px; border-radius: 8px; background:#fff; padding: 8px; width: 150px; height: 150px; }

/* ---------- App shell ---------- */
.app-header {
  background: #1c1c30;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.app-header .title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.app-header .date { color: #a9abcf; font-size: 13px; margin-top: 2px; }
.logout-btn {
  background: #3a3a5c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.tabs {
  display: flex;
  background: #1c1c30;
  padding: 0 12px;
  border-bottom: 1px solid #33335a;
}
.tab {
  flex: 1;
  text-align: center;
  color: #a9abcf;
  padding: 12px 8px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 3px solid transparent;
}
.tab.active { color: #ff5c6c; border-bottom-color: #ff5c6c; font-weight: 600; }

.content { padding: 20px 16px 90px; max-width: 620px; margin: 0 auto; }
.date-heading { text-align: center; color: #666; margin: 4px 0 16px; font-size: 14px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

/* Pointage */
.pointage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: center;
}
.pointage-grid .label { color: #888; font-size: 13px; margin-bottom: 10px; }
.geo-status {
  background: #eef0f4;
  border-radius: 10px;
  padding: 12px 8px;
  color: #888;
  font-size: 14px;
  margin-bottom: 6px;
}
.geo-status.ok { background: #e4f7ea; color: #1f9d4e; font-weight: 600; }
.geo-status.err { background: #fdecec; color: #d33; font-weight: 600; }
.sortie-btn {
  width: 100%;
  background: #3f6fce;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 8px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 6px;
}
.sortie-btn:disabled { background: #cdd3e0; cursor: not-allowed; }
.time-value { color: #444; font-size: 14px; font-weight: 600; }
.time-placeholder { color: #bbb; }

/* Progression */
.progress-card { display: flex; justify-content: space-between; align-items: center; }
.progress-card .bar-wrap { width: 100%; background: #e7e9ef; border-radius: 6px; height: 8px; margin-top: 10px; overflow: hidden; }
.progress-card .bar { background: #3f6fce; height: 100%; border-radius: 6px; transition: width .25s; }
.progress-header { display: flex; justify-content: space-between; width: 100%; font-weight: 600; }

/* Task rows */
.task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
}
.task-row .circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #c7cad6;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.task-row.done .circle { background: #3fce7a; border-color: #3fce7a; color: #fff; font-size: 14px; }
.task-row.done .task-name { color: #999; text-decoration: line-through; }
.task-name { font-size: 15px; font-weight: 500; }

/* Offline banner */
.offline-banner {
  text-align: center;
  color: #d33;
  font-size: 13px;
  margin: 12px 0;
}
.online-banner {
  text-align: center;
  color: #1f9d4e;
  font-size: 13px;
  margin: 12px 0;
}

/* Historique */
.hist-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.hist-row .date { font-weight: 600; font-size: 14px; }
.hist-row .times { color: #888; font-size: 13px; margin-top: 2px; }
.hist-row .tasks-badge { background: #eef0f4; border-radius: 20px; padding: 4px 10px; font-size: 13px; color: #444; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-box { background: #fff; border-radius: 14px; padding: 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-box .value { font-size: 26px; font-weight: 700; color: #3f6fce; }
.stat-box .label { color: #888; font-size: 13px; margin-top: 4px; }

.loading-text { text-align: center; color: #999; padding: 40px 0; }
