@font-face {
  font-family: Geist;
  src: url("assets/fonts/Geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #252126;
  --canvas: #f8eef1;
  --muted: #65565f;
  --line: #e9d9e0;
  --cherry: #9e3b5a;
  --accent-soft: #f2dbe3;
  --focus: #9e3b5a;
  --glass-edge: #ffffffd9;
  --glass-shadow: #762c451a;
  --rose-deep: #762c45;
  --rose-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: Geist, sans-serif;
}

body, body.signed-out {
  font-family: Geist, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--canvas) url("assets/rose-field.svg") center top / cover fixed no-repeat;
}

h1, h2, h3, .brand-wordmark, .stat strong { font-family: inherit; }
h1, h2, h3 { text-wrap: balance; }
button, label, th, h1, h2, h3, .eyebrow, .nav-item, #workspace-label { text-transform: none; }
.eyebrow { letter-spacing: 0; font-size: .75rem; line-height: 1rem; font-weight: 500; }
button { transition: transform 300ms var(--rose-ease), opacity 300ms var(--rose-ease); }
button:not(:disabled):active { transform: scale(.98); }
.primary:hover { background: var(--rose-deep); border-color: var(--rose-deep); }
:is(button, input, select, textarea, a, .table-scroll):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 3; top: 8px; left: 8px; padding: 8px 12px; background: white; }

#shell-sidebar, main {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 48px;
}
#shell-sidebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding-block: 24px;
}
.brand { width: auto; color: var(--ink); white-space: nowrap; }
.brand img { width: 36px; height: 36px; }
.brand-wordmark { color: var(--ink); font-size: 1rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -.025em; }
#workspace-nav, #summary, .login-card, .login-story, #attendance-page > .records {
  border: 1px solid var(--glass-edge);
  box-shadow: 0 8px 32px var(--glass-shadow);
  backdrop-filter: blur(24px);
}
#workspace-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  justify-self: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #ffffff85;
}
#workspace-nav .nav-item, #workspace-menu, #shell-header button, #refresh {
  width: auto;
  min-height: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
#workspace-nav .nav-item { display: block; }
#workspace-nav .nav-item:hover, #workspace-nav .nav-item.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--rose-deep);
}
#workspace-menu { display: none; }
#shell-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
#workspace-label { margin: 0; letter-spacing: 0; font-size: .875rem; line-height: 1.25rem; color: var(--ink); }
#shell-header button, #refresh { background: #ffffffb5; border-color: var(--glass-edge); }
#shell-header button:hover, #refresh:hover { background: white; }

main { padding-block: 24px 32px; }
body.signed-out main {
  display: block;
  margin-inline: auto;
  max-width: 1440px;
  padding: 24px;
  min-height: 100dvh;
  background: transparent;
}
#login {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: calc(100dvh - 96px);
  padding: 48px;
  border-radius: 24px;
  background: #f2dbe387;
}
.login-story-copy { position: relative; padding-top: 24px; }
.login-story h2, #login h1, #attendance-page h1 {
  margin: 0;
  font-size: 3.75rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.0625em;
}
.login-story h2 { color: var(--rose-deep); }
.login-story p { margin: 16px 0 0; max-width: 32ch; color: var(--rose-deep); text-wrap: pretty; }
.login-side { display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 24px 40px; }
.login-masthead { display: flex; justify-content: flex-end; font-size: .75rem; line-height: 1rem; color: var(--muted); }
.login-mobile-brand { display: none; }
.login-card {
  align-self: center;
  width: min(100%, 496px);
  margin: 24px auto;
  padding: 40px;
  border-radius: 24px;
  background: #fff9fbc9;
}
#login .eyebrow { margin: 0; text-align: left; letter-spacing: 0; font-size: .75rem; line-height: 1rem; }
#login h1, #attendance-page h1 {
  margin-top: 8px;
  width: fit-content;
  background: linear-gradient(90deg, #000, #666);
  background-clip: text;
  color: transparent;
}
#login h1 + p { margin: 12px 0 0; }
#login form { display: grid; gap: 16px; margin: 32px 0 24px; }
#login form label { font-size: .875rem; line-height: 1.25rem; font-weight: 500; }
#login input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffffe8;
}
.password-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.password-control { position: relative; }
#login #password { padding-right: 64px; }
#forgot-password, #toggle-login-password {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--rose-deep);
  background: transparent;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
#forgot-password:hover, #toggle-login-password:hover { text-decoration: underline; }
#forgot-password { width: auto; margin: 0; }
#toggle-login-password { position: absolute; inset: 0 0 0 auto; padding-inline: 12px; }
#login .primary {
  margin: 8px 0 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}
#login-error:not(:empty) { padding: 8px 12px; border-radius: 8px; }
#login .small { margin-bottom: 0; line-height: 1rem; }
.policy-links a { color: var(--rose-deep); }

