.attendance-field {
  margin: 0 0 6px;
  padding: 5px;
  border: 1px dashed #cc8c8d;
  border-radius: 10px;
  background: #fff1f0;
  color: #842d34;
}
.attendance-field.has-content { border-style: solid; }
.attendance-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  width: 100%;
  border: 0;
  padding: 2px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.attendance-day-title, .attendance-add strong {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .025em;
}
.attendance-add > span { font-weight: 700; }
.attendance-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 5px;
  padding: 3px 4px;
  margin-top: 3px;
  border-radius: 5px;
  background: #fce0e0;
  font-size: .75rem;
  overflow-wrap: anywhere;
}
.attendance-entry small, .attendance-history small, .attendance-table small {
  display: block;
  font-size: .88em;
}
.attendance-entry button, .attendance-link {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.attendance-entry button { padding: 3px 0; }
.attendance-entry.is-excused, .attendance-profile-list .is-excused, .attendance-table .is-excused {
  background: #e7f6e7;
  color: #195a35;
}
.attendance-green { color: #195a35; }
.attendance-dialog {
  width: min(31rem, calc(100vw - 24px));
  max-height: min(85dvh, 45rem);
  border: 1px solid #c9d4e5;
  border-radius: 18px;
  padding: clamp(12px, 3vw, 22px);
  background: #fff;
  color: #1c2c49;
  overflow-y: auto;
}
.attendance-dialog::backdrop { background: #1b284f88; }
.attendance-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.attendance-dialog__header h2 { margin: 0; font-size: clamp(1.05rem, 4vw, 1.3rem); }
.attendance-dialog label { display: block; font-weight: 650; }
.attendance-dialog input[type="search"] { width: 100%; margin: 4px 0 8px; }
.attendance-picker__list { display: grid; gap: 4px; max-height: 45dvh; overflow-y: auto; }
.attendance-picker__list button {
  border: 1px solid #e8c6c6;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff7f6;
  color: #72292e;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.attendance-picker__list button:hover { background: #fce0e0; }
.attendance-status { margin: 6px 0 0; font-size: .9rem; }
.attendance-month, .attendance-total, .attendance-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-block: 10px;
}
.attendance-table { width: auto; border-collapse: collapse; font-size: .9rem; }
.attendance-table th, .attendance-table td {
  padding: 5px clamp(4px, 1vw, 12px);
  border-bottom: 1px solid #dbe1eb;
  text-align: left;
  vertical-align: top;
}
.attendance-table th { font-size: .85em; }
.attendance-table th:last-child, .attendance-table td:last-child { text-align: right; padding-inline: 5px; }
.attendance-table tr.is-withdrawn { color: #586278; background: #f4f6f9; }
.attendance-link { padding: 0; font-weight: 700; text-align: left; white-space: nowrap; }
.attendance-profile-list, .attendance-history { margin: 0; padding: 0; list-style: none; }
.attendance-profile-list li, .attendance-history li { padding: 5px 7px; border-bottom: 1px solid #dbe1eb; }
.attendance-profile-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.attendance-periods { border: 1px solid #dbe1eb; border-radius: 8px; margin: 0; padding: 5px 8px; }
.attendance-periods label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 0;
  font-weight: 500;
}
.attendance-periods input { width: auto; margin: 0; }
@media (max-width: 520px) {
  .attendance-table { font-size: .8rem; }
  .attendance-table td { overflow-wrap: anywhere; }
  .attendance-link { white-space: normal; }
}
