.attendance-report {
  /* .main-content は縦flex。cross軸に margin:auto があると stretch が効かず
     中身の幅に縮むため、タブごとにページ幅が変わってしまう。
     width:100% を明示して、どのタブでも同じ幅（最大1400px）に固定する */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  color: #263238;
}

.attendance-report__period-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid #d9dbea;
  border-radius: 10px;
  background: #fff;
}

.attendance-report__period-link { color: #525b91; text-decoration: none; font-weight: 700; }
.attendance-report__period-link:last-child { text-align: right; }
.attendance-report__period { font-size: 20px; color: #3f4775; }

.attendance-report__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.attendance-report__filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.attendance-report__filter { display: grid; gap: 5px; }
.attendance-report__filter label { color: #596275; font-size: 13px; font-weight: 700; }
.attendance-report__filter select,
.attendance-report__filter input { min-width: 180px; padding: 9px 10px; border: 1px solid #cbd1df; border-radius: 6px; background: #fff; }
.attendance-report__filter-button,
.attendance-report__csv-button { padding: 10px 16px; border: 0; border-radius: 6px; color: #fff; background: #4f5d95; font-weight: 700; text-decoration: none; cursor: pointer; }
.attendance-report__csv-button { white-space: nowrap; background: #27765a; }
.attendance-report__clear-link { padding: 9px 2px; color: #687386; }
.attendance-report__actions { display: flex; align-items: center; gap: 12px; }
.attendance-report__rules-link { color: #525b91; font-size: 14px; font-weight: 700; white-space: nowrap; }

.attendance-report__report-section + .attendance-report__report-section { margin-top: 28px; }
.attendance-report__section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.attendance-report__section-heading { margin: 0; color: #3f4775; font-size: 20px; }

.attendance-report__table-wrap {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid #d5d9e5;
  background: #fff;
}

.attendance-report__table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
.attendance-report__table th,
.attendance-report__table td { padding: 9px 12px; border-right: 1px solid #e4e7ef; border-bottom: 1px solid #e4e7ef; text-align: left; }
.attendance-report__table th { position: sticky; top: 0; z-index: 1; color: #fff; background: #4f577d; font-size: 13px; }
.attendance-report__table tbody tr:nth-child(even) { background: #f8f9fc; }
.attendance-report__table tbody tr.attendance-report__row--warning { background: #fff1cf; }
.attendance-report__table .attendance-report__warning-cell { width: 1%; padding-right: 5px; padding-left: 5px; text-align: center; vertical-align: middle; }
.attendance-report__warning-heading { display: flex; align-items: center; justify-content: center; font-size: 12px; }
.attendance-report__warning-cell .slot-rule-help--warning { display: flex; margin: 0 auto; }
.attendance-report__warning-heading .attendance-report__warning-help { width: 12px; height: 12px; margin-left: 2px; font-size: 9px; }
.attendance-report__empty { padding: 28px !important; color: #6b7280; text-align: center !important; }

.attendance-report__summaries { margin-top: 26px; }
.attendance-report__summary-heading { margin: 0 0 12px; color: #3f4775; }
.attendance-report__table--summary { min-width: 720px; }
.attendance-report__table--summary th { background: #697057; }

@media (max-width: 760px) {
  .attendance-report { padding: 14px; }
  .attendance-report__period-nav { grid-template-columns: 1fr 1fr; }
  .attendance-report__period { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .attendance-report__toolbar { align-items: stretch; flex-direction: column; }
  .attendance-report__actions { align-self: flex-start; }
}
