.admin-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 32px 18px 60px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 30px;
}

.admin-header img {
  width: 150px;
  height: 72px;
  object-fit: contain;
}

.admin-header p:last-child,
.report-heading p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
}

.secondary-button {
  display: inline-flex;
  min-height: 44px;
  padding: 9px 18px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  color: var(--brand-dark);
  background: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button:hover:not(:disabled) {
  color: #fff;
  background: var(--brand);
}

.secondary-button:focus-visible {
  outline: 3px solid rgba(63, 145, 223, 0.3);
  outline-offset: 2px;
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.icon-button {
  width: 44px;
  padding: 9px;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.back-button svg {
  width: 18px;
  fill: currentColor;
}

.admin-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--muted);
}

#report-content {
  display: grid;
  gap: 0;
}

.report-tabs {
  display: flex;
  gap: 6px;
  padding: 0 8px;
  border-bottom: 1px solid #d7dde3;
}

.report-tab {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.report-tab:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.report-tab[aria-selected="true"] {
  color: var(--brand-dark);
  border-bottom-color: var(--accent);
}

.report-tab:focus-visible {
  outline: 3px solid rgba(63, 145, 223, 0.3);
  outline-offset: -3px;
}

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

.report-tab-panel[hidden] {
  display: none;
}

.report-card {
  padding: 28px;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.report-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.report-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.date-chip {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.metric {
  display: flex;
  min-height: 116px;
  padding: 18px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #dce3e9;
  border-radius: 8px;
  background: #f9fafb;
}

.metric > span,
.metric-line span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.metric > strong {
  margin-top: 7px;
  font-size: 2rem;
}

.metric-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-line strong {
  color: var(--brand-dark);
  font-size: 1.8rem;
}

.progress-track {
  height: 10px;
  margin: 12px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6ec;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}

.metric small,
.yearly-row small {
  color: var(--muted);
}

.report-list {
  overflow: hidden;
  border: 1px solid #dce3e9;
  border-radius: 8px;
}

.report-row {
  display: flex;
  min-height: 58px;
  padding: 13px 16px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7ebef;
}

.report-row:last-child {
  border-bottom: 0;
}

.status {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
}

.status-present {
  color: #28714a;
}

.status-absent {
  color: #8a4b48;
}

.daily-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.check-in-link {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--brand-dark);
  border-radius: 7px;
  color: var(--brand-dark);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.check-in-link:hover,
.check-in-link:focus-visible {
  color: #fff;
  background: var(--brand-dark);
}

.yearly-row > div {
  display: grid;
  gap: 3px;
}

.year-percent {
  color: var(--brand-dark);
  font-size: 1.2rem;
}

@media (max-width: 650px) {
  .admin-page {
    padding: 20px 0 40px;
  }

  .admin-topbar {
    padding: 0 18px;
  }

  .admin-header {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
  }

  .admin-header img {
    display: none;
  }

  .report-card {
    padding: 22px 18px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .report-tabs {
    padding: 0 10px;
  }

  .report-tab {
    flex: 1;
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .report-heading {
    display: block;
  }

  .date-chip {
    display: inline-block;
    margin-top: 12px;
  }

  .report-row {
    align-items: center;
  }

  .daily-row-actions {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
}
