:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #171b24;
  --muted: #667085;
  --line: #d9dee8;
  --red: #d8212a;
  --red-dark: #a9141d;
  --green: #17803b;
  --soft-green: #e4f7eb;
  --blue: #2156a5;
  --shadow: 0 12px 28px rgba(23, 27, 36, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

button, input, textarea, select {
  font: inherit;
}

button, .secondary, .primary {
  min-height: 44px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}

textarea { resize: vertical; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.nav form { margin: 0; }

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.login-shell {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: minmax(280px, 520px);
  align-content: center;
  justify-content: center;
  gap: 18px;
}

.login-panel {
  width: 100%;
  display: grid;
  gap: 14px;
}

.disclaimer-panel {
  display: grid;
  gap: 10px;
  line-height: 1.5;
}

.disclaimer-panel h2 {
  margin-bottom: 2px;
}

.disclaimer-panel p {
  margin-bottom: 0;
}

.disclaimer-panel a {
  color: var(--blue);
  font-weight: 700;
}

.help-panel {
  display: grid;
  gap: 12px;
}

.help-panel h1,
.help-panel h2,
.help-panel p {
  margin-bottom: 0;
}

.help-kicker {
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.help-topic {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.help-topic summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 40px 14px 16px;
  position: relative;
}

.help-topic summary::-webkit-details-marker {
  display: none;
}

.help-topic summary::after {
  content: "+";
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.help-topic[open] summary::after {
  content: "\2212";
}

.help-topic summary h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.help-topic-teaser {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}

.help-topic-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.help-topic-body p {
  margin: 0;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }

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

.app-version {
  padding: 16px 0 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.6;
}
.error { color: var(--red-dark); }
.warning {
  border: 1px solid #f0b429;
  border-radius: 8px;
  background: #fff8e6;
  color: #7a4b00;
  padding: 10px 12px;
}

.warning-action {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.warning-action form {
  margin: 0;
}

.warning-button {
  min-height: 34px;
  border: 1px solid rgba(122, 75, 0, 0.28);
  border-radius: 8px;
  background: white;
  color: #7a4b00;
  padding: 6px 10px;
  font-weight: 800;
}
.positive { color: var(--green); }
.negative { color: var(--red-dark); }

.primary, .secondary, .link-button {
  border: 0;
  cursor: pointer;
}

.primary {
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  padding: 10px 14px;
}

.secondary {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 10px 14px;
}

.link-button {
  background: transparent;
  color: var(--blue);
  padding: 0;
  min-height: 0;
}

.link-button.danger {
  color: var(--red-dark);
}

.danger-button {
  border-color: rgba(216, 33, 42, 0.32);
  color: var(--red-dark);
}

button:disabled, .link-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
}

.work-column, .project-column, .compact-form form, .project-list, .settings-layout {
  display: grid;
  gap: 14px;
}

.date-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.date-strip strong { display: block; font-size: 22px; }
#live-clock { font-size: 30px; font-weight: 800; }

.work-switch {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 8px 0;
}

.work-button {
  width: min(360px, calc(100vw - 36px));
  aspect-ratio: 1 / 1;
  display: grid;
  place-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 18px 34px rgba(23, 128, 59, 0.24);
}

.work-button span,
.work-button strong {
  display: block;
}

.work-button strong {
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
}

.work-start-time {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.work-button.is-on {
  background: var(--red);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.22), 0 18px 34px rgba(169, 20, 29, 0.3);
}

.start-time-form {
  width: min(320px, 100%);
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.start-time-form[hidden] {
  display: none;
}

.metrics {
  display: grid;
  gap: 10px;
}

.metric-state-grid,
.metric-total-grid {
  display: grid;
  gap: 10px;
}

.metric-state-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-total-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
}

.metric-balance {
  text-align: left;
}

.metric-balance span {
  font-size: 13px;
}

.metric-balance strong {
  font-size: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-head h1, .section-head h2 { margin: 0; }

.calendar-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-date-nav form {
  margin: 0;
}

.calendar-month-arrow {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  padding: 3px 9px;
  font-size: 12px;
}

.project-option {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-option input {
  width: 20px;
  height: 20px;
}

.project-option small {
  display: block;
  color: var(--muted);
}

.project-option small.positive {
  color: var(--green);
}

.project-option small.negative {
  color: var(--red-dark);
}

.task-selection-row {
  cursor: pointer;
  grid-template-columns: 1fr;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task-selection-row:hover {
  border-color: rgba(33, 86, 165, 0.32);
}

.task-selection-row.is-selected.is-teach-mode {
  background: #eef5ff;
  border-color: rgba(33, 86, 165, 0.56);
  box-shadow: inset 4px 0 0 var(--blue);
}

.task-selection-row.is-selected.is-prep-mode {
  background: var(--soft-green);
  border-color: #98d9b1;
  box-shadow: inset 4px 0 0 var(--green);
}

.task-choice-input {
  display: none;
}

.task-row-content {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.mode-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.mode-toggle button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.mode-toggle button.is-active {
  background: var(--blue);
  color: white;
}

.task-selection-row.is-prep-mode .mode-toggle button.is-active {
  background: var(--green);
}

.task-editor .section-head {
  align-items: start;
}

.task-editor {
  display: grid;
  gap: 16px;
}

.task-page-head {
  grid-column: 1 / -1;
}

.year-picker {
  min-width: 190px;
}

.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checkbox-line input {
  width: 20px;
  height: 20px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.task-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.task-utility-actions form {
  display: grid;
  gap: 6px;
  margin: 0;
}

.task-bookings-panel {
  grid-column: 1 / -1;
}

.task-bookings-title {
  min-width: 0;
}

.task-bookings-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.task-month-filter {
  margin: 0;
}

.task-month-filter select {
  width: auto;
  min-width: 150px;
  padding: 7px 10px;
}

.task-booking-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0 0;
}

.task-booking-meta strong {
  color: var(--text);
}

.task-booking-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.task-booking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.task-booking-row:first-child {
  border-top: 0;
}

.task-booking-row:hover {
  color: var(--blue);
}

.task-booking-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.task-booking-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.task-booking-line small {
  margin-top: 0;
}

.task-summary-panel {
  align-content: start;
  display: grid;
  gap: 14px;
}

.task-pie-wrap {
  display: grid;
  justify-items: center;
  position: relative;
}

.task-pie {
  width: min(180px, 70vw);
  aspect-ratio: 1 / 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px white;
  cursor: help;
}

.task-summary-list {
  display: none;
  gap: 8px;
  position: absolute;
  top: calc(100% + 10px);
  z-index: 6;
  width: min(340px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 12px;
}

.task-pie:hover + .task-summary-list,
.task-pie:focus + .task-summary-list {
  display: grid;
}

.task-summary-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.task-summary-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.summary-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-summary-row small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 12px;
}

.task-picker-list {
  margin-top: 14px;
}

.task-defaults-head {
  margin-top: 22px;
}

.task-picker-row {
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.task-picker-row:hover, .selected-task {
  border-color: rgba(33, 86, 165, 0.44);
  background: #f2f6fc;
}

.task-picker-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--line);
}

.selected-task .task-picker-dot {
  background: var(--blue);
}

.project-summary-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.project-summary {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.project-summary:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-summary small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.project-summary p {
  margin: 6px 0 0;
}

.task-edit-form {
  display: grid;
  gap: 8px;
}

.autosave-status {
  color: var(--muted);
  font-size: 12px;
}

.autosave-status.is-saving {
  color: var(--blue);
}

.autosave-status.is-error {
  color: var(--red-dark);
}

.calendar-layout, .settings-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  display: grid;
  gap: 18px;
}

.settings-layout.task-layout {
  grid-template-columns: minmax(230px, 1fr) minmax(260px, 1fr) minmax(240px, 0.85fr);
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.weekday-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.weekend-header {
  color: #178346;
}

.day-cell {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.day-number {
  font-weight: 800;
}

.off-day { background: var(--soft-green); border-color: #b7e6c7; }
.selected-day { outline: 3px solid rgba(33, 86, 165, 0.24); }
.empty-day {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

.booking {
  border: 1px solid transparent;
  border-top-color: var(--line);
  padding: 0;
}

.booking:first-of-type { border-top: 0; }

.booking-link {
  display: block;
  padding: 10px 0;
}

.booking-link p {
  margin: 6px 0 0;
}

.selected-booking {
  border-color: rgba(33, 86, 165, 0.44);
  border-radius: 8px;
  background: #f2f6fc;
  margin: 8px 0;
  padding: 10px;
}

.selected-booking .booking-link {
  padding: 0;
}

.booking-editor {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.booking-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.booking-modified {
  text-align: center;
}

.booking-duration {
  text-align: right;
}

.modified {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 700;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.add-record {
  margin-bottom: 12px;
}

.last-edit {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0;
}

.holiday-total {
  border-top: 1px solid var(--line);
  margin: 10px 0 0;
  padding-top: 10px;
}

.active-users-panel {
  grid-column: 1 / -1;
}

.admin-page-title {
  grid-column: 1 / -1;
}

.admin-page-title h1 {
  margin: 0;
}

.admin-password-panel {
  grid-column: 1 / -1;
}

.admin-allowed-users-panel {
  grid-column: 1 / -1;
}

.settings-share-panel {
  grid-column: 1 / -1;
}

.active-user-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.active-user-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.active-user-row:first-child {
  border-top: 0;
}

.active-user-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.active-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-user-meta span {
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  padding: 3px 8px;
  font-size: 12px;
}

.allowed-user-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.allowed-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 6px 0;
}

.allowed-user-row:first-child {
  border-top: 0;
}

.allowed-user-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.group-settings-panel {
  display: grid;
  gap: 12px;
}

.group-create-form,
.group-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.group-list,
.group-invitation-list {
  display: grid;
  gap: 10px;
}

.group-invitation-list h3,
.group-card h3 {
  margin: 0;
  font-size: 16px;
}

.group-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}

.group-card-head,
.group-invitation-row,
.group-member-row,
.group-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-card-head small,
.group-invitation-row small,
.group-member-row small,
.compact-note {
  color: var(--muted);
}

.group-member-list {
  display: grid;
  gap: 4px;
}

.group-member-row {
  min-height: 34px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.group-member-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.group-member-row small {
  margin-left: 6px;
  font-weight: 600;
}

.group-row-actions form,
.group-card-head form,
.group-member-row form {
  margin: 0;
}

.compact-button {
  min-height: 34px;
  padding: 6px 10px;
}

.danger-lite {
  border-color: #fecaca;
  color: var(--red-dark);
}

.absence-export-panel {
  margin-top: 18px;
}

.absence-page {
  display: grid;
  gap: 14px;
}

.absence-head {
  align-items: start;
}

.absence-filter-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.absence-calendar-wrap {
  overflow-x: auto;
}

.absence-weekday-row,
.absence-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 6px;
  min-width: 720px;
}

.absence-weekday-row {
  margin-bottom: 6px;
}

.absence-weekday-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.absence-week-row {
  margin-bottom: 6px;
}

.absence-month-spacer {
  height: 26px;
  min-width: 720px;
}

.absence-day-cell {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.absence-day-cell.is-muted {
  opacity: 0.45;
}

.absence-day-cell.is-weekend {
  background: var(--soft-green);
  border-color: #b9e8c6;
}

.absence-day-cell.has-absence {
  background: #fff7ed;
  border-color: #fdba74;
}

.absence-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 800;
}

.absence-day-top strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 12px;
}

.absence-names {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: #344054;
  font-size: 12px;
  line-height: 1.2;
}

.absence-names span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.split-slider {
  padding: 0;
}

.correction-form, .mini-projects, .export-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.mini-projects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-projects input {
  width: auto;
}

.holiday-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 6px 0;
}

.holiday-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.holiday-title small {
  color: var(--muted);
  display: inline-block;
  margin-left: 6px;
}

.holiday-remove {
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--red-dark);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.holiday-remove:hover {
  background: rgba(216, 33, 42, 0.08);
}

.export-panel {
  width: min(620px, 100%);
}

.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-panel {
  margin-top: 18px;
}

.report-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.report-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.report-table th {
  font-weight: 800;
}

.report-table .report-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table .report-comment {
  white-space: normal;
  min-width: 180px;
}

.clickable-report-row {
  cursor: pointer;
}

.clickable-report-row:hover th,
.clickable-report-row:hover td,
.clickable-report-row:focus-visible th,
.clickable-report-row:focus-visible td {
  background: #f4f7fb;
}

.report-total-row th,
.report-total-row td {
  border-top: 2px solid var(--line);
  font-weight: 800;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page { padding: 12px; }

  .login-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard, .calendar-layout, .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-layout.task-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-layout .panel,
  .task-layout form,
  .task-layout select,
  .task-layout input,
  .task-layout textarea {
    min-width: 0;
  }

  .task-page-head .section-head,
  .task-bookings-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .task-page-head .inline-form,
  .task-month-filter,
  .year-picker,
  .task-month-filter select {
    width: 100%;
    min-width: 0;
  }

  .task-layout .section-head {
    gap: 8px;
  }

  .task-utility-actions,
  .task-utility-actions form,
  .task-utility-actions button,
  .task-editor .form-actions,
  .task-editor .form-actions button,
  .task-editor .form-actions a {
    width: 100%;
  }

  .task-booking-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .task-booking-row > strong {
    justify-self: start;
  }

  .task-pie-wrap {
    justify-items: stretch;
  }

  .task-pie {
    justify-self: center;
  }

  .task-summary-list {
    width: 100%;
    display: grid;
    position: static;
    box-shadow: none;
  }

  .date-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  #live-clock { font-size: 28px; }

  .work-switch {
    justify-items: center;
  }

  .work-button {
    width: min(300px, calc(100vw - 36px));
    font-size: 26px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 58px;
    padding: 6px;
  }

  .mini-projects {
    grid-template-columns: 1fr;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .active-user-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .group-create-form,
  .group-invite-form,
  .absence-filter-form {
    grid-template-columns: 1fr;
  }

  .group-card-head,
  .group-invitation-row {
    align-items: stretch;
    flex-direction: column;
  }

  .group-row-actions {
    width: 100%;
  }

  .group-row-actions form,
  .group-row-actions button {
    width: 100%;
  }

  .absence-weekday-row,
  .absence-week-row {
    grid-template-columns: repeat(7, minmax(78px, 1fr));
    min-width: 594px;
  }

  .absence-month-spacer {
    min-width: 594px;
  }

  .absence-day-cell {
    min-height: 78px;
    padding: 6px;
  }
}

@media (max-width: 420px) {
  .metric-state-grid,
  .metric-total-grid {
    gap: 8px;
  }

  .metric {
    padding: 11px;
  }

  .metric strong {
    font-size: 19px;
  }

  .nav {
    font-size: 13px;
  }
}