#attendance-page .title-row { margin-bottom: 24px; align-items: end; }
#attendance-page .title-row p { margin: 8px 0 0; }
#summary {
  grid-template-columns: 1.25fr repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff85;
}
#summary .stat { min-width: 0; padding: 16px 24px; border: 0; border-radius: 0; background: transparent; color: var(--ink); }
#summary .stat + .stat { border-left: 1px solid var(--line); }
#summary .stat:first-child { background: #f2dbe3bd; color: var(--rose-deep); }
#summary .stat span { color: var(--muted); font-size: .75rem; line-height: 1rem; }
#summary .stat strong { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; }
#attendance-page > .records { background: #ffffffdf; border-radius: 16px; }
#attendance-page .table-heading { padding: 24px 24px 0; }
#attendance-records-heading { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
#attendance-page .filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  padding: 16px 24px 24px;
}
#attendance-page .filters label {
  display: grid;
  gap: 8px;
  min-width: 0;
  width: auto;
  margin: 0;
}
#attendance-page .filters :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fdf8fa;
  font-size: .875rem;
  line-height: 1.25rem;
  transition: transform 500ms var(--rose-ease);
}
#attendance-page .filters select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2365565f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
#attendance-page .filters :is(input, select):focus { transform: translateY(-2px); }
@media (forced-colors: active) {
  #attendance-page .filters select { appearance: auto; background-image: none; }
}
#attendance-page :is(#demo, #loading, #empty), #attendance-page #error:not(:empty) { margin: 0; padding: 12px 24px; }
#attendance-page th { background: #f6edf1; font-size: .75rem; line-height: 1rem; letter-spacing: 0; font-weight: 600; }
#attendance-page :is(th, td) { padding: 12px; }
#attendance-page :is(th, td):first-child { padding-left: 24px; }
#attendance-page :is(th, td):last-child { padding-right: 24px; }
#attendance-page .badge { padding: 4px 8px; border-radius: 6px; }
#attendance-page .working { background: var(--accent-soft); color: var(--rose-deep); }
#attendance-page .staff-history-link { color: var(--rose-deep); }

@media (max-width: 1200px) {
  #shell-sidebar, main { padding-inline: 24px; }
  #workspace-nav .nav-item { padding-inline: 8px; }
  #shell-header { max-width: 16rem; }
  #summary .stat { padding-inline: 16px; }
}
@media (max-width: 1080px) {
  #shell-sidebar { grid-template-columns: 1fr auto; }
  #workspace-menu { display: inline-flex; background: #ffffffb5; border-color: var(--glass-edge); }
  #workspace-nav, #shell-header { grid-column: 1 / -1; display: none; }
  #workspace-menu[aria-expanded="true"] ~ #workspace-nav { display: grid; width: 100%; }
  #workspace-menu[aria-expanded="true"] ~ #shell-header { display: flex; justify-content: flex-start; max-width: none; }
  #shell-sidebar:has(#workspace-menu[aria-expanded="true"]) { min-height: 100dvh; align-content: start; }
  #workspace-nav .nav-item { min-height: 44px; padding-inline: 16px; }
  .login-story { padding: 32px; }
  .login-side { padding-inline: 16px; }
  .login-story h2, #login h1 { font-size: 3rem; }
}
@media (max-width: 760px) {
  #shell-sidebar, main { padding-inline: 16px; }
  body.signed-out main { padding: 16px; }
  #login { display: block; }
  .login-story { display: none; }
  .login-side { min-height: calc(100dvh - 96px); padding: 8px; }
  .login-masthead { justify-content: space-between; align-items: center; gap: 8px; }
  .login-mobile-brand { display: flex; }
  .login-card { padding: 24px; border-radius: 16px; }
  #attendance-page .title-row { flex-wrap: nowrap; align-items: flex-start; }
  #attendance-page h1 { font-size: 2.25rem; line-height: 2.5rem; }
  #refresh { margin-top: 24px; }
  #summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #summary .stat { border-bottom: 1px solid var(--line); }
  #summary .stat:nth-child(odd) { border-left: 0; }
  #summary .stat:nth-last-child(-n+2) { border-bottom: 0; }
  #attendance-page .table-heading { padding: 16px 16px 0; flex-wrap: wrap; }
  #attendance-page .filters { gap: 12px; padding: 16px; }
  #attendance-page .table-scroll { padding: 0 16px 16px; }
  #attendance-page table { display: block; min-width: 0; white-space: normal; }
  #attendance-page thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #rows { display: grid; gap: 8px; }
  #rows tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
  #attendance-page #rows td { grid-column: span 2; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  #attendance-page #rows td:first-child { grid-column: 1 / -1; }
  #attendance-page #rows td:nth-child(2), #attendance-page #rows td:nth-child(3) { grid-column: span 3; }
  #attendance-page #rows td:nth-child(4), #attendance-page #rows td:last-child { grid-column: 1 / -1; }
  #attendance-page #rows td[data-label] { padding: 8px; border-radius: 4px; background: #f9f1f4; }
  #rows td[data-label]::before { display: block; content: attr(data-label); font-size: .75rem; line-height: 1rem; color: var(--muted); }
  #rows td:empty { display: none; }
  #attendance-page .staff-history-link { text-align: left; white-space: normal; }
}
@media (max-width: 600px) {
  #attendance-page .filters { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  button:not(:disabled):active { transform: none; }
  #attendance-page .filters :is(input, select) { transition: none; }
  #attendance-page .filters :is(input, select):focus { transform: none; }
}
