/*
 * Payrexx Start — "Sky", after payrexx.com: sky-blue gradient hero,
 * Hanken Grotesk headlines, pill shapes, white cards on light grey and
 * brand lime as the highlight. Colours from the Payrexx palette.
 */
:root {
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --border: #E2E3E3;
  --text: #2C2E2F;
  --muted: #65696B;
  --primary: #00AFF0;          /* cyan-400 */
  --primary-dark: #04729B;     /* cyan-700 */
  --primary-soft: #E5F7FD;     /* cyan-50 */
  --primary-soft-hover: #C5EEF9; /* cyan-100 */
  --lime: #A5F94D;             /* green-400, brand lime */
  --warn: #FBE4E3;
  --warn-text: #A32A2E;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(44, 46, 47, 0.06), 0 2px 8px rgba(44, 46, 47, 0.04);
  --shadow-lg: 0 14px 34px rgba(4, 114, 155, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* the full-bleed hero gradient uses 100vw */
}

/* Topbar: floating pill, like payrexx.com */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  max-width: 1080px;
  margin: 14px auto 0;
  padding: 10px 12px 10px 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(4, 114, 155, 0.16);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo { height: 24px; width: auto; display: block; }
.brand-sep { width: 1px; height: 20px; background: var(--border); }
.brand-word { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; color: var(--text); }

.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.user-name { color: var(--text); font-weight: 600; }
.link {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 14px; padding: 0; text-decoration: underline;
}
.link:hover { color: var(--text); }
.topbar .link {
  background: var(--primary); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.topbar .link:hover { background: var(--primary-dark); color: #fff; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 24px 64px; flex: 1; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

.muted { color: var(--muted); }

/* Tooltip bubble (public/tooltip.js), for elements with data-tip */
.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(44, 46, 47, 0.2);
}
.tooltip[hidden] { display: none; }
.tooltip::after {
  content: "";
  position: absolute; left: 50%; top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.tooltip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--text); }
[data-tip] { cursor: default; }

/* Text for screen readers only */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* Hero on the sky gradient, which also runs behind the floating header */
.hero { position: relative; padding: 32px 0 8px; margin-bottom: 40px; }
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%; width: 100vw; margin-left: -50vw;
  top: -220px; bottom: -110px;
  background:
    radial-gradient(55% 70% at 18% 20%, rgba(78, 195, 240, 0.9) 0%, rgba(78, 195, 240, 0) 70%),
    linear-gradient(180deg, #00AFF0 0%, #4EC3F0 62%, rgba(247, 247, 247, 0) 100%);
}
.hero h1 {
  margin: 0 0 10px;
  color: #fff; font-size: 48px; font-weight: 800;
  letter-spacing: -1.6px; line-height: 1.05;
}
.hero p { margin: 0 0 22px; color: rgba(255, 255, 255, 0.9); font-size: 17px; }

/* Search */
.search { position: relative; max-width: 640px; }
.search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--primary-dark); pointer-events: none;
}
#launch-search {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 50px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(4, 114, 155, 0.22);
  -webkit-appearance: none;
}
#launch-search::placeholder { color: var(--muted); }
#launch-search:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--lime), 0 10px 30px rgba(4, 114, 155, 0.22);
}

/* Hidden by search (beats .card { display: flex }) and empty sections */
.card[hidden], .link-section[hidden], #no-results[hidden] { display: none; }

.empty {
  color: var(--muted); font-size: 15px;
  padding: 28px; text-align: center;
  border: 1px dashed var(--border); border-radius: 16px;
}

/* Link sections */
.link-section { margin-bottom: 32px; }
.section-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  color: var(--text); margin: 0 0 14px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}

