
:root {
  color-scheme: light;
  --ink: #182837;
  --muted: #5b6c7b;
  --line: #dce5ea;
  --accent: #087f8c;
  --pale: #e8f6f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f6f7;
  color: var(--ink);
  font: 15px/1.5 system-ui,sans-serif;
}

a {
  color: #006a78;
}

a:focus-visible,.refresh-controls button:focus-visible {
  outline: 3px solid #d7901d;
  outline-offset: 3px;
}

main {
  max-width: 1340px;
  margin: auto;
  padding: 36px 24px 72px;
}

h1 {
  font-size: clamp(1.8rem,5vw,2.7rem);
  line-height: 1.1;
  margin: .25em 0;
}

h2 {
  font-size: 1.2rem;
  margin: 0;
}

p {
  margin: .5em 0;
}

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

header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.refresh-controls {
  max-width: 460px;
  margin-top: 8px;
}

.refresh-source {
  display: grid;
  grid-template-columns: 105px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

#refresh-calendar .refresh-source {
  grid-template-columns: 120px minmax(0,1fr);
}

.refresh-timing {
  font-size: .84rem;
}

.refresh-timing time {
  white-space: nowrap;
}

.refresh-controls button {
  min-height: 44px;
  color: #fff;
  background: #006a78;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.refresh-controls button:enabled:hover {
  background: #005965;
}

.refresh-controls button:disabled {
  color: #405665;
  background: var(--line);
  cursor: default;
}

.refresh-controls p:empty {
  margin: 0;
}

.notice {
  border: 1px solid #e7c980;
  background: #fff9e9;
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 18px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 20px #253f4910;
  padding: 22px;
  margin-bottom: 18px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.team-overdue dl {
  margin: 12px 0 0;
}

.team-overdue dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.team-overdue dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.nav,.filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav h2 {
  min-width: 155px;
  text-align: center;
}

.button {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  font-weight: 600;
}

.button:hover {
  background: #f2f8f8;
}

.button[aria-current] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.person-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 18px;
}

.person-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
}

.person-filters select,.person-filters button {
  background: #fff;
  font: inherit;
}

.person-filters button {
  color: #fff;
  background: #006a78;
  cursor: pointer;
  font-weight: 600;
}

.person-filters button:hover {
  background: #005965;
}

.person-filters :focus-visible {
  outline: 3px solid #d7901d;
  outline-offset: 3px;
}

.view-switcher, .details-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.view-switcher:not(:last-child) {
  margin-bottom: 12px;
}

.details-heading {
  justify-content: space-between;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.weekday {
  text-align: center;
  padding: 8px 2px;
  background: #f7fafb;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 700;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.day {
  min-height: 88px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.day.empty {
  background: #f8fafb;
}

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

.day.today {
  background: var(--pale);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day.has-overdue {
  background: #fff6e5;
  box-shadow: inset 0 0 0 1px #dfa15e;
}

.day[aria-current] {
  box-shadow: inset 0 0 0 2px var(--accent);
}

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

.today-label {
  font-size: .7rem;
  color: #006a78;
  font-weight: 700;
}

.count {
  font-weight: 700;
  font-size: .78rem;
  text-decoration: none;
  border-radius: 20px;
  padding: 3px 8px;
  background: #dff1f0;
  color: #00616c;
}

.day:hover .day-number, .day:hover .count {
  text-decoration: underline;
}

.has-overdue .count {
  background: #ffe6ba;
  color: #7f390a;
}

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr));
  gap: 12px;
  margin-top: 16px;
}

.group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
}

.group h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.details-list {
  display: block;
}

.details-list .group {
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 14px 0;
}

.details-list .group:last-child {
  border-bottom: 0;
}

.item+.item {
  border-top: 1px solid var(--line);
  margin-top: 11px;
  padding-top: 11px;
}

.item.is-overdue {
  border-top: 0;
  border-inline-start: 4px solid #d37d36;
  border-radius: 7px;
  padding: 9px;
  background: #fff5e4;
}

.is-overdue+.item:not(.is-overdue) {
  border-top: 0;
}

.item-title {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.item-meta {
  color: var(--muted);
  font-size: .84rem;
}

.item-meta a {
  margin-left: 8px;
}

.inactive-reviewers {
  color: #763d0c;
  font-weight: 650;
}

.overdue-reviewers {
  background: #ffedcc;
  color: #763d0c;
  border-radius: 4px;
  padding: 1px 4px;
}

.badge {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .02em;
  background: #edf2f4;
  border-radius: 4px;
  padding: 1px 5px;
  color: #405665;
}

.overdue-badge {
  margin-inline-end: 6px;
  white-space: nowrap;
  background: #fff0d2;
  color: #763d0c;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media(max-width:850px) {
  .dashboard-layout {
    display: block;
  }
}

@media(max-width:600px) {
  main {
    padding: 24px 12px 48px;
  }
  .panel {
    padding: 14px;
  }
  .day {
    min-height: 62px;
    padding: 5px 3px;
    gap: 3px;
  }
  .count {
    padding: 2px 5px;
    font-size: .7rem;
  }
  .today-label {
    font-size: .6rem;
  }
  .nav h2 {
    min-width: 135px;
  }
  .toolbar {
    align-items: flex-start;
  }
  .weekday {
    font-size: .67rem;
  }
}

[hidden] { display: none !important; }
