/* ---- Global Reset & Base ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

/* ---- Top Navigation ---- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  font-size: 0.85rem;
  color: #555;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: #4285f4; }
.btn-nav-create {
  padding: 0.4rem 1rem;
  background: #4285f4;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-nav-create:hover { background: #3367d6; }

/* ---- Utility classes ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 2rem;
  background: #4285f4;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-primary:hover { background: #3367d6; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-secondary:hover { background: #e0e0e0; }

/* ---- Status Badges ---- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-started { background: #e8f5e9; color: #2e7d32; }
.badge-in-progress { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #f5f5f5; color: #757575; }

/* --- Archived records (admin only) ------------------------------------- */
/* The toggle is a link rather than a checkbox so the state lives in the URL
   and survives a refresh or a shared link. */
.archived-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-left: 0.75rem; padding: 0.3rem 0.7rem;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  border: 1px solid #ccc; border-radius: 999px; color: #666; background: #fff;
}
.archived-toggle:hover { border-color: #999; color: #333; }
.archived-toggle.on { background: #fdf0d5; border-color: #e0a800; color: #8a6100; }
/* Archived rows stay legible but must never be mistaken for live work. */
tr.is-archived { background: #faf6ef; color: #8a7c63; }
tr.is-archived td { font-style: italic; }
.archived-badge {
  display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.4rem;
  font-size: 0.68rem; font-weight: 700; font-style: normal;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: #e0a800; color: #fff; border-radius: 3px;
}

/* Per-row archive control. Deliberately understated: archiving is routine
   housekeeping, not a destructive action to be dramatised -- but it is not
   undoable from the UI either, so it always confirms first. */
.btn-archive {
  padding: 0.18rem 0.5rem; font-size: 0.72rem; font-weight: 600;
  border: 1px solid #d6b8b8; border-radius: 4px;
  background: #fff; color: #a04747; cursor: pointer; white-space: nowrap;
}
.btn-archive:hover { background: #a04747; border-color: #a04747; color: #fff; }
.btn-archive:disabled { opacity: 0.5; cursor: default; }
.archive-col { width: 1%; text-align: center; }
