.presence-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.presence-button span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: #e7f8ef;
  color: #087b55;
  font-weight: 700;
  text-align: center;
}

.presence-modal {
  width: min(520px, calc(100vw - 32px));
}

.presence-list {
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow: auto;
  max-height: min(540px, 65vh);
}

.presence-person {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  background: #fff;
}

.presence-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #15a875;
  box-shadow: 0 0 0 3px #def7ec;
}

.presence-person div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.presence-person span,
.presence-person small {
  color: #66778b;
}

.presence-empty {
  padding: 28px;
  color: #708096;
  text-align: center;
}

td.shift.presence-conflict {
  position: relative;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

td.shift.presence-conflict::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f59e0b;
  pointer-events: none;
}

td.shift.presence-conflict:hover::before {
  content: attr(data-presence-editor) " 正在編輯";
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #253449;
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.login-audit-section {
  min-width: 0;
}

.login-audit-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.login-audit-heading h3 {
  margin: 0 0 4px;
}

.login-audit-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.login-audit-filters label {
  display: grid;
  gap: 5px;
  color: #5f6f83;
}

.login-audit-filters input,
.login-audit-filters select {
  width: 100%;
}

.login-audit-summary {
  margin-bottom: 8px;
  color: #52647a;
}

.login-audit-table-wrap {
  overflow: auto;
  max-height: 430px;
  border: 1px solid #dce5ef;
}

.login-audit-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}

.login-audit-table th,
.login-audit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5ebf2;
  text-align: left;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f9;
}

.login-result {
  font-weight: 700;
}

.login-result.success {
  color: #087b55;
}

.login-result.failed,
.login-audit-error {
  color: #c42935;
}

@media (max-width: 760px) {
  .login-audit-filters {
    grid-template-columns: 1fr 1fr;
  }
}
