.attendance-privacy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dce9e6;
  border-radius: 18px;
  background: #f5fbf9;
}

.attendance-privacy-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.attendance-privacy-note strong,
.attendance-privacy-note small {
  display: block;
}

.attendance-privacy-note small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.75;
}

.attendance-control-panel {
  padding: 14px 16px;
}

.attendance-control-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.attendance-class-select {
  min-width: 260px;
}

.attendance-class-select select {
  width: 100%;
}

.attendance-display-switch,
.attendance-filter-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf9;
  overflow-x: auto;
}

.attendance-display-switch button,
.attendance-filter-switch button {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.attendance-display-switch button.is-active,
.attendance-filter-switch button.is-active {
  color: var(--teal-dark);
  background: #e4f2ee;
  font-weight: 700;
}

.attendance-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.attendance-metric {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e4ecea;
  border-radius: 15px;
  background: #fbfdfc;
}

.attendance-metric.attention {
  border-color: #efd9d4;
  background: #fff9f7;
}

.attendance-metric.late {
  border-color: #eedfc8;
  background: #fffaf3;
}

.attendance-metric-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.attendance-metric.attention .attendance-metric-icon {
  color: #a95353;
  background: #fbe7e4;
}

.attendance-metric.late .attendance-metric-icon {
  color: #ad762c;
  background: #ffefd8;
}

.attendance-metric strong,
.attendance-metric small {
  display: block;
}

.attendance-metric strong {
  color: var(--ink);
  font-size: 17px;
}

.attendance-metric small {
  margin-top: 1px;
  color: var(--muted);
}

.attendance-main-head {
  margin-bottom: 11px;
}

.attendance-filter-switch {
  width: max-content;
  max-width: 100%;
  margin-bottom: 14px;
}

.attendance-student-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.attendance-student-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e1e9e7;
  border-radius: 18px;
  background: #fcfefd;
  color: inherit;
  text-align: right;
  font: inherit;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.attendance-student-card:hover {
  transform: translateY(-1px);
  border-color: #bfd7d1;
  box-shadow: 0 9px 24px rgba(43, 76, 70, .06);
}

.attendance-student-card.has-attention {
  border-color: #ead9cc;
}

.attendance-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px 11px;
}

.attendance-avatar,
.attendance-table-avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-weight: 800;
}

.attendance-avatar {
  width: 44px;
  height: 44px;
}

.attendance-table-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.attendance-avatar img,
.attendance-table-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attendance-avatar img.is-missing,
.attendance-table-avatar img.is-missing {
  display: none;
}

.attendance-person-copy {
  min-width: 0;
}

.attendance-person-copy strong,
.attendance-person-copy small {
  display: block;
}

.attendance-person-copy strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-person-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.attendance-student-card.has-attention .attendance-person-copy small {
  color: #9a6334;
}

.attendance-open {
  color: #83918e;
}

.attendance-student-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #e9efed;
  background: #fafcfb;
}

.attendance-student-stats span {
  min-width: 0;
  padding: 9px 6px;
  text-align: center;
}

.attendance-student-stats span + span {
  border-right: 1px solid #e9efed;
}

.attendance-student-stats small,
.attendance-student-stats strong {
  display: block;
}

.attendance-student-stats small {
  min-height: 30px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 10px;
}

.attendance-student-stats strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}

.attendance-student-stats .absent strong {
  color: #a95353;
}

.attendance-student-stats .late strong {
  color: #ad762c;
}

.attendance-table-person {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.attendance-table-person > strong {
  flex: 1;
}

.attendance-row-attention {
  background: #fffcf7;
}

.attendance-chart-card {
  overflow: hidden;
  border: 1px solid #e1e9e7;
  border-radius: 18px;
  background: #fcfefd;
}

.attendance-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  flex-wrap: wrap;
}

.attendance-chart-head strong,
.attendance-chart-head small {
  display: block;
}

.attendance-chart-head small {
  margin-top: 2px;
  color: var(--muted);
}

.attendance-chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.attendance-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.attendance-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.attendance-chart-legend i.present {
  background: #2e8f78;
}

.attendance-chart-legend i.absent {
  background: #be5d5d;
}

.attendance-chart-legend i.late {
  background: #d49339;
}

.attendance-chart-scroll {
  overflow-x: auto;
  padding: 0 8px 8px;
}

.attendance-chart {
  display: block;
  width: 100%;
  min-width: 660px;
  height: auto;
}

.attendance-chart-grid-line line {
  stroke: #e4ecea;
  stroke-width: 1;
}

.attendance-chart-grid-line text,
.attendance-chart-x-label {
  fill: #82908d;
  font-size: 11px;
}

.attendance-chart-bar.present {
  fill: #2e8f78;
}

.attendance-chart-bar.absent {
  fill: #be5d5d;
}

.attendance-chart-bar.late {
  fill: #d49339;
}

.attendance-chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attendance-chart-line.present {
  stroke: #2e8f78;
}

.attendance-chart-line.absent {
  stroke: #be5d5d;
}

.attendance-chart-line.late {
  stroke: #d49339;
}

.attendance-chart-dot.present {
  fill: #2e8f78;
}

.attendance-chart-dot.absent {
  fill: #be5d5d;
}

.attendance-chart-dot.late {
  fill: #d49339;
}

@media (max-width: 1050px) {
  .attendance-student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .attendance-privacy-note {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .attendance-privacy-note > .status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .attendance-control-row {
    align-items: stretch;
  }

  .attendance-class-select,
  .attendance-display-switch {
    width: 100%;
    min-width: 0;
  }

  .attendance-display-switch {
    justify-content: flex-start;
  }

  .attendance-metrics,
  .attendance-student-grid {
    grid-template-columns: 1fr;
  }

  .attendance-student-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-student-stats span:nth-child(3) {
    border-top: 1px solid #e9efed;
  }

  .attendance-student-stats span:nth-child(4) {
    border-top: 1px solid #e9efed;
  }
}