/* Cards: icon tile + title. Calm hover: cyan ring and a deeper icon tint, no movement. */
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s ease;
}
.card:hover {
  box-shadow: 0 0 0 1px rgba(0, 175, 240, 0.45), 0 6px 18px rgba(4, 114, 155, 0.12);
}
.card:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.card-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  transition: background 0.15s ease;
}
.card-icon svg { width: 22px; height: 22px; }
.card:hover .card-icon { background: var(--primary-soft-hover); }
.card-title {
  font-weight: 700; font-size: 16px; color: var(--text);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Card that Enter will open */
.card.is-first { box-shadow: 0 0 0 3px var(--lime), var(--shadow-lg); }

/* Team today: who works from home / is out; each group opens to the full list */
.team {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
  margin-bottom: 36px;
}
.team-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.team-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.team-date { color: var(--muted); font-size: 13px; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}
.team-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.team-group[open] { box-shadow: var(--shadow-lg); }
.team-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas: "icon count label" "avatars avatars avatars";
  column-gap: 10px;
  row-gap: 10px;
  align-items: center;
}
.team-icon {
  grid-area: icon;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--status-soft); color: var(--status);
}
.team-icon svg { width: 20px; height: 20px; }
.team-group > summary::-webkit-details-marker { display: none; }
.team-group > summary:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; border-radius: inherit; }
.team-count { grid-area: count; font-size: 26px; font-weight: 800; line-height: 1; color: var(--status); }
.team-label { grid-area: label; font-size: 14px; font-weight: 700; color: var(--text); }
.team-avatars { grid-area: avatars; display: flex; min-height: 28px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--status);
  border: 2px solid var(--surface);
  margin-left: -6px;
  position: relative;
  overflow: hidden;
}
/* Profile photo covers the initials; if it fails it removes itself */
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--surface);
}
.team-avatars .avatar:first-child { margin-left: 0; }
.avatar-more { background: var(--border); color: var(--text); }
.team-people {
  margin: 0; padding: 2px 14px 10px;
  max-height: 300px; overflow: auto;
  border-top: 1px solid var(--border);
}
.team-people ul { list-style: none; margin: 0; padding: 0; }
.team-dept {
  margin: 10px 0 2px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted);
}
.team-people li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.team-people .avatar { margin-left: 0; width: 24px; height: 24px; font-size: 9.5px; border: 0; }
.team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-where { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.team-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.team-foot a { color: inherit; }
/* Status colours (Payrexx palette, dark enough for white initials) */
.team-home { --status: #477900; --status-soft: #E7FFD6; } /* green-700 / green-100 */
.team-out { --status: #BA3437; --status-soft: #FBE4E3; }  /* red-600 / red-100 */

/* Team week page */
.hero-compact h1 { font-size: 40px; }
.team-week {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
}
.team-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.team-week-label { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.team-week-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease;
}
.pill:hover { background: var(--primary-soft-hover); }
.team-table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.team-table th, .team-table td {
  padding: 8px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.team-table thead th { vertical-align: bottom; font-size: 13px; font-weight: 600; color: var(--muted); }
.team-table .day-name { color: var(--text); font-weight: 700; }
.team-table tbody th { font-weight: 600; }
/* Keep names visible while the days scroll sideways on small screens */
.team-table tbody th, .team-table thead th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
}
.team-table tbody tr:last-child > * { border-bottom: 0; }
/* Department header rows */
.team-table .dept-row th {
  padding-top: 16px;
  background: var(--surface);
  font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text);
}
.dept-count {
  margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 11px; letter-spacing: 0;
}
/* Department filter dropdown */
.dept-filter {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.dept-filter select {
  font: inherit; font-weight: 600; color: var(--text);
  min-width: 220px;
  padding: 8px 38px 8px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304729B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.dept-filter select:hover { border-color: var(--primary); }
.dept-filter select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 175, 240, 0.25); }

/* Day columns: equal width, centered, a separator between days */
.team-table .day-col {
  width: 15%;
  text-align: center;
  border-left: 1px solid var(--border);
}
.team-table .is-today { background: var(--primary-soft); }
.day-counts { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
/* Daily counts: icon + number */
.count {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px 2px 5px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.count .ti { width: 13px; height: 13px; }
.count-home { background: #E7FFD6; color: #315600; } /* green-100 / green-800 */
.count-out { background: #FBE4E3; color: #A32A2E; }  /* red-100 / red-700 */
.person { display: inline-flex; align-items: center; gap: 8px; }
.team-table .avatar {
  --status: var(--primary-dark);
  margin-left: 0; width: 24px; height: 24px; font-size: 9.5px; border: 0;
}
/* Day cell: status icon on a tinted tile; part-day absences add their times */
.status {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 10px;
}
.status .ti { width: 18px; height: 18px; flex: 0 0 auto; }
.status small { padding-right: 2px; font-size: 11.5px; font-weight: 700; }
.status-home { background: #E7FFD6; color: #315600; } /* green-100 / green-800 */
.status-out { background: #FBE4E3; color: #A32A2E; }  /* red-100 / red-700 */

/* Loader while the week is fetched */
.team-loading {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 14px; color: var(--muted); font-size: 14px;
}
.spinner {
  width: 18px; height: 18px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--primary-soft-hover);
  border-top-color: var(--primary-dark);
  animation: spin 0.8s linear infinite;
}
.skeleton-row {
  height: 38px; margin-bottom: 8px; border-radius: 10px;
  background: linear-gradient(90deg, #F2F3F3 0%, #E6E8E8 50%, #F2F3F3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .spinner, .skeleton-row { animation: none; }
}

/* Login: full-bleed sky, big rounded card */
body:has(.auth-wrap) {
  background: linear-gradient(165deg, #00AFF0 0%, #4EC3F0 45%, #F7F7F7 100%) fixed;
}
.auth-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.login-card {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(4, 114, 155, 0.25);
  padding: 44px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-logo { height: 34px; width: auto; margin-bottom: 22px; }
.login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin: 0 0 10px; color: var(--text); }
.login-card .muted { font-size: 14px; margin: 0 0 24px; }

.alert {
  background: var(--warn); color: var(--warn-text);
  border-radius: 14px; padding: 10px 12px; font-size: 14px; margin: 0 0 18px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-google {
  width: 100%;
  padding: 13px 18px;
  background: #fff; color: #3c4043; border-color: #dadce0;
}
.btn-google:hover { background: #f8f9fa; border-color: #dadce0; }

@media (max-width: 560px) {
  .topbar { width: calc(100% - 24px); }
  .container { padding: 24px 16px 48px; }
  .hero h1 { font-size: 34px; letter-spacing: -1px; }
  .card-grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
  .login-card { padding: 32px 24px; }
}
